• Resolved zahhar

    (@zahhar)


    Hi all,

    This is amazing plugin, that can be easily extended to support custom post types like Events, Projects, etc.

    Do the following:
    1. Open plugin folder and find file edit-next-previous-post-admin.php;
    2. Find function amm_edit_next_prev_post_button() in this file;
    3. Find line $supported_types = array(‘page’, ‘post’); in this function;
    4. Now replace line
    $supported_types = array('page', 'post');

    with line
    $supported_types = array('page', 'post') + get_post_types(array('public' => true, '_builtin' => false), 'names', 'and');

    This will add Previus/Next buttons to all custom post types you have registered in your WP instance.

    Code explained: get_post_types() in built-in WP function to retrieve all registered post types. With first argument we filter out only public post types that are NOT system types (this is because we already have listed ‘page’ and ‘post’ type earlier, and we do not want other types like menues or revisions). This function returns array, so we add it to array defined by author.

    Enjoy!

    Thank you Aftab Muni for this great plugin!
    Please extend it with my code to cover also custom post types in next version.

    • This topic was modified 4 years, 6 months ago by zahhar.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Aftab Ali Muni

    (@aftabmuni)

    Hello @zahhar
    Thank you for your code. I will try to add this in the next release.

    Regards,
    Aftab.

    Greetings @zahhar
    Since it looks that author either unwilling or has no time to implement most of the requested features, I’m now doing some sort of rewriting this plugin (as of now some new features already implemented – additional post statuses, tooltip with the next/previous post title over the buttons) and want to thank you for this excellent piece of code.

    Greetings @ivan-shatsky ,
    I would like to add the above (add to custom post types) code in the official plugin source, but as you said you’re working on it yourself, I do not want to create merge issues, so how may I contribute ?
    The SVN repository for the plugin shows no progress of any kind if I am to believe the WP trac .
    Thanks !

    • This reply was modified 3 years, 10 months ago by Palijn.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘This is how to extend it to support custom post types (Events, etc.)’ is closed to new replies.