I wonder too about the serialization, so I tried to re-serialize the data by doing something like:
$global wpdb;
$data = $wpdb->get_var('SELECT option_value FROM wp_options WHERE option_name = \'gcb_#\'');
$updated = update_option('gcb_#', serialize($data));
// Verify.
($updated) ? echo 'Updated!' : echo 'Not updated!';
GCB class has a method which is just a wrapper for the same update_option()
call.
Here are the string data values for two of the content blocks that stopped being recognized by GCB after the phpMyAdmin action I described in the original post. The first is from “before” the update (I had to grab the values from the copy of the db on my testing server), and the second is from after the update triggered by phpMyAdmin.
Array
(
[0] => Array
(
[option_name] => gcb_1
[option_value] => s:400:"a:6:{s:4:"name";s:14:"Mailchimp Form";s:11:"description";s:85:"Basic Mailchimp signup form with only required fields (first name, last name, email).";s:5:"value";s:150:"<aside id=\"mailing-list-block\" class=\"large-4 columns\"><h4>Stay Connected</h4>[mc4wp_form]</aside>
";s:9:"custom_id";s:18:"mailing_list_block";s:4:"type";s:5:"other";s:2:"id";i:1;}";
)
[1] => Array
(
[option_name] => gcb_3
[option_value] => s:384:"a:6:{s:4:"name";s:11:"Other Block";s:11:"description";s:0:"";s:5:"value";s:230:"<aside id=\"other-block\" class=\"large-4 columns\">
<h4>Some Other Block</h4>
[contentblock id=newsfeed]
[contentblock id=donation_block]
[contentblock id=socialfeedblock]
</aside>";s:9:"custom_id";s:11:"other_block";s:4:"type";s:5:"other";s:2:"id";i:3;}";
)
After:
Array
(
[0] => Array
(
[option_name] => gcb_1
[option_value] => s:400:"a:6:{s:4:"name";s:14:"Mailchimp Form";s:11:"description";s:85:"Basic Mailchimp signup form with only required fields (first name, last name, email).";s:5:"value";s:150:"<aside id=\"mailing-list-block\" class=\"large-4 columns\"><h4>Stay Connected</h4>[mc4wp_form]</aside>
";s:9:"custom_id";s:18:"mailing_list_block";s:4:"type";s:5:"other";s:2:"id";i:1;}";
)
[1] => Array
(
[option_name] => gcb_3
[option_value] => s:384:"a:6:{s:4:"name";s:11:"Other Block";s:11:"description";s:0:"";s:5:"value";s:230:"<aside id=\"other-block\" class=\"large-4 columns\">
<h4>Some Other Block</h4>
[contentblock id=newsfeed]
[contentblock id=donation_block]
[contentblock id=socialfeedblock]
</aside>";s:9:"custom_id";s:11:"other_block";s:4:"type";s:5:"other";s:2:"id";i:3;}";
)
At this point I’m considering uninstalling GCB from my local environment, then reinstalling and importing the “clean” version of the content blocks that I exported from my testing server. Any other thoughts though are greatly appreciated!