Title: Include custom post types into shortcodes
Last modified: August 30, 2016

---

# Include custom post types into shortcodes

 *  Resolved [Viktor Nagornyy](https://wordpress.org/support/users/viktorix/)
 * (@viktorix)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/include-custom-post-types-into-shortcodes/)
 * Hey, right now plugin only checks pages and posts, and if a custom post type 
   is protected, the shortcodes will not show it. For example, we have “courses”
   custom post type and protect them. But “purchased” shortcode is empty. Would 
   be great if you could automatically include custom post types too. Would be great
   if we had a simple list of custom post types with checkboxes on the settings 
   page, so we can select which to include.
 * **For anyone who wants a quick fix:**
 * Inside woocommerce-payperpost.php file, lines 165 – 176:
 *     ```
       //Grab a list of posts which have the WCPPP meta key filled in
       			$args = array(
       				'orderby'      => 'post_date',
       				'order'        => 'DESC',
       				'nopaging'     => true,
       				'meta_key'     => self::METAKEY,
       				'meta_value'   => '0',
       				'meta_compare' => '>',
       				'post_status'  => 'publish',
       				'post_type'    => array( 'post', 'page', 'course' )
   
       			);
       ```
   
 * Simply add your custom post type inside “post_type” array. You can see above 
   I’ve added “course” custom post type.
 * **WARNING:** This will be deleted if you upgrade plugin. So make sure to re-do
   it after each upgrade, until this feature is part of the plugin.
 * [https://wordpress.org/plugins/woocommerce-pay-per-post/](https://wordpress.org/plugins/woocommerce-pay-per-post/)

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

 *  Plugin Author [Matt Pramschufer](https://wordpress.org/support/users/mattpramschufer/)
 * (@mattpramschufer)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/include-custom-post-types-into-shortcodes/#post-6469088)
 * Viktor,
    Have you downloaded the lastest version that was released last Friday?
   This version includes custom post types automatically. It then gives you the 
   ability to exclude specific post types if you do not want the PPP meta box to
   show up.
 *  Thread Starter [Viktor Nagornyy](https://wordpress.org/support/users/viktorix/)
 * (@viktorix)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/include-custom-post-types-into-shortcodes/#post-6469093)
 * Hmm weird. That’s the version I upgraded to and “purchased” shortcode wasn’t 
   working because it lists custom post type “course” and upgrade wiped my change,
   so I thought I’ll post this suggestion.
 * Is that in settings page? I might try re-installing plugin.
 *  Plugin Author [Matt Pramschufer](https://wordpress.org/support/users/mattpramschufer/)
 * (@mattpramschufer)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/include-custom-post-types-into-shortcodes/#post-6469113)
 * Ahh, I know what you are talking about now. Let me see what I can do and push
   out a new version.
 *  Thread Starter [Viktor Nagornyy](https://wordpress.org/support/users/viktorix/)
 * (@viktorix)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/include-custom-post-types-into-shortcodes/#post-6469116)
 * Thanks.
 *  Plugin Author [Matt Pramschufer](https://wordpress.org/support/users/mattpramschufer/)
 * (@mattpramschufer)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/include-custom-post-types-into-shortcodes/#post-6469125)
 * New version pushed!
 * = 1.4.3 =
    * Updated the PURCHASED Shortcode to work with all custom post types
   by default. Uses same Exclude post type functionality from settings screen. *
   Fixed PHP Warning message due to type

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

The topic ‘Include custom post types into shortcodes’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pay-per-post/assets/icon-256x256.png?rev=2252656)
 * [Pay For Post with WooCommerce](https://wordpress.org/plugins/woocommerce-pay-per-post/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pay-per-post/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pay-per-post/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pay-per-post/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pay-per-post/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pay-per-post/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Matt Pramschufer](https://wordpress.org/support/users/mattpramschufer/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/include-custom-post-types-into-shortcodes/#post-6469125)
 * Status: resolved