Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

post edit submenu for wordpress 3.0 WordPress

  • SOLVED

Hello,

In WP 2.9.2, the code below translates to this sample link: http://domain.com/wp-admin/post.php?action=edit&post=1 *Notice the ending is .$post_ID.


if ($submenu_file == 'edit.php') {
$submenu_file = 'post.php?action=edit&post='.$post_ID;




For Pages in WP 3.0b, below code translates to this sample code: http://domain.com/wp-admin/post.php?action=edit&post=1 *Notice also ends similarly as it does for a post in WP 2.9.2


if ($submenu_file == 'edit.php?post_type=page') {
$submenu_file = 'post.php?action=edit&post='.$post_ID;
}




In WP 3.0b the post edit link is a little different:
http://domain.net/wp-admin/post.php?<strong>post=1&action=edit</strong> *Notice how the post ID is switched with action=edit.

I need to know how this:
$submenu_file = 'post.php?action=edit&post='.$post_ID;

can be rewritten to reflect that. I just don't know syntax enough to get it right.

Clarification: I need help with how I can show the correct syntax for the new post edit link (http://domain.com/wp-admin/post.php?post=28&action=edit) where .$post_ID is switch with 'action=edit'.

I've used:
if ($submenu_file == 'edit.php') {
$submenu_file = 'post.php?post='.$post_ID&amp;action=edit;
}


and this:
if ($submenu_file == 'edit.php') {
$submenu_file = 'post.php?post='.$post_ID'&action=edit';
}



With no luck.

Hope this makes sense.

Newbie,
Thanks.

P.S. This is my first post on WPQuestions so please let me know if the price is reasonable or if you need more clarification.

***After hours of trying different snippets which included one that works and after my question has been answered, I discovered that at one point the plugin got deactivated! Much fun being a newbie!***

Answers (1)

2010-04-15

Erez S answers:

if ($submenu_file == 'edit.php') {
$submenu_file = 'post.php?post='.$post_ID.'&action=edit';
}

Enjoy
BTW,it doesn't metter what is the order of the elements in the url


Creativira comments:

You're right erez213: It doesn't matter the order of the elements in the URL. Thank you.


Erez S comments:

Lolz :)
Next time double check everything is ok with what you know before asking others help


Creativira comments:

After more testing, the plugin caused an error and would not activate. Can I send you the file so you can take a look?


Creativira comments:

Nevermind. It seems beyond the scope of my original question. Will figure it out or post a new question.