Skip to content

Instantly share code, notes, and snippets.

@JudeRosario
Created November 9, 2015 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JudeRosario/21cfb9b43f6a784e61cf to your computer and use it in GitHub Desktop.
Save JudeRosario/21cfb9b43f6a784e61cf to your computer and use it in GitHub Desktop.
Swap out shortcodes
add_filter( 'the_content', 'swap_out_shortcodes', 20 );
function swap_out_shortcodes( $content ) {
$content = str_replace("[s2If !is_user_logged_in()]","[s2If !current_user_can(access_s2member_level1)]", $content );
$content = str_replace("[s2If is_user_logged_in()]","[s2If current_user_can(access_s2member_level1)]", $content );
return $content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment