“Trying to get properties on a non-object” in PHP

前端 未结 4 1878
一向
一向 2021-01-05 10:43

I\'m a WordPress theme developer and on a theme I\'m working on, I\'ve turned on debug mode and get this error inside a select drop-down box for the theme\'s options page. <

4条回答
  •  再見小時候
    2021-01-05 10:49

    OK I see what you're saying. Earlier in my code I have this (overly simplified, just to show the important parts):

    $news_categories = get_categories()  //pulls all of the categories from WordPress
    
            array ("minititle"      => 'Select the category you\'d like to use as your "Top Story" category.',
                "id"        => $shortname . "_top_story_category",
                "type"      => "cat_select",
                "options" => $news_categories)
    

    This is where $value['options'] comes from. The code is part of a switch statement...

    I would have to post the entire file in order to give the context, and it's quite long.

提交回复
热议问题