Make Private Posts Visible to Subscribers
/* * Make Private Posts visible to Subscribers * Typically only visible to admin or editor */Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
/* * Make Private Posts visible to Subscribers * Typically only visible to admin or editor */Continue reading
add_action( ‘admin_footer’, function() { if ( $GLOBALS[‘current_screen’]->base !== ‘post’ ) { return; } ?>Continue reading
function exclude_pages_from_search($query) { if ($query->is_search) { $query->set(‘post_type’, ‘post’); // Exclude pages by changing ‘post’ to ‘page’ } return $query; } add_filter(‘pre_get_posts’,’exclude_pages_from_search’);Continue reading
add_action( ‘woocommerce_product_meta_end’, ‘wcv_add_brands_single_product’ ); function wcv_add_brands_single_product() { global $product; $taxonomy = ‘wcv_brands’; // The custom taxonomy as defined during our register_taxonomy code above. if( ! taxonomy_exists( $taxonomy ) ){ return; // exit } $term_ids = wp_get_post_terms( $product->get_id(), $taxonomy, array(‘fields’ =>…Continue reading
/** * Add the custom taxonomy to the WC Vendors Pro dashboard. * */ function wcv_add_brands_field( $object_id ){ WCVendors_Pro_Form_helper::select2( array( ‘post_id’ => $object_id, ‘id’ => ‘_wcv_custom_taxonomy_wcv_brands[]’, ‘class’ => ‘select2’, ‘custom_tax’ => true, ‘label’ => __( ‘Brand’, ‘wcvendors-pro’ ), ‘taxonomy’ =>…Continue reading
/** * Add the custom taxonomy to the WC Vendors Pro dashboard. * */ function wcv_add_brands_field( $object_id ){ WCVendors_Pro_Form_helper::select2( array( ‘post_id’ => $object_id, ‘id’ => ‘_wcv_custom_taxonomy_wcv_brands[]’, ‘class’ => ‘select2’, ‘custom_tax’ => true, ‘label’ => __( ‘Brand’, ‘wcvendors-pro’ ), ‘taxonomy’ =>…Continue reading
// Activate WordPress Maintenance Mode function wp_maintenance_mode() { if (!current_user_can(‘edit_themes’) || !is_user_logged_in()) { wp_die(‘ Under Maintenance Website under planned maintenance. Please check back later.’); } } add_action(‘get_header’, ‘wp_maintenance_mode’);Continue reading
add_filter( ‘option_use_smilies’, ‘__return_false’ );Continue reading
add_filter( ‘simpay_is_lite’, ‘__return_true’ );Continue reading
if ( ! defined( ‘AUTOSAVE_INTERVAL’ ) ) { // Change 5 to the number of minutes you want to use. define( ‘AUTOSAVE_INTERVAL’, 5 * MINUTE_IN_SECONDS ); }Continue reading