help creating admin page for plugin (3 posts)

  1. stratego
    Posted 9 years ago #

    I am new to php and to writing WP plugins, but I have successfully written a plugin. It is a simple search and replace thing, but a good place to start. I am trying to create an admin page where the user can make selections that will effect what the plugin searches for and replaces with. Right now I am just trying to get a blank admin page added to WP. From reading and looking at other plugins I have come up with this:

    function plugin_add() {
    if (function_exists('add_options_page')) {
    add_options_page('plugin', 'plugin', 0, basename(__FILE__), 'plugin_subpanel');

    add_action('admin_menu', 'plugin_add');

    now what happens when I activate it, the page goes blank, if I acces wp-admin, the new menu is there, under options, and it will allow me to see the blank admin page. Well, that is the case in Firefox. In IE I can view the blog, but any attempt to login ar acces wp-admin just leads to blank screen. I have tried on both WP 2.1.3 and 2.0.4
    Any help much appreciated

  2. rudolf45
    Posted 9 years ago #

    Maybe take a look how this plugin handles it :)

  3. stratego
    Posted 9 years ago #

    thanks, that was a big help, we'll see what happens as it develops, actionas and filters are still a little grey for me, but the admin page is working now.

Topic Closed

This topic has been closed to new replies.

About this Topic