Twitter
Tutorial: Flutter
10. July 2009 · Author: Dale Crum
12 Comments

Tutorial: Condensing the Flutter menu

One of the few flaws we’ve found with Freshout’s WordPress plugin entitled Flutter is the manner in which it displays Custom Write Panels. Flutter lists the Write Panels in the WordPress navigation under no distinct heading. WordPress breaks the navigation down in an orderly fashion for us: Dashboard, Posts, Media, Links, etc. only to be interrupted by what typically turns into five to eight Custom Write Panels making a mess of the usability. The problem becomes truly evident when combining it with Ozh’s Drop Down Menu plugin where the added horizontal menu can quickly be overwhelmed by multiple Custom Write Panels pushing the Ozh menu down into two lines.

What we propose is more effective method of organization. By removing the Custom Write Panels from the main navigation and placing them under their respective headers of Posts and Pages, we not only save space but give the Custom Wrte Panels a more logical, user-friendly placement. In order to accomplish this we need to make an alteration to the RCCWP_Menu.php file.

Remove the following from RCCWP_Menu.php lines 432 to 456 ( Flutter version 1.1 )

if ($panel->type == "post"){
 if($panel->single == 1){  //if the post is single
 if($add_post){ //if the post is single and don't have any related post
 add_submenu_page($base+$offset.'.php', __($panel->name), $new_indicator_text, $requiredPostsCap, 'post-new.php?custom-write-panel-id=' . $panel->id);
 }else{ //if have one related post we just can  edit the post
 add_submenu_page($base+$offset.'.php',__($panel->name),"Edit", $requiredPostsCap,'post.php?action=edit&post='.$has_posts);
 }   
 }else{
 add_submenu_page($base+$offset.'.php', __($panel->name), $new_indicator_text, $requiredPostsCap, 'post-new.php?custom-write-panel-id=' . $panel->id);
 add_submenu_page($base+$offset.'.php', __($panel->name), $edit_indicator_text, $requiredPostsCap, 'edit.php?filter-posts=1&custom-write-panel-id=' . $panel->id);
 }
 }else{
 if($panel->single == 1){ //if the page is single
 if($add_post){ //if the page is single and don't have any related post
 add_submenu_page($base+$offset.'.php', __($panel->name), $new_indicator_text, $requiredPagesCap, 'page-new.php?custom-write-panel-id=' . $panel->id);
 }else{
 add_submenu_page($base+$offset.'.php',__($panel->name),"Edit", $requiredPagesCap,'page.php?action=edit&post='.$has_posts);
 }
 }else{
 add_submenu_page($base+$offset.'.php', __($panel->name), $new_indicator_text, $requiredPagesCap, 'page-new.php?custom-write-panel-id=' . $panel->id);
 add_submenu_page($base+$offset.'.php', __($panel->name), $edit_indicator_text, $requiredPagesCap, 'edit-pages.php?filter-posts=1&custom-write-panel-id=' . $panel->id);
 }
 }
 }

And replace it with the following:

if ($panel->type == "post"){
 if($panel->single == 1){  //if the post is single
 if($add_post){ //if the post is single and don't have any related post
 add_submenu_page('post-new.php', __($panel->name), __($panel->name), $requiredPostsCap, 'post-new.php?custom-write-panel-id=' . $panel->id);
 }   
 }else{
 add_submenu_page('post-new.php', __($panel->name), __($panel->name), $requiredPostsCap, 'post-new.php?custom-write-panel-id=' . $panel->id);
 }
 }else {
 if($panel->single == 1){ //if the page is single
 if($add_post){ //if the page is single and don't have any related post
 add_submenu_page('page-new.php', __($panel->name), __($panel->name), $requiredPagesCap, 'page-new.php?custom-write-panel-id=' . $panel->id);
 }
 }else{
 add_submenu_page('page-new.php', __($panel->name), __($panel->name), $requiredPagesCap, 'page-new.php?custom-write-panel-id=' . $panel->id);
 }
 }
 }

The replaced code above is actually a drawback to an older version of Flutter with a few adjustments. Notice that we have instructed the new post menus to be added within the submenu page of post-new.php and similarly the page menus to be added within the page-new.php. This effectively moves them under the corresponding navigation menu. The function is repeated because in the original Flutter menu, the Custom Write Panels would duplicate in two different locations, which seemed unnecessary though we are leaving you with the ability to replace them.

12 Comments

  1. MACC,

    Sadly Flutter support hasn’t been around for some time now and Magic Fields essentially picks up where it left off. They have a simple migration tool to ease the crossover and then from the setting menu you can quickly disable the Post or Page menu without modification of the core code. This is our recommendation as we no longer use this plugin.

  2. Hello,

    Is there some way to disable the “Post” tab on the menu completely? I don’t want my users to post through there, only by using the custom Flutter write tab but if I disable “Post” the custom Flutter tab disappears along with it.

    Please help me out, thnx!

  3. Rajan,

    Because Flutter not longer appears to be supported it is strongly recommended that you switch to Magic Fields which has this feature built in. Making the switch from Flutter to Magic Fields is explained on their homepage.

  4. rajan says:

    I have done the above changes .. when i click on car(left side link).. it hsow..

    Error 404 – Not Found

    How can i resolve this..

  5. David,

    Thanks for adding this feature! I’ve been looking for something like this built in to a plug-in for awhile. I’m definitely going to be switching to Magic Fields. Congrats Doc4!

  6. David,

    This is fantastic news, I have been trying for years to get the Flutter team on board with this to no avail. Thank you.

  7. Hey Doc4

    I just add this code in the Magic Fields plugin (http://bit.ly/TSK39) i just wanna say thanks for this :) (i will give credit to you in next release)

    David.

  8. David,

    I have sent a new RCCWP_Menu.php file your way, let us know if this doesn’t work. For those reading this: the issue appears to be the way the code was copied from the browser window. The copied code added ascii spaces (   ) which corrupted it. Please be sure to use the rollover “view source” when selecting the code.

  9. David says:

    When I tried replacing this code, wordpress just stopped loading completely in the browser. I double checked over and over again to make sure I was replacing the right lines of code.

    Not sure why this isn’t working. :( I hate having tons of extra buttons on the Admin Panel for each custom write panel I make.

    Any thoughts?

  10. Marko,

    I’ve sent a modified RCCWP_Menu.php file over. Please let us know if this works.

    Thank you

  11. Marko Jansen says:

    Very nice. I use a lot of Writepanels, so condensing them is useful :)

    However, when i modify the php file like you suggested, the write panels are shown in the Posts section, like they should. But, each write panel is still listed in the main menu as well, and they lead to an Object Not Found error. Do i need to modify something else as well?

  12. Thanks guys, good stuff!

Leave A Comment

Please wrap any code within the <code> tag to display properly

Multicons is a multi-favicon code generator which automatically inserts the necessary meta tags for both favicons (site-wide and/or admin) and Apple Touch icons. Not sure what a...

IE6 Upgrade Option utilizes the 25K script created by Free the Foxes: http://www.freethefoxes.com/ as a WordPress plugin. Originally this plugin utilized a smaller 7K script but it's...

The WordPress Plugin: WordPress Database Backup by Austin Matzko is one of the more intuitive backup plugins currently available and with no stern warnings to scare off the faint of...

While doing our usual run of site updates and code adjustments, we ran into a small issue: how to display WordPress bookmarks with both text and images. Utilizing the 'Links' tab (...

BookMaster is our answer to what we feel is an odd issue with the WordPress wp_list_bookmarks tag. For those that have exercised the use of wp_list_bookmarks, you are well aware that...