Title: stevefactor's Replies | WordPress.org

---

# stevefactor

  [  ](https://wordpress.org/support/users/stevefactor/)

 *   [Profile](https://wordpress.org/support/users/stevefactor/)
 *   [Topics Started](https://wordpress.org/support/users/stevefactor/topics/)
 *   [Replies Created](https://wordpress.org/support/users/stevefactor/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/stevefactor/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/stevefactor/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/stevefactor/engagements/)
 *   [Favorites](https://wordpress.org/support/users/stevefactor/favorites/)

 Search replies:

## Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [no admin access with custom theme](https://wordpress.org/support/topic/no-admin-access-with-custom-theme/)
 *  Thread Starter [stevefactor](https://wordpress.org/support/users/stevefactor/)
 * (@stevefactor)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/no-admin-access-with-custom-theme/#post-13513521)
 * Thanks. I’m aware I can turn off the warnings and that warnings don’t typically
   crash the site, but I’m a bit worried that the mere presentation of the warnings
   is enough to shut down admin access. Then I have to back into the admin area 
   by renaming the theme and then restoring that theme’s name. That is an odd behavior
   that I’d like to fix.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [how to fix create_function in custom theme](https://wordpress.org/support/topic/how-to-fix-create_function-in-custom-theme/)
 *  Thread Starter [stevefactor](https://wordpress.org/support/users/stevefactor/)
 * (@stevefactor)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/how-to-fix-create_function-in-custom-theme/#post-13510097)
 * Great. That got rid of the error. I had assumed that those empty variables were
   being filled in later but I guess then they would at least have variables stated
   within them.
 * Thanks! Now onto the remaining Warnings and Notices.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [how to fix create_function in custom theme](https://wordpress.org/support/topic/how-to-fix-create_function-in-custom-theme/)
 *  Thread Starter [stevefactor](https://wordpress.org/support/users/stevefactor/)
 * (@stevefactor)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/how-to-fix-create_function-in-custom-theme/#post-13509920)
 * Yes, I did shorten the code from the script (see below).
 * I’m afraid my knowledge of PHP and how it’s implemented for WP makes it difficult
   for me to clearly understand what you’re suggesting by moving the code it has
   to its own function. Frankly speaking, spelling it out for my example is what
   I’ll need to follow.
 * I do code in python and used to code html/css but this really is out of my ken.
   Unfortunately, we can’t go back to the original authors. Am I in over my head–
   by a long shot. But I’m hoping if it’s not too complex of a fix that I’ll learn
   something along the way. Hard for me to gauge exactly what I’m dealing with. 
   Thanks for any help.
 * Here’s the rest of the code from that script. Let me know if there are other 
   parts of the custom theme that would be needed to decipher what a fix would be.
 *     ```
       <?php
       function attach_main_options_page() {
       	$title = "Theme Options";
       	add_menu_page(
       		$title,
       		$title, 
       		'edit_themes', 
       	    basename(__FILE__),
       		create_function('', '')
       	);
       }
       add_action('admin_menu', 'attach_main_options_page');
   
       $home_slider_fade_speed = wp_option::factory('text', 'home_slider_fade_speed', 'Slideshow Speed');
       $home_slider_fade_speed->set_default_value(500);
       $home_slider_fade_speed->help_text('Animation speed in milliseconds');
   
       $home_slider_fade_interval = wp_option::factory('text', 'home_slider_fade_interval', 'Slideshow Interval');
       $home_slider_fade_interval->set_default_value(5000);
       $home_slider_fade_interval->help_text('Animation interval in milliseconds');
   
       $tryout_link = wp_option::factory('text', 'tryout_link', 'Tryout Link');
       $tryout_link = wp_option::factory('text', 'tryout_link', 'Tryout Link');
       $tryout_link->help_text('This defines the link URL of the Try out the new Hierarchy Explorer on home page');
       $tryout_link->set_default_value('#');
   
       $inner_options = new OptionsPage(array(
       	$home_slider_fade_speed,
       	$home_slider_fade_interval,
       	$tryout_link,
       	wp_option::factory('header_scripts', 'header_script'),
           wp_option::factory('footer_scripts', 'footer_script'),
           ));
       $inner_options->title = 'General';
       $inner_options->file = basename(__FILE__);
       $inner_options->parent = "theme-options.php";
       $inner_options->attach_to_wp();
   
       ?>
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)