WordPress.org

Ready to get started?Download WordPress

Forums

CMS Page Order
[resolved] Does not work on CPT? (4 posts)

  1. Agnes
    Member
    Posted 1 year ago #

    Looks great, but does not seem to work on my custom post type. Should it?

    http://wordpress.org/extend/plugins/cms-page-order/

  2. Bill Erickson
    Member
    Plugin Author

    Posted 1 year ago #

    By default it is limited to the 'page' post type, but you can use the 'cmspo_post_types' filter to change the post types it is applied to:

    http://www.billerickson.net/code/change-post-types-cms-page-order/

  3. Agnes
    Member
    Posted 1 year ago #

    Thanks!
    Then it would not work for both, yet I guess?

  4. Bill Erickson
    Member
    Plugin Author

    Posted 1 year ago #

    It can work on as many post types as you like. Here's how to add it to post, page, event, and rotator.

    /**
     * Update post types for CMS Page Order
     * @author Bill Erickson
     * @link http://www.billerickson.net/code/change-post-types-cms-page-order
     *
     * @param array $post_types
     * @param array $post_types modified
     */
    function be_sort_post_types( $post_types ) {
    	return array( 'post', 'page', 'rotator', 'event' );
    }
    add_filter( 'cmspo_post_types', 'be_sort_post_types' );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.