Created
August 18, 2018 14:18
-
-
Save priyabratary/dc22cd68920098fcf60c4d1e747ed0e5 to your computer and use it in GitHub Desktop.
future post show now
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// future post | |
function setup_future_hook() { | |
// Replace native future_post function with replacement | |
remove_action('future_post', '_future_post_hook'); | |
add_filter( 'wp_insert_post_data', 'nacin_do_not_set_posts_to_future' );} | |
function nacin_do_not_set_posts_to_future( $data ) { | |
if ( $data['post_status'] == 'future' && $data['post_type'] == 'gallery' ) | |
$data['post_status'] = 'publish'; | |
return $data; | |
} | |
add_action('init', 'setup_future_hook'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment