add_action( ‘woocommerce_checkout_process’, function() { $coupon_code = ‘your_coupon_code’; $billing_phone = wc_clean( wp_unslash( $_POST[‘billing_phone’] ?? ” ) ); $billing_addr1 = strtolower( wc_clean( wp_unslash( $_POST[‘billing_address_1’] ?? ” ) ) ); if ( ! WC()->cart ) { return; } $applied = array_map( ‘wc_format_coupon_code’, WC()->cart->get_applied_coupons()…Continue reading
add_filter(‘vc_media_grid_build_query’, ‘auto_sort_all_vc_media_grids’, 999, 2); function auto_sort_all_vc_media_grids_v2($query_args, $grid_data) { // Работи само за Images режим с include if (!empty($query_args[‘include’]) && $query_args[‘post_type’] == ‘attachment’) { $ids = explode(‘,’, $query_args[‘include’]); // Взимаме ID-тата и ги сортираме по Title $sorted_ids = get_posts(array( ‘post__in’ =>…Continue reading
$guard = function( $add_products ) { if ( ! is_array( $add_products ) ) { return $add_products; } return array_values( array_filter( $add_products, function( $item ) { return ! empty( $item[‘product_id’] ) && wc_get_product( $item[‘product_id’] ) !== false; } ) ); };…Continue reading
// Remove wrap from images in ACF editor function gc_remove_p_tags_around_images($content) { $contentWithFixedPTags = preg_replace_callback(‘/ ((?:.(?!p>))*?)(]*>)?\s*(]+>)()?(.*?)/is’, function($matches) { // image and (optional) link: $image = $matches[2] . $matches[3] . $matches[4]; // content before and after image. wrap in unless it’s empty…Continue reading
// 1. FORCE THE THEME TO LOAD THE MODAL MARKUP ON EVERY PAGE add_action(‘wp_footer’, ‘force_madara_auth_modals_globally’, 1); function force_madara_auth_modals_globally() { // If the modal isn’t already printed by the theme, manually echo Madara’s native template blocks if ( !wp_script_is(‘bootstrap’, ‘enqueued’) &&…Continue reading
/* * Snippet #110: Religions of the World – Interactive Charts * Replaces PowerBI iframes (snippets #59 / #72) with Chart.js charts * sourced directly from the religions MySQL table. * * Shortcode: [pg_religion_charts] * Place on /religions-of-the-world/ page above…Continue reading
add_shortcode(‘cta_banner_desktop’, function() { ob_start(); ?> Only – apply before 31 July to avoid a £100 late application fee APPLY NOWContinue reading
add_shortcode(‘cta_banner_mobile’, function() { ob_start(); ?> Only – apply before 31 July to avoid a £100 late application feeContinue reading
add_filter( ‘the_password_form’, ‘custom_password_form_text’, 20 ); function custom_password_form_text( $output ) { // Replace the default WordPress text with your custom message $old_text = ‘This content is password protected. To view it please enter your password below:’; $new_text = ‘This content is…Continue reading
add_filter( ‘lpfw_filter_get_settings_sections’, function( $response ) { $data = $response->get_data(); // Build options dynamically from all registered WooCommerce order statuses $status_options = array(); foreach ( wc_get_order_statuses() as $slug => $label ) { $status_options[] = array( ‘key’ => str_replace( ‘wc-‘, ”, $slug…Continue reading