Jetpack_IDC::maybe_clear_migrate_option PHP Метод

maybe_clear_migrate_option() публичный Метод

This method loops through the array of processed items from sync and checks if one of the items was the home_url or site_url callable. If so, then we delete the jetpack_migrate_for_idc option.
public maybe_clear_migrate_option ( $processed_items )
$processed_items array Array of processed items that were synced to WordPress.com
    function maybe_clear_migrate_option($processed_items)
    {
        foreach ((array) $processed_items as $item) {
            // First, is this item a jetpack_sync_callable action? If so, then proceed.
            $callable_args = is_array($item) && isset($item[0], $item[1]) && 'jetpack_sync_callable' === $item[0] ? $item[1] : null;
            // Second, if $callable_args is set, check if the callable was home_url or site_url. If so,
            // clear the migrate option.
            if (isset($callable_args, $callable_args[0]) && ('home_url' === $callable_args[0] || 'site_url' === $callable_args[1])) {
                Jetpack_Options::delete_option('migrate_for_idc');
                break;
            }
        }
    }