Skip to content

Instantly share code, notes, and snippets.

@gschoppe
Last active January 7, 2017 15:19
Show Gist options
  • Save gschoppe/88c7b4e918c94080b0d3dd8b246ba6fa to your computer and use it in GitHub Desktop.
Save gschoppe/88c7b4e918c94080b0d3dd8b246ba6fa to your computer and use it in GitHub Desktop.
Add Blockade to new post types or WP editors
<?php /* place in functions.php or in a custom plugin */
// Add Blockade to the custom post types "foo" and "bar"
add_filter('wp-blockade-override-post-types', 'add_my_blockade_post_types');
function add_my_blockade_post_types( $post_types ) {
$post_types[] = "foo";
$post_types[] = "bar";
return $post_types;
}
// Add Blockade to the custom editor with the ID "baz"
add_filter('wp-blockade-override-editors', 'add_my_blockade_editors');
function add_my_blockade_editors( $editors ) {
$editors[] = "baz";
return $editors;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment