/home/techb158/l2hypotheques.com/wp-content/plugins/breadcrumb-navxt
Edit: /home/techb158/l2hypotheques.com/wp-content/plugins/breadcrumb-navxt/options_upgrade.php (8660B)
' . esc_html__('Your PHP version is too old, please upgrade to a newer version. Your version is %1$s, Breadcrumb NavXT requires %2$s', 'breadcrumb-navxt') . '
', esc_html(phpversion()), '7.0.0');
}
//If we are in the admin, let's print a warning then return
if(is_admin())
{
add_action('admin_notices', 'bcn_phpold');
}
return;
}
//FIXME: this seems to be all sorts of garbage that needs fixing
function bcn_options_upgrade_handler(&$opts, $version, $defaults)
{
//Upgrading to 3.8.1
if(version_compare($version, '3.8.1', '<'))
{
$opts['post_page_root'] = get_option('page_on_front');
$opts['post_post_root'] = get_option('page_for_posts');
}
//Upgrading to 4.0
if(version_compare($version, '4.0.0', '<'))
{
//Only migrate if we haven't migrated yet
if(isset($opts['current_item_linked']))
{
//Loop through the old options, migrate some of them
foreach($opts as $option => $value)
{
//Handle all of our boolean options first, they're real easy, just add a 'b'
if(strpos($option, 'display') > 0 || $option == 'current_item_linked')
{
$defaults['b' . $option] = $value;
}
//Handle migration of anchor templates to the templates
else if(strpos($option, 'anchor') > 0)
{
$parts = explode('_', $option);
//Do excess slash removal sanitation
$defaults['H' . $parts[0] . '_template'] = $value . '%htitle%';
}
//Handle our abs integers
else if($option == 'max_title_length' || $option == 'post_post_root' || $option == 'post_page_root')
{
$opts['a' . $option] = $value;
}
//Now everything else, minus prefix and suffix
else if(strpos($option, 'prefix') === false && strpos($option, 'suffix') === false)
{
$defaults['S' . $option] = $value;
}
}
}
//Add in the new settings for CPTs introduced in 4.0
foreach($GLOBALS['wp_post_types'] as $post_type)
{
//We only want custom post types
if(!$post_type->_builtin)
{
//Add in the archive_display option
$defaults['bpost_' . $post_type->name . '_archive_display'] = $post_type->has_archive;
}
}
$opts = $defaults;
}
if(version_compare($version, '4.0.1', '<'))
{
if(isset($opts['Hcurrent_item_template_no_anchor']))
{
unset($opts['Hcurrent_item_template_no_anchor']);
}
if(isset($opts['Hcurrent_item_template']))
{
unset($opts['Hcurrent_item_template']);
}
}
//Upgrading to 4.3.0
if(version_compare($version, '4.3.0', '<'))
{
//Removed home_title
if(isset($opts['Shome_title']))
{
unset($opts['Shome_title']);
}
//Removed mainsite_title
if(isset($opts['Smainsite_title']))
{
unset($opts['Smainsite_title']);
}
}
//Upgrading to 5.1.0
if(version_compare($version, '5.1.0', '<'))
{
foreach($GLOBALS['wp_taxonomies'] as $taxonomy)
{
//If we have the old options style for it, update
if($taxonomy->name !== 'post_format' && isset($opts['H' . $taxonomy->name . '_template']))
{
//Migrate to the new setting name
$opts['Htax_' . $taxonomy->name . '_template'] = $opts['H' . $taxonomy->name . '_template'];
$opts['Htax_' . $taxonomy->name . '_template_no_anchor'] = $opts['H' . $taxonomy->name . '_template_no_anchor'];
//Clean up old settings
unset($opts['H' . $taxonomy->name . '_template']);
unset($opts['H' . $taxonomy->name . '_template_no_anchor']);
}
}
}
//Upgrading to 5.4.0
if(version_compare($version, '5.4.0', '<'))
{
//Migrate users to schema.org breadcrumbs for author and search if still on the defaults for posts
if($opts['Hpost_post_template'] === bcn_breadcrumb::get_default_template() && $opts['Hpost_post_template_no_anchor'] === bcn_breadcrumb::default_template_no_anchor)
{
if($opts['Hpaged_template'] === 'Page %htitle%')
{
$opts['Hpaged_template'] = $defaults['Hpaged_template'];
}
if($opts['Hsearch_template'] === 'Search results for '