[wp-hackers] Three Plugin development questions

Andrew Nacin wp at andrewnacin.com
Fri Jul 9 13:58:29 UTC 2010


On Fri, Jul 9, 2010 at 9:47 AM, Sukhwinder Singh <ssruprai at hotmail.com>wrote:
>
> I had posted this at wordpress.org forum but haven't received any reply
> since yesterday so I subscribed to this mailing list to try to get any help.
>

This is not a support mailing list, but I will lead you on your way with
some general advice that can apply to numerous situations:

You are using user levels, i.e. 8. Please use capabilities, i.e. edit_posts
or manage_options: http://codex.wordpress.org/Roles_and_Capabilities. User
levels have been deprecated since the year 2005. Don't use them.

Turn on WP_DEBUG during development: define('WP_DEBUG', true); in
wp-config.php.

In your call to add_submenu_page(), one of the 'Add Firm' strings is the
page title.

With regards to headers already being sent, you are hooking in too late to
perform a redirection -- it must come before any HTTP headers are sent. You
should consider using a custom post type or the settings API in general
since most of the work has been done for you, but if you want to build your
own pages, please look through the Codex, the various tutorials that are out
there, and the hooks in the code (admin.php, admin-header.php, etc.).


More information about the wp-hackers mailing list