Description
Determine post_status for new postThe post status depends on the the authority of the submitting user
| current_user_can | status |
|---|---|
| publish_pages | publish |
| – | pending |
Usage
bw_determine_post_status( $post_type, $validated );Parameters
- $post_type
- ( mixed ) required –
- $validated
- ( mixed ) required –
Returns
voidSource
File name: oik-fields/shortcodes/oik-new.phpLines:
1 to 8 of 8
function bw_determine_post_status( $post_type, &$validated ) { $post_status = 'pending'; if ( current_user_can( 'publish_pages' ) ) { $post_status = "publish"; } $validated['post_status'] = $post_status; return( $post_status ); }View on GitHub
