Updated to 4.6 this morning on a site with EM 5.6.5 and was greeted with this site crippling message:
Fatal error: [] operator not supported for strings in /home/XXXX/public_html/wp-content/plugins/events-manager/em-posts.php on line 30
Taking a look at em-posts.php
, here’s the relevant context for line 30:
if( is_array($_wp_theme_features['post-thumbnails']) ){
$post_thumbnails = array_shift($_wp_theme_features['post-thumbnails']);
//add to featured image post types for specific themes
$post_thumbnails[] = EM_POST_TYPE_EVENT; #30
$post_thumbnails[] = 'event-recurring';
$post_thumbnails[] = EM_POST_TYPE_LOCATION;
add_theme_support('post-thumbnails', $post_thumbnails);
}
What seems to be happening, and your error @tony marray, is that what is happening is it’s using the existing global value of $_wp_theme_features['post-thumbnails']
and retriving the known array of post types with thumbnails. To get mine working and speed it up a bit I changed it so $post_thumbnails
is just a new array to add even managers post types, don’t need to worry about other’s at all:
if( is_array($_wp_theme_features['post-thumbnails']) ){
$post_thumbnails = array();
//add to featured image post types for specific themes
$post_thumbnails[] = EM_POST_TYPE_EVENT; #30
$post_thumbnails[] = 'event-recurring';
$post_thumbnails[] = EM_POST_TYPE_LOCATION;
add_theme_support('post-thumbnails', $post_thumbnails);
}
No errors, all post thumbnail widgets are loading. Thoughts?