Skip to content

Instantly share code, notes, and snippets.

@szbl
Created March 23, 2013 07:05
Show Gist options
  • Save szbl/5226757 to your computer and use it in GitHub Desktop.
Save szbl/5226757 to your computer and use it in GitHub Desktop.
Plugin to modify Content Tags to only apply to posts/pages. Also hides it's admin column. Shows extendibility within a plugin for my WordCamp San Diego 2013 presentation.
<?php
/*
This code could be placed in a plugin or your theme's functions.php file.
*/
add_filter( 'szbl_content_tags-settings-post_types', 'szbl_content_tags_post_types', 10 );
function szbl_content_tags_post_types( $post_types )
{
// only allow posts/pages to receive Content Tags.
return array( 'post', 'page' );
}
add_filter( 'szbl_content_tags-settings', 'szbl_content_tags_hide_admin_col', 10 );
function szbl_content_tags_hide_admin_col( $args )
{
// hide the admin column
$args['show_admin_column'] = false;
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment