• Resolved Rubyfire

    (@rubyfire)


    I’m am very lost. I have a premium membership at Tuts+ and my tutorial says to use the add_options_page(); for my options page. I’ve also looked in the source and there lies the function. The codex also has this function being used to add options pages for WP-2.7 and later. Yet wordpress is failing saying that the function does not exist? How the hell is this possible? ??

    Can anyone help me? Here’s my code for reference.

    <?php
    /*
    Plugin Name: Sahfire Options
    Plugin URI: https://demosite.com
    Description: Options page for Sahfire WordPress Theme
    Version: 1.0
    Author: Bobby Ruby
    Author URI: https://rubyfiredesigns.com
    */
    function sahfire_theme_options(){ ?>
    	<h2>Hello</h2>
    <?php }
    add_action('admin_menu', sahfire_menu()); 
    
    function sahfire_menu() {
    	  add_options_page('Theme Options', 'Theme Options', 'administrator', __FILE__, sahfire_theme_options());
    }
    ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • I’m pretty sure your issue is the how you’re calling the function in your action.

    add_action('admin_menu', sahfire_menu());

    should be

    add_action('admin_menu', 'sahfire_menu' );

    If that doesn’t fix it then give us all the debug output please.

    Thread Starter Rubyfire

    (@rubyfire)

    wow… that is one small detail I did not pay attention too…. I’ll give it a shot and get back. Thanks Curt.

    Thread Starter Rubyfire

    (@rubyfire)

    Resolved thanks man… Wow… What poor attention to detail. Well got it taken care of now. Thanks Man.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘add_options_page Function’ is closed to new replies.