Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter craziestdavid

    (@craziestdavid)

    Hello, yes, I turned it on. I run wordpress by the virtual machine image of Bitnami on Google Cloud Engine. But its debug somehow got some problem, I couldn’t get information from debug.log in wp-content folder.

    Thread Starter craziestdavid

    (@craziestdavid)

    Codes here ~

    
    // Register new status
    function register_rented_order_status() {
        register_post_status( 'wc-rented', array(
            'label'                     => 'Rented',
            'public'                    => true,
            'exclude_from_search'       => false,
            'show_in_admin_all_list'    => true,
            'show_in_admin_status_list' => true,
            'label_count'               => _n_noop( 'Rented <span class="count">(%s)</span> ', 'Rented <span class="count">(%s)</span> ' )
        ) );
    }
    add_action( 'init', 'register_rented_order_status' );
    
    // Add to list of WC Order statuses
    function add_rented_to_order_statuses( $order_statuses ) {
     
        $new_order_statuses = array();
     
        // add new order status after processing
        foreach ( $order_statuses as $key => $status ) {
     
            $new_order_statuses[ $key ] = $status;
     
            if ( 'wc-on-hold' === $key ) {
                $new_order_statuses['wc-rented'] = 'Rented';
            }
        }
     
        return $new_order_statuses;
    }
    add_filter( 'wc_order_statuses', 'add_rented_to_order_statuses' );
    
Viewing 2 replies - 1 through 2 (of 2 total)