[wp-hackers] release 2.0.4: add_submenu_page() does not work?
AJ Chen
canovaj at gmail.com
Tue Aug 22 16:37:40 GMT 2006
Thanks. I changed it to post.php and the submenu showed up.
One more problem: when clicking the submenu [project], it simply redirects
to post.php with a special parameter. This works on my windows XP. But when
I deploy it to my web hosting server (Linux), clicking submenu [project]
gives error:
*
Warning*: Cannot modify header information - headers already sent by (output
started at /home/ajchen/public_html/openlab/wp-admin/admin-header.php:16) in
*/home/ajchen/public_html/openlab/wp-includes/pluggable-functions.php* on
line *272*
This error is not seen with submenu "Write Post". So, I think it has to do
with the wp_redirect() function used in my plugin and must be platform
dependent (works on windows but not Linux). Any idea what happens?
AJ
On 8/19/06, Ryan Boren <ryan at boren.nu> wrote:
>
> AJ Chen wrote:
> > In my new plugin - web2x, i found the same code to add submenu works
> with
> > the wordpress code checked out on 5/10/06, but does not work with
> wordpress
> > 2.0.4 release. See the code below. Running 2.0.4, the submenu
> "[project]"
> > does not appear under Write menu, although the option page is added
> under
> > Options. Has anybody seen problem with add_submenu_page() function?
> > What's
> > the fix?
> >
> > add_action('admin_menu', 'w2x_add_pages');
> > function w2x_add_pages() {
> > // Add submenu under Write:
> > add_submenu_page('post-new.php', 'Write Project Post', '[project]',
> 8,
> > 'prj', 'w2x_show_prj_post');
> >
> > // Add a new menu under Options:
> > add_options_page('Web2x Options', 'Web2x', 8, __FILE__,
> > 'w2x_options_page');
> > }
>
> post-new.php does not exist in 2.0.4. It is 2.1 only.
>
> Ryan
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list