Solved: Conflict between Intuitive CPO + Multi Site + CMB2 (Maybe Others)
-
Hey there,
I discovered a conflict of some sort when using Intuitive CPO, CMB2, and the WordPress Network (Multi Site). When administering a blog that does not have the blog_id of 1, the get_blogs_of_user filter which calls the hicpo_get_blogs_of_user function will break the CMB2 meta data saving process.
Apparently the switch_to_blog($current) at the top of this function does not properly retain information that is waiting to be saved. The entire IF block at the top of this function can be replaced with one line of code, and this line does not break the saving functionality:
if ( !get_blog_option( 1, ‘hicpo_network_sites’ ) ) return $blogs;
Using this line, you can simply move the global $blog_id declaration into the following line, so the top of this function now looks like:
function hicpo_get_blogs_of_user( $blogs )
{
if ( !get_blog_option( 1, ‘hicpo_network_sites’ ) ) return $blogs;
global $wpdb, $blog_id, $wp_version;[…]
}Hopefully this fix can be added to the plugin by the author.
Thanks!
- The topic ‘Solved: Conflict between Intuitive CPO + Multi Site + CMB2 (Maybe Others)’ is closed to new replies.