Created
December 31, 2011 09:56
-
-
Save ashfame/1543569 to your computer and use it in GitHub Desktop.
Function to remove wpautop filter for specific post IDs
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
/** | |
* Function to remove wpautop filter for specific post IDs | |
*/ | |
add_action( 'init', 'do_ma_thang' ); | |
function do_ma_thang() { | |
global $wp_query; | |
$exclusion = array( 1, 5, 7 ); // add post IDs here | |
if ( in_array( $wp_query->post->ID, $exclusion ) ) | |
remove_filter( 'the_content', 'wpautop' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment