Support » Plugin: postMash - custom post order » [Plugin: postMash – custom post order] Request: Enable per post-type

  • A great feature addition this this plugin would be ‘enable per post-type’. So say if I’ve got a special ‘wiki’ post type for my wiki pages, which is the only type of page I care to change the default order of, I could enable postMash just for this type and leave the rest of my posts to the default settings.

    http://wordpress.org/extend/plugins/postmash/

Viewing 4 replies - 1 through 4 (of 4 total)
  • psperkins

    (@psperkins)

    Well I agree that would be a cool feature to add to future versions.

    However, (and I know it’s naughty to do this – call it “black hat” even) on line 60 of the plugin file “postMash.php” is a query where the post_type is defined plain as the nose on your face.

    $pageposts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'post' ORDER BY menu_order");

    It could be customized there.
    Then the trick would be to get postmash into the menu of your custom post type and not in your regular posts menu.

    hmmmmm…..

    psperkins

    (@psperkins)

    ok if you have decided to hack the plugin file, I figured out how to make it add the menu to the right place, from my experience with dealing with custom post types and adding custom features to them.

    1) like I said – change the post_type= part of LINE60 to your custom post type.

    2) postMash adds it’s menus at the end of the same file, in a function named “postMash_add_pages”. In this case I added postMash menu to my custom post type named “staff” :

    function postMash_add_pages(){
    	//add menu link
    	global $minlevel, $wp_version;
    	if($wp_version >= 2.7){
    		$page = add_submenu_page('edit.php?post_type=staff', 'postMash: Order Posts', 'Arrange', $minlevel,  __FILE__, 'postMash_main');
    	}else{
    		$page = add_management_page('postMash: Order Posts', 'postMash', $minlevel, __FILE__, 'postMash_main');
    	}
    	add_action("admin_print_scripts-$page", 'postMash_head'); //add css styles and JS code to head
    }

    I’ve modified this a bit further, this hack creates a “Reorder Posts” page in the cp for each custom post type (in addition to regular posts). I’ve commented where I modified the code; search for ‘BMS’

    [please use a Pastebin to post large chunks of code, following forum etiquette]

    I’d like to see what you came up with Big Mike Studios. Looks like it got chopped here.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: postMash – custom post order] Request: Enable per post-type’ is closed to new replies.