Reusable-Custom-WordPress-Meta-Boxes icon indicating copy to clipboard operation
Reusable-Custom-WordPress-Meta-Boxes copied to clipboard

issue with post_checkboxes type

Open ghost opened this issue 12 years ago • 5 comments

Warning: Illegal offset type in /home/u478232299/public_html/wp-includes/post.php on line 1097

array(
        'label' => 'Работы', // <label>
        'desc'  => 'Список работ.', // description
        'id'    =>  $prefix.'works_list', // field id and name
        'type'  => 'post_checkboxes', // type of field
        'post_type' => array('works_type') // post types to display, options are prefixed with their post type
    ),

file wp-icludes/posts.php lines 1081 through 1101:

function get_post_type_object( $post_type ) {
    global $wp_post_types;

    if ( empty($wp_post_types[$post_type]) )
        return null;

    return $wp_post_types[$post_type];
}

ghost avatar Feb 01 '13 12:02 ghost

Where are you getting this error, on the back end or front end?

tammyhart avatar Feb 07 '13 06:02 tammyhart

Right under the checkboxes of posts in admin (backend).

ghost avatar Feb 11 '13 07:02 ghost

disappeared after i upgraded to git version

ghost avatar Feb 11 '13 22:02 ghost

 SAUCE WordPress appeared again!! maybe this is php version issue?

ghost avatar Feb 12 '13 21:02 ghost

I was having the same issue, and was able to resolve it by removing this line from the meta_box.php case for 'post_checkboxes':

$post_type_object = get_post_type_object( $post_type );
echo '</ul> ' . $desc , ' &nbsp;<span class="description"><a href="' . admin_url( 'edit.php?post_type=' . $post_type . '">Manage ' . $post_type_object->label ) . '</a></span>';

And replacing it with this, effectively removing the "Manage" link and my error went away.

echo '</ul> ';

So it may have to do with the

get_post_type_object()
function

wesdekoninck avatar Feb 15 '13 20:02 wesdekoninck