Reusable-Custom-WordPress-Meta-Boxes
Reusable-Custom-WordPress-Meta-Boxes copied to clipboard
issue with post_checkboxes type
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];
}
Where are you getting this error, on the back end or front end?
Right under the checkboxes of posts in admin (backend).
disappeared after i upgraded to git version
appeared again!! maybe this is php version issue?
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 , ' <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