Location: everywhere
Include Products with Post Status “Private” by default in Product exports
function custom_woo_ce_get_products_status( $status = array() ) { $status[] = ‘private’; return $status; } add_filter( ‘woo_ce_get_products_status’, ‘custom_woo_ce_get_products_status’ );Continue reading
Remove Query Strings From Static Files
function wpcode_snippet_remove_query_strings_split( $src ) { $output = preg_split( “/(&ver|\?ver)/”, $src ); return $output ? $output[0] : ”; } add_action( ‘init’, function () { if ( ! is_admin() ) { add_filter( ‘script_loader_src’, ‘wpcode_snippet_remove_query_strings_split’, 15 ); add_filter( ‘style_loader_src’, ‘wpcode_snippet_remove_query_strings_split’, 15 ); }…Continue reading
Sterling Instant Callback w/ Existing Customer Number
Add Categories Support to Pages
function add_taxonomies_to_pages() { // register_taxonomy_for_object_type( ‘post_tag’, ‘page’ ); register_taxonomy_for_object_type( ‘category’, ‘page’ ); } add_action( ‘init’, ‘add_taxonomies_to_pages’ );Continue reading
Enqueue Styles and Scripts
//* Enqueue scripts and styles add_action( ‘wp_enqueue_scripts’, ‘site_enqueue_scripts_styles’ ); function site_enqueue_scripts_styles() { wp_enqueue_script( ‘site-responsive-menu’, get_bloginfo( ‘stylesheet_directory’ ) . ‘/js/responsive-menu.js’, array( ‘jquery’ ), ‘1.0.0’ ); wp_enqueue_style( ‘dashicons’ ); wp_enqueue_style( ‘site-google-fonts’, ‘//fonts.googleapis.com/css?family=Ek+Mukta:200,800’, array(), CHILD_THEME_VERSION ); $site_url = get_bloginfo( ‘url’ ); if (…Continue reading
Enqueue Styles and Scripts
//* Enqueue scripts and styles add_action( ‘wp_enqueue_scripts’, ‘site_enqueue_scripts_styles’ ); function site_enqueue_scripts_styles() { wp_enqueue_script( ‘site-responsive-menu’, get_bloginfo( ‘stylesheet_directory’ ) . ‘/js/responsive-menu.js’, array( ‘jquery’ ), ‘1.0.0’ ); wp_enqueue_style( ‘dashicons’ ); wp_enqueue_style( ‘site-google-fonts’, ‘//fonts.googleapis.com/css?family=Ek+Mukta:200,800’, array(), CHILD_THEME_VERSION ); $site_url = get_bloginfo( ‘url’ ); if (…Continue reading
Completely Disable Comments
add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading
Send Values in WP Forms Webhook
/** * Send field values in Dropdown, checkboxes, and Multiple Choice through webhook. * * @link https://wpforms.com/developers/how-to-send-field-values-with-webhooks/ */ function wpf_dev_webhooks_process_delivery_request_options($options, $webhook_data, $fields, $form_data, $entry_id) { //Run on all form IDs if ( empty( $form_data[ ‘id’ ] )) { return $options;…Continue reading
Completely Disable Comments
// Disable comments on admin init add_action(‘admin_init’, function () { global $pagenow; // Redirect any user trying to access comments page if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable…Continue reading