• Just want to move “add_filter, add_action” codes from function.php to this plugin. And the code is simple, works in function.php, but just doesn’t work in this plugin, try to figure things out, but it’s really hard to. At this point of view, I would suggest you to improve the user experience of this plugin better, especially the debug part.

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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' );
    
    Plugin Author Shea Bunge

    (@bungeshea)

    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.

    Plugin Author Shea Bunge

    (@bungeshea)

    It sounds like you might be having problems getting debugging working on your server, then. This isn’t really something we can affect with the plugin; the server itself needs to be configured correctly.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Just doesn’t work’ is closed to new replies.