0

I am getting an warning message in my Wordpress :

"Creating default object from empty value in /home/forthemde/public_html/wp-content/themes/mayadeep/admin/admin.php on line 225"

Here the code on admin.php and:

 function upfw_setup_theme_options(){
     $up_options_db = get_option('up_themes_'.UPTHEMES_SHORT_NAME);
     global $up_options;
     //Check if options are stored properly
     if( isset($up_options_db) && is_array($up_options_db) ):
         //Check array to an object
         foreach ($up_options_db as $k => $v) {
                 $up_options -> {$k} = $v;
         }
     else:
         do_action('upfw_theme_activation');
     endif;
 }
 add_action('upfw_theme_init','upfw_setup_theme_options',10);
 add_action('upfw_admin_init','upfw_setup_theme_options',100);

Line 225 is here:

 $up_options -> {$k} = $v;

I try to fix by myself, but no result. Please help me, really appreciate for any help.

Regards.

4
  • Can I suggest just typecasting $up_options_db to an object? $up_options = (object) $up_options_db; - Does that do as you want? Commented Sep 11, 2013 at 14:30
  • stackoverflow.com/questions/8900701/… Commented Sep 11, 2013 at 14:33
  • Hi, Jothi Kannan. How can I do that? Which part I should to change? Really appreciate for your help. Commented Sep 11, 2013 at 15:05
  • @AnabeleRosemary you can do it by using blockquote in the editor Commented Sep 11, 2013 at 15:09

1 Answer 1

1

I had this problem too, recently, but this worked for me:

Just added $up_options = new stdClass(); after global $up_options;

Best regards, http://shubhinfotech.com http://c-worx.com

Sign up to request clarification or add additional context in comments.

1 Comment

Ran into this issue recently. This worked for me. Thanks!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.