[Plugin: Meta SEO Pack] Add meta box to custom post types
-
If some body uses custom post types and wants to get Meta SEO Pack to work with those types I have made small hack. This hack adds meta box for all post types that have capability_type value set to ‘post’ or ‘page’ including built in and all custom post types that have user created.
Meta SEO pack version: 2.2.1 (Last Updated: 2010-3-17)
- Open file “meta-seo-pack/meta-seo-pack.php” (you can also use plugin editor inside WordPress).
- Goto line 211 or near that, and find lines:
add_meta_box( 'msp_sectionid', 'Meta SEO Pack', array( &$this, 'post_metabox' ), 'post', 'normal', 'high' ); add_meta_box( 'msp_sectionid', 'Meta SEO Pack', array( &$this, 'post_metabox' ), 'page', 'normal', 'high' );
- Comment those lines using // or delete them
- After these lines insert new code:
// This will also support all custom post types not only built in $capability_types=array('page','post'); foreach ($capability_types as $capability_type ) { $post_types=get_post_types(array('capability_type'=>$capability_type),'names'); foreach ($post_types as $post_type ) { add_meta_box( 'msp_sectionid', 'Meta SEO Pack', array( &$this, 'post_metabox' ), $post_type, 'normal', 'high' ); } }
This code works for me, hope somebody will find this useful to.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘[Plugin: Meta SEO Pack] Add meta box to custom post types’ is closed to new replies.