Description
Fiddle the author of the global postWe want the user of the bw_user shortcode to be used for all nested shortcodes This logic doesn't support nested changes of user.
Usage
oiku_fiddle_user_in_global_post( $user_id );Parameters
- $user_id
- ( mixed ) required –
Returns
voidSource
File name: oik-user/shortcodes/oik-user.phpLines:
1 to 14 of 14
function oiku_fiddle_user_in_global_post( $user_id ) { $post = bw_global_post(); if ( $post ) { if ( $user_id ) { $post->saved_author = $post->post_author; $post->post_author = $user_id; } else { if ( isset( $post->saved_author ) ) { $post->post_author = $post->saved_author; } unset( $post->saved_author ); } } }View on GitHub
