Enqueue Child Theme’s CSS & Additional CSS in WordPress Editor

/* Enqueue Child Theme style.css to editor */ add_filter(‘block_editor_settings_all’, function($editor_settings) { // Get the URL of the child theme’s style.css $child_theme_style_url = get_stylesheet_directory_uri() . ‘/style.css’; $editor_settings[‘styles’][] = array(‘css’ => wp_remote_get($child_theme_style_url)[‘body’]); return $editor_settings; }); /* Eunqueue Customizer CSS to editor */…Continue reading

Make Elementor Default Editor

/** * Comprehensive solution to make Elementor the default editor * while keeping the “Edit with Elementor” option */ /** * Redirect default WordPress editor to Elementor editor */ function redirect_default_editor_to_elementor() { global $pagenow; // Check if we’re on the…Continue reading

Quiz Score Calculator

// Author: Sumaiya , Clickup Doc: https://app.clickup.com/36636088/v/dc/12y1dr-22535/12y1dr-24415 function calculate_organ_scores($answers) { $scores = [ ‘darm’ => 0, ‘leber’ => 0, ‘nebennieren’ => 0, ‘bauchspeicheldruese’ => 0, ‘schilddruese’ => 0, ]; // Calculate Darm Score $scores[‘darm’] += ($answers[‘frage_1’] == ‘Ja’) ? 1…Continue reading

Shipstation live rates Gemini

/** * ShipStation Integration for WooCommerce – FINAL v5 * * – Fixes Apply Rate scope issue by making methods public. * – Ensures JS uses refreshed nonces correctly. */ if ( ! defined( ‘ABSPATH’ ) ) exit; // —…Continue reading

Admin ShipStation rates

/** * Title: WooCommerce ShipStation Admin Rates * Description: Adds ShipStation live rates to the WooCommerce admin order screen */ // Exit if accessed directly if (!defined(‘ABSPATH’)) { exit; } class WC_ShipStation_Admin_Rates { // Store the nonce so we can…Continue reading

Admin order – Discount per product

/** * Title: Add Percentage Discount to Order Line Items * Description: Adds percentage discount field to WooCommerce order line items in admin * Author: Claude AI * Version: 1.0 * * @package WPCode Snippets * @category Orders */ //…Continue reading

Fetch CLP Tool Data by Task ID

// Description: This code defines two functions to fetch tool data from the database based on a provided CLP Tool Task ID (clp_tool_task_id). It retrieves the tool_no and name_of_the_tool from the clp_test_table. Designed for integration with FlowMattic workflows to enable…Continue reading