function search_only_tag($query) { if (!is_admin() && $query->is_main_query() && $query->is_search) { $query->set(‘tag’, ‘green’); // Replace with tag name } return $query; } add_action(‘pre_get_posts’, ‘search_only_tag’);Continue reading
function search_only_category($query) { if (!is_admin() && $query->is_main_query() && $query->is_search) { $query->set(‘cat’, ‘3’); // Replace with category ID(s) } return $query; } add_filter(‘pre_get_posts’, ‘search_only_category’);Continue reading
add_filter( ‘post_search_columns’, function( $columns ) { return [ ‘post_title’ ]; } );Continue reading
function search_only_post($query) { if (!is_admin() && $query->is_main_query() && $query->is_search) { $query->set(‘post_type’, ‘post’); } return $query; } add_filter(‘pre_get_posts’, ‘search_only_post’);Continue reading
add_filter( ‘post_search_columns’, function( $columns ) { return [ ‘post_title’ ]; } );Continue reading
/** * Print Invoice & Delivery Notes: keep untouched template labels translatable * * WPCode: PHP Snippet, Insert Method “Auto Insert”, Location “Run Everywhere”. * * Templates::all() (includes/helpers/class-templates.php) merges the saved wcdn_template_settings * over defaults built with __() at request…Continue reading
/** * Gravity SMTP: BCC every outgoing email to the archive mailbox * * WPCode: PHP Snippet, Insert Method “Auto Insert”, Location “Run Everywhere”. * * Hooks gravitysmtp_after_connector_init, which only Gravity SMTP fires: once per send attempt, * from Connector_Base::init()…Continue reading
function rd_register_meta_woocommerce_11_save_bridge() { if ( ! defined( ‘WC_VERSION’ ) || ‘11.1.2’ !== WC_VERSION || ! function_exists( ‘facebook_for_woocommerce’ ) ) { return; } add_action( ‘woocommerce_admin_process_product_object’, ‘rd_schedule_meta_product_sync_on_wc_11’, 40 ); } add_action( ‘plugins_loaded’, ‘rd_register_meta_woocommerce_11_save_bridge’, 20 ); function rd_schedule_meta_product_sync_on_wc_11( $product ) { if (…Continue reading