Skip Workflow Filter

Description

The action filter allows to skip workflow based on post attributes.

Use this filter to add custom conditions to allow users to skip workflow based on certain post attributes.

Usage

add_filter( 'owf_skip_workflow', 'custom_skip_workflow', 10, 1 );

Parameters

  • $post_id – ID of the post.

Example

add_filter( 'owf_skip_workflow', 'custom_skip_workflow', 10, 1 );

// allow for direct publish and update if the post has "test" tag.
function custom_skip_workflow( $post_id ) {
    $tag_ids = wp_get_post_tags( $post_id, array( 'fields' => 'names' ) );

    if( in_array('test', $tag_ids)) {
        return true;
    }

    return false;
}

Source Code

The filter is located in class-ow-process-flow.php