WordPress.org

Ready to get started?Download WordPress

Forums

CMS Page Order
[resolved] Feature suggestion (9 posts)

  1. Ricardo
    Member
    Posted 2 years ago #

    Would you consider adding filters? I.E. for showing pages/custom post types under a certain category.

    It doesn't have to be a menu option, a hook would work as well.

    Thanks for sharing your development :)

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

  2. bergius
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Ricardo,

    I'm not sure I follow on what you mean. By default, pages doesn't have categories, but custom post types can have categories of course. Are you requesting the ability to also reorder custom post types (with a filter hook to filter by category etc.)? Cause that's something I've been thinking of and may add in the future (don't know exactly when though). Just want to make sure I understand you.

  3. nicomollet
    Member
    Posted 2 years ago #

    I think Ricardo means, for each custom post type, to be shown in the page tree.

    For example

    Page 1
    - Page 2
    - Page 3
    Page 4
    - Page 5
    - Page 6
    Custom type type
    - Custom post type, post 1
    - Custom post type, post 2
    - Custom post type, post 3

    This way, you can see every content (pages, posts, custom post types) in single WP admin page (ie : CMS page order).

    And you could order custom post types, if they actually are "hierarchical". "Non hierarchical" custom post types couldn't be reorder, instead be sorted by date for example.

  4. Ricardo
    Member
    Posted 2 years ago #

    Sorry for the delay, had a very busy week.

    @bergius: that's exactly what I meant. If you add CPT support to this plugin, it would be really nice to allow users to filter the results by custom taxonomies before they start ordering.

    In example, let's suppose that:
    - we have a CPT called "Shows"
    - we have a custom taxonomy which splits them in "Current" and "Archive"
    - we want the shows in the Archive page to be ordered alphabetically
    - we want the shows in the Current page to be ordered manually

    It would be much easier to order current shows if I apply first a filter by taxonomy in order to hide all shows which aren't current.

    @nicomollet: actually, I don't think mixing all content types in a single page would be a good idea, it seems to me that it would be more confusing. Every CPT should have its own "Ordering" link in its own menu.

  5. bergius
    Member
    Plugin Author

    Posted 2 years ago #

    Yes, the order page should be a subpage to each CPT. I believe that's the most straightforward way, as well. I'll put this on my todo, Ricardo. Thanks for the suggestion.

  6. Ricardo
    Member
    Posted 2 years ago #

    No problem. Let me know if you want me to translate it to Spanish when you're done.

  7. Bill Erickson
    Member
    Plugin Author

    Posted 2 years ago #

    bergius, I love the plugin but need custom post type support. Here's a patch that adds it: https://gist.github.com/1222768

    Changes are very simple. At the top where you add the subpage, I created a filterable array with all post types to order (default is just page). It then loops through these, creating a subpage for each.

    Then everywhere else you had hardcoded ?post_type=page, I used an escaped $_GET['post_type'].

    This seems to be working for me but I haven't done extensive testing. Some things to explore before committing:
    - Is the GET variable the best way to get the current admin page's post type? I havent built any plugins that deal with the admin side so I don't know best practices. I just saw the post type in the URL string so went for it.
    - I don't know what the WPML language switcher is so haven't tested how this affects it. I'm assuming the GET variable is available when this is used because it looks like this function is called on the order admin page

    Let me know if there's anything else I can do to help. I'm looking forward to using this plugin often in client projects.

  8. Bill Erickson
    Member
    Plugin Author

    Posted 2 years ago #

    Oh and here's how to modify the array from a theme or plugin:

    add_filter( 'cmspo_post_types', 'be_order_post_types' );
    function be_order_post_types( $post_types ) {
    	$post_types = array( 'page', 'rotator' );
    	return $post_types;
    }
  9. Bill Erickson
    Member
    Plugin Author

    Posted 2 years ago #

    In case anyone is curious, these changes have been added to the plugin.

    Here's how to modify the post types it applies to (by default it only shows up on Pages): http://www.billerickson.net/code/change-post-types-cms-page-order/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic