Support » Themes and Templates » Warning error after use of an array

  • Resolved m_bird


    I recently added an array to a section of php coding in order to apply it in multiple circumstances. The code itself is accurate but when I add it to my code I get the following message:

    Warning: Illegal offset type in isset or empty in /home/adminbhd/public_html/wp-admin/includes/template.php on line 877

    This warning continues on several lines within this file. Can anyone tell me why it would affect this file at all and also if any one has a solutions I would greatly appreciate it.

    Many Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • It going to be hard to help without seeing the section of code that you edited. Can you post that to the pastebin?

    Sure thing, Thanks for looking.

    The original code is:

    the modified code is:

    I am using the thesis theme.

    Two things.

    $meta_box['id'], $meta_box['title'], array('thesis_post_options', 'output_' . $meta_name . '_box'), array( 'graphics', 'illustration', 'logos' ) 'normal', 'high'

    It looks like you can’t use an array as that fifth parameter and, second, you are missing a comma between the fifth and sixth parameter.

    Apologies, the comma was present in the modified code I tried, it was just posted wrong, the same warning occurs. Do you perhaps know of a way I could achieve the same affect (i.e adding the meta boxes to my custom posts) without the array there? I cannot repeat the code and attribute a new name as I get a repeat error.

    You could nest another foreach loop.

    The new meta_boxes array will be null on the existing posts, so you need to test if the array has a value.

    $post_options = new thesis_post_options;
    if( isset( $post_options ) ) {
       // Do Stuff



Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Warning error after use of an array’ is closed to new replies.