edit.php all post not working

finally found the solution when i enter all the custom post status to public it declare the post_type to default post as global so applied filter to change the global post_type based what type request get in URL function publishPress_allPost_pre_get_posts( &$wp_query ) { if ( is_admin() && array_key_exists( ‘post_type’, $_GET ) ) { $wp_query->set( ‘post_type’, … Read more

Woocommerce – Remove cart button depending product (post) status

Finally find my solution after a few day. In case someone try to do the same function test_expired_product(){ $id = get_the_ID(); $post_status = get_post_status($id); $terms= array(‘cursus-annuel’); if ($post_status === ‘expired’ || $post_status === ‘canceled’) { //echo $id; // working //echo $post_status; // working add_filter(‘woocommerce_is_purchasable’, ‘__return_false’); add_action( ‘woocommerce_single_product_summary’, ‘expired_product_message’, 20 ); return; } if( has_term( $terms, … Read more

Custom product status get filtered on all product list views

I think Below code will slove your problem.I have tested it. /** * Add ‘Unread’ post status. */ function wpdocs_custom_post_status(){ register_post_status( ‘unread’, array( ‘label’ => _x( ‘Unread’, ‘post’ ), ‘label_count’ => _n_noop( ‘Unread (%s)’, ‘Unread (%s)’), ‘public’ => true, ‘exclude_from_search’ => false, ‘show_in_admin_all_list’ => true, ‘show_in_admin_status_list’ => true )); } add_action( ‘init’, ‘wpdocs_custom_post_status’ ); function … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)