Title: Adding the plugin to a custom post
Last modified: August 21, 2016

---

# Adding the plugin to a custom post

 *  Resolved [bseddon](https://wordpress.org/support/users/bseddon/)
 * (@bseddon)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/adding-the-plugin-to-a-custom-post/)
 * The plugin only supports ‘post’ and ‘page’ post types. The plugin can be added
   to another post type by adding code like that below to you theme’s functions.
   php file.
 *     ```
       add_action('add_meta_boxes', 'lsl_add_custom_box_dd_ratings');
       function lsl_add_custom_box_dd_ratings()
       {
       	// Check the plugin is activated
       	if (!function_exists('dd_rating_custom_box')) return;
   
       	$custom_post_slug = 'download';
   
       	add_meta_box(
       		'ratings',
       		__('Ratings', 'ratings'),
       		'dd_rating_custom_box',
       		$custom_post_slug,
       		'advanced',
       		'high'
       	);
       }
       ```
   
 * The value assigned to the variable **$custom_post_slug** is the slug of the custom
   post. If the custom post type is created by the vendor of another plugin the 
   slug will be the name immediately following the blog site address in the browser
   address bar. In the example the slug is ‘download’ which is the name of custom
   posts of Easy Digital Downloads.
 * The function does not need to be ‘lsl_add_custom_box_dd_ratings’. It can be any
   unique name you choose. However any alternative name you choose must also appear
   in the second parameter passed to the ‘add_action()’ function.
 * [http://wordpress.org/plugins/dd-rating/](http://wordpress.org/plugins/dd-rating/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Mosterd3d](https://wordpress.org/support/users/mosterd3d/)
 * (@mosterd3d)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/adding-the-plugin-to-a-custom-post/#post-4501447)
 * Yeah and? that’s how you add a metabox! What do you want to say with this post?
 *  Thread Starter [bseddon](https://wordpress.org/support/users/bseddon/)
 * (@bseddon)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/adding-the-plugin-to-a-custom-post/#post-4501452)
 * I’m sorry if I missed your documentation showing how to add your plugin to other
   post types.
 * Because I could not find the documentation I thought it would be useful to others
   to know how your plugin can be used to add ratings to their own custom posts 
   or the custom posts of other plugins. Of course, maybe I’m the only person who
   uses custom post types.
 * If I was an idiot and missed the documentation, please post a link here.
 * Have you looked at how the Mage Rating plugin allows a user to select the post
   types it will support? It uses a plugin settings page to present the registered
   post types and allows the administrator to select one or more post types.
 *  Plugin Author [Mosterd3d](https://wordpress.org/support/users/mosterd3d/)
 * (@mosterd3d)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/adding-the-plugin-to-a-custom-post/#post-4501453)
 * It’s indeed very useful to others to know and tnx for adding this post. Off course
   I’ve thinking about something like a setting page, but for now I want to keep
   this plugin as easy as it is. There are more things I want to change and I want
   to add more modules to the plugin in the future.
 * For now I close this thread and again tnx for your input!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Adding the plugin to a custom post’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/dd-rating_dcdddf.svg)
 * [DD Rating](https://wordpress.org/plugins/dd-rating/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/dd-rating/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/dd-rating/)
 * [Active Topics](https://wordpress.org/support/plugin/dd-rating/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/dd-rating/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/dd-rating/reviews/)

## Tags

 * [custom post](https://wordpress.org/support/topic-tag/custom-post/)

 * 3 replies
 * 2 participants
 * Last reply from: [Mosterd3d](https://wordpress.org/support/users/mosterd3d/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/adding-the-plugin-to-a-custom-post/#post-4501453)
 * Status: resolved