• Resolved keith1025

    (@keith1025)


    Hi, I have added a custom product status recently and down here is the code. I would like to know how could I show this status in vendors’ products manage page (my-website/store-manager/products) Thanks!

    register_post_status( ‘custom-hide-product’, array(
    ‘label’ => _x( ‘Approved’, ‘post’ ),
    ‘public’ => false,
    ‘exclude_from_search’ => true,
    ‘show_in_admin_all_list’ => true,
    ‘show_in_admin_status_list’ => true,
    ‘label_count’ => _n_noop( ‘Approved <span class=”count”>(%s)</span>’, ‘Approved <span class=”count”>(%s)</span>’ ),
    ) );
    add_action( ‘admin_footer’, ‘display_hide_status_option’ );

    function display_hide_status_option() {
    global $post;
    $complete = ”;
    $label = ”;
    if ( $post->post_type === ‘product’ ) {
    if ( $post->post_status === ‘custom-hide-product’ ) {
    $selected = ‘selected’;
    }
    echo ‘<script>
    jQuery(document).ready(function($){
    $(“select#post_status”).append(“<option value=\”custom-hide-product\” ‘ . $complete . ‘>Approved </option>”);
    $(“.misc-pub-section label”).append(“‘ . $label . ‘”);
    });
    </script>
    ‘;
    }
    }

Viewing 1 replies (of 1 total)
  • Plugin Author WC Lovers

    (@wclovers)

    Add this snippet to your site –

    add_filter( 'wcfmu_products_menus', function( $wcfmu_products_menus ) {
    	$wcfmu_products_menus['custom-hide-product'] = __( 'Approved', 'wc-frontend-manager');
    	return $wcfmu_products_menus;
    }, 50);
Viewing 1 replies (of 1 total)
  • The topic ‘Show custom product status’ is closed to new replies.