/var/www/html_uk/wp-content/plugins/automatewoo/includes/DatabaseUpdates/2.6.1.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
// phpcs:ignoreFile
/**
 * Update to 2.6.1
 *
 * migrate all 'disabled like' post statuses to the new 'disabled' status
 */

if ( ! defined'ABSPATH' ) ) exit;


$workflows_query = new AutomateWoo\Workflow_Query();
$workflows_query->args['post_status'] = [ 'draft''pending''private' ];

$workflows $workflows_query->get_results();

if ( 
$workflows ) foreach ( $workflows as $workflow ) {
    
/** @var $workflow AutomateWoo\Workflow */
    
wp_update_post([
        
'ID' => $workflow->get_id(),
        
'post_status' => 'aw-disabled'
    
]);
}