Implement post status update as frontend news announcement

Hope this can help: function wpse_display_post_counts_by_categories() { $categories = get_categories(); $container = []; foreach ($categories as $category) { $args = [ ‘post_type’ => ‘post’, // Change to your post type. ‘post_status’ => ‘publish’, ‘category’ => $category->term_id, ‘orderby’ => ‘post_date’, ‘order’ => ‘DESC’, ‘posts_per_page’ => -1 ]; $posts = get_posts($args); if ( count($posts) ) { // … Read more

Modify loop to include all post statuses not just ‘published’

Okay, I think to start you need to change line 470 of the file includes/admin/class-learndash-admin-binary-selector.php from: ‘post_status’ => array(‘publish’), to ‘post_status’ => array(‘any’), If this doesn’t work on its own, there may be other places you need to change this as well – do a global file search on ‘post_status’ and look for places where … Read more

change page status with code

I figured out how to change the post status and information through code. <?php $my_post = array(‘ID’ => 77, ‘post_title’ => ‘on’,’post_content’ => ‘on’,’post_status’ => ‘draft’,); wp_update_post( $my_post );?> Now I just need to figure out how to make it run when a button is clicked.

Send default WooCommerce email when switching from custom order status

Looks like I was overcomplicating things. This is the solution: add_filter( ‘woocommerce_email_classes’, ‘custom_woocommerce_email_classes’, 10, 1 ); function custom_woocommerce_email_classes( $email_classes ) { $email_classes[ ‘WC_Email_Customer_On_Review_Request’ ] = include_once ‘includes/classes/class-wc-email-customer-on-review-request.php’; // Register custom trigger to send on-hold email when status is switched from on-review to on-hold. add_action( ‘woocommerce_order_status_on-review_to_on-hold_notification’, [ $email_classes[ ‘WC_Email_Customer_On_Hold_Order’ ], ‘trigger’ ], 10, 2 ); return … Read more

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