WordPress.org

Support

Support » Plugins and Hacks » Creating two sections for Posts in admin area

Creating two sections for Posts in admin area

  • Hi everyone,

    I’m wondering if this is possible. Reason I am asking is because I have changed the original Posts section in Admin to “Products” and included custom meta boxes for our client. However, I’d like to be able to offer him the ability to add News articles (i.e. Blog articles) via Posts too – but without displaying the custom meta boxes from the Products section.

    Just in case anyone suggests Pages, the Pages section will be restricted from our client as that is reserved for something else.

    Does anyone know of any hacks that can be implemented to be able to achieve this?

    Thank you in advance
    Michael

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’ll be doing something similar but I haven’t got it worked out yet. In may case I created a second post-edit-like page but I intend to merge it with the main post panel. I’ll try to remember this thread when I do get around to that.

    I did actually do some playing about with the code and managed to create a top level admin menu which will redirect to the add-new.php page but appends a query string to set visibility of certain meta boxes and titles.

    For example I needed to be able to add News Articles. So I put in the following function in my functions.php file (in my theme folder):

    function add_news_menu(){
    	add_menu_page( 'Articles', 'Articles', 'administrator', 'news', 'newsbox');
    }

    and the function “newsbox” that is run when the menu is clicked:

    function newsbox(){
    	$str="<script type=\"text/javascript\">document.location.href='post-new.php?features=no&title=article';</script>";
    	echo $str;
    }

    This simply redirects to a new post page but with the query string which sets the title to “Add New Article” and turns off the Product Features panel.

    This is what I have done so far. I intend doing some database manipulation to force categories too, in order to filter the edit.php listing.

    Let me know your progress, too!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Creating two sections for Posts in admin area’ is closed to new replies.