• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_serialized函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中is_serialized函数的典型用法代码示例。如果您正苦于以下问题:PHP is_serialized函数的具体用法?PHP is_serialized怎么用?PHP is_serialized使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了is_serialized函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: genesis_update_check

/**
 * Pings http://api.genesistheme.com/ asking if a new version of this theme is
 * available.
 *
 * If not, it returns false.
 *
 * If so, the external server passes serialized data back to this function,
 * which gets unserialized and returned for use.
 *
 * @since 1.1.0
 *
 * @uses genesis_get_option()
 * @uses PARENT_THEME_VERSION Genesis version string
 *
 * @global string $wp_version WordPress version string
 * @return mixed Unserialized data, or false on failure
 */
function genesis_update_check()
{
    global $wp_version;
    /**	If updates are disabled */
    if (!genesis_get_option('update') || !current_theme_supports('genesis-auto-updates')) {
        return false;
    }
    /** Get time of last update check */
    $genesis_update = get_transient('genesis-update');
    /** If it has expired, do an update check */
    if (!$genesis_update) {
        $url = 'http://api.genesistheme.com/update-themes/';
        $options = apply_filters('genesis_update_remote_post_options', array('body' => array('genesis_version' => PARENT_THEME_VERSION, 'wp_version' => $wp_version, 'php_version' => phpversion(), 'uri' => home_url(), 'user-agent' => "WordPress/{$wp_version};")));
        $response = wp_remote_post($url, $options);
        $genesis_update = wp_remote_retrieve_body($response);
        /** If an error occurred, return FALSE, store for 1 hour */
        if ('error' == $genesis_update || is_wp_error($genesis_update) || !is_serialized($genesis_update)) {
            set_transient('genesis-update', array('new_version' => PARENT_THEME_VERSION), 60 * 60);
            return false;
        }
        /** Else, unserialize */
        $genesis_update = maybe_unserialize($genesis_update);
        /** And store in transient for 24 hours */
        set_transient('genesis-update', $genesis_update, 60 * 60 * 24);
    }
    /** If we're already using the latest version, return false */
    if (version_compare(PARENT_THEME_VERSION, $genesis_update['new_version'], '>=')) {
        return false;
    }
    return $genesis_update;
}
开发者ID:hscale,项目名称:webento,代码行数:48,代码来源:upgrade.php


示例2: payment_post_meta

    public function payment_post_meta($payment_id)
    {
        ini_set('xdebug.var_display_max_depth', 5);
        ini_set('xdebug.var_display_max_children', 256);
        ini_set('xdebug.var_display_max_data', 1024);
        ?>
<div id="edd-payment-meta" class="postbox">
	<h3 class="hndle"><?php 
        _e('Payment Postmeta Items', 'edd-dev-tools');
        ?>
</h3>
	<div class="inside">
		<div style="overlfow:auto">
		<?php 
        $post_meta = get_metadata('post', $payment_id);
        ?>
			<pre style="overflow: auto;word-wrap: break-word;">
			<?php 
        foreach ($post_meta as $key => $value) {
            if (is_serialized($value[0])) {
                echo $key . '=> ';
                var_dump(unserialize($value[0]));
            } else {
                echo $key . ' => ' . $value[0] . "\n";
            }
        }
        ?>
			</pre>
		</div>
	</div>
</div>
<?php 
    }
开发者ID:easydigitaldownloads,项目名称:edd-dev-tools,代码行数:33,代码来源:payments.php


示例3: cjtheme_fetch_shortcode_options

function cjtheme_fetch_shortcode_options()
{
    global $wpdb, $shortcode_tags;
    $select_shortcodes = null;
    $shortcode_options = cjtheme_do_shortcode('[' . $_POST['shortcode'] . ' return="options"]');
    $shortcode_options = is_serialized($shortcode_options) ? unserialize($shortcode_options) : $shortcode_options;
    $shortcode_defaults = cjtheme_do_shortcode('[' . $_POST['shortcode'] . ' return="defaults"]');
    $shortcode_defaults = is_serialized($shortcode_defaults) ? unserialize($shortcode_defaults) : $shortcode_defaults;
    $form_fields[] = array('type' => 'heading', 'id' => 'shortcode-settings-heading', 'label' => '', 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => __('Shortcode Settings', 'cjtheme'), 'options' => '');
    if (!is_null($shortcode_options['description'])) {
        $form_fields[] = array('type' => 'info-full', 'id' => 'shortcode_info', 'label' => '', 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => $shortcode_options['description'], 'options' => '');
    }
    if ($shortcode_options['stype'] == 'closed' && isset($shortcode_options['default_content']) && $shortcode_options['default_content'] != '') {
        $form_fields[] = array('type' => 'textarea', 'id' => 'shortcode_content', 'label' => __('Content', 'cjtheme'), 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => $shortcode_options['default_content'], 'options' => '');
    }
    foreach ($shortcode_options as $key => $options) {
        if (is_array($options)) {
            $form_fields[] = array('type' => $options[1], 'id' => $key, 'label' => $options[0], 'info' => $options[3], 'suffix' => '', 'prefix' => '', 'default' => isset($shortcode_defaults[$key]) ? $shortcode_defaults[$key] : '', 'options' => is_array($options[2]) ? $options[2] : '');
        }
    }
    $form_fields[] = array('type' => 'submit', 'id' => 'cj-insert-shortcode', 'label' => __('Insert Shortcode', 'cjtheme'), 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => '', 'options' => '');
    echo '<div class="cj-table">';
    echo '<form action="" method="post" id="cj-shortcode-settings-form" data-shortcode-stype="' . $shortcode_options['stype'] . '" data-shortcode-name="' . $_POST['shortcode'] . '">';
    echo cjtheme_admin_form_raw($form_fields, 'no-search-box', true);
    echo '</form>';
    echo '</div>';
    die;
}
开发者ID:praveen-thayikkattil,项目名称:cartoq-theme,代码行数:28,代码来源:admin_ajax.php


示例4: ns_recursive_search_replace

/**
 * Recursively search and replace
 * @param mixed $data - **by reference** - string or array which should have find/replace applied
 * @param array $search array with text values to find
 * @param array $replace array with text values to replace $search values with
 * @param array $regex_search array with regular expressions to look for
 * @param array $regex_replace array with text value to replace $regex_search values with
 * @return int number of replacements made
 */
function ns_recursive_search_replace(&$data, $search, $replace, $regex_search = array(), $regex_replace = array(), $case_sensitive = false)
{
    $is_serialized = is_serialized($data);
    $string_replacements_made = $regex_replacements_made = 0;
    // unserialize if need be
    if ($is_serialized) {
        $data = unserialize($data);
    }
    // run through replacements for strings, arrays - other types are unsupported to vaoid
    if (is_array($data)) {
        foreach ($data as $key => $value) {
            ns_recursive_search_replace($data[$key], $search, $replace, $regex_search, $regex_replace, $case_sensitive);
        }
    } elseif (is_string($data)) {
        // simple string replacment - most of the time this is all that is needed
        $replace_func = $case_sensitive ? 'str_replace' : 'str_ireplace';
        $data = $replace_func($search, $replace, $data, $string_replacements_made);
        // advanced regex replacement - this will be skipped most of the time
        if (!empty($regex_search) && !empty($regex_replace)) {
            $data = preg_replace($regex_search, $regex_replace, $data, -1, $regex_replacements_made);
        }
    }
    // reserialize if need be
    if ($is_serialized) {
        $data = serialize($data);
    }
    // return count of replacements made
    return $string_replacements_made + $regex_replacements_made;
}
开发者ID:AlexanderDolgan,项目名称:ojahuri,代码行数:38,代码来源:ns-utils.php


示例5: display_field

 public function display_field($field, $group_index = 1, $field_index = 1)
 {
     $output = '';
     $is_multiple = $field['options']['multiple'] ? true : false;
     $check_post_id = null;
     if (!empty($_REQUEST['post'])) {
         $check_post_id = $_REQUEST['post'];
     }
     $values = array();
     if ($check_post_id) {
         $values = $field['input_value'] ? is_serialized($field['input_value']) ? unserialize($field['input_value']) : (array) $field['input_value'] : array();
     } else {
         $values[] = $field['options']['default_value'];
     }
     foreach ($values as &$val) {
         $val = trim($val);
     }
     $options = preg_split("/\\n/", $field['options']['options']);
     $output = '<div class="mf-dropdown-box">';
     $multiple = $is_multiple ? 'multiple="multiple"' : '';
     $output .= sprintf('<select class="dropdown_mf" id="%s" name="%s[]" %s >', $field['input_id'], $field['input_name'], $multiple);
     foreach ($options as $option) {
         $option = trim($option);
         $check = in_array($option, $values) ? 'selected="selected"' : '';
         $output .= sprintf('<option value="%s" %s >%s</option>', esc_attr($option), $check, esc_attr($option));
     }
     $output .= '</select>';
     $output .= '</div>';
     return $output;
 }
开发者ID:GafaMX,项目名称:dev_funciones_basicas,代码行数:30,代码来源:dropdown_field.php


示例6: _getAll

 protected function _getAll()
 {
     $result = array();
     $_temp = array();
     global $wpdb;
     $key_prefix = $this->_getOptionName('');
     $terms = $wpdb->get_results("SELECT option_name, option_value FROM {$wpdb->options} WHERE option_name LIKE '{$key_prefix}%'");
     foreach ($terms as $term) {
         if (is_serialized($term->option_value)) {
             $_term = unserialize($term->option_value);
             $key = str_replace($key_prefix, '', $term->option_name);
             if (trim($_term['description'])) {
                 $_temp[$_term['description']][] = array('key' => $key, 'term' => $_term);
             } else {
                 $_temp[] = array('key' => $key, 'term' => $_term);
             }
         }
     }
     ksort($_temp);
     foreach ($_temp as $temp) {
         if (!isset($temp['key'])) {
             foreach ($temp as $t) {
                 $result[$t['key']] = $t['term'];
             }
         } else {
             $result[$temp['key']] = $temp['term'];
         }
     }
     return $result;
 }
开发者ID:hacklabr,项目名称:portal-timtec,代码行数:30,代码来源:WPEIP_SourceOption.class.php


示例7: pmxi_wp_ajax_auto_detect_sf

function pmxi_wp_ajax_auto_detect_sf()
{
    if (!check_ajax_referer('wp_all_import_secure', 'security', false)) {
        exit(json_encode(array('result' => array(), 'msg' => __('Security check', 'wp_all_import_plugin'))));
    }
    if (!current_user_can(PMXI_Plugin::$capabilities)) {
        exit(json_encode(array('result' => array(), 'msg' => __('Security check', 'wp_all_import_plugin'))));
    }
    $input = new PMXI_Input();
    $fieldName = $input->post('name', '');
    $post_type = $input->post('post_type', 'post');
    global $wpdb;
    $result = array();
    if ($fieldName) {
        if ($post_type == 'import_users') {
            $values = $wpdb->get_results("\n\t\t\t\tSELECT DISTINCT usermeta.meta_value\n\t\t\t\tFROM " . $wpdb->usermeta . " as usermeta\n\t\t\t\tWHERE usermeta.meta_key='" . $fieldName . "'\n\t\t\t", ARRAY_A);
        } else {
            $values = $wpdb->get_results("\n\t\t\t\tSELECT DISTINCT postmeta.meta_value\n\t\t\t\tFROM " . $wpdb->postmeta . " as postmeta\n\t\t\t\tWHERE postmeta.meta_key='" . $fieldName . "'\n\t\t\t", ARRAY_A);
        }
        if (!empty($values)) {
            foreach ($values as $key => $value) {
                if (!empty($value['meta_value']) and is_serialized($value['meta_value'])) {
                    $v = unserialize($value['meta_value']);
                    if (!empty($v) and is_array($v)) {
                        foreach ($v as $skey => $svalue) {
                            $result[] = array('key' => $skey, 'val' => maybe_serialize($svalue));
                        }
                        break;
                    }
                }
            }
        }
    }
    exit(json_encode(array('result' => $result)));
}
开发者ID:estrategasdigitales,项目名称:rufiatta,代码行数:35,代码来源:wp_ajax_auto_detect_sf.php


示例8: duplicate_over_multisite

function duplicate_over_multisite($post_id_to_copy, $new_blog_id, $post_type, $post_author, $prefix, $post_status)
{
    $mdp_post = get_post($post_id_to_copy);
    $title = get_the_title($mdp_post);
    if ($prefix != '') {
        $prefix = $prefix . ' ';
    }
    $mdp_post = array('post_title' => $prefix . $title, 'post_status' => $post_status, 'post_type' => $post_type, 'post_author' => $post_author, 'post_content' => $mdp_post->post_content);
    $data = get_post_custom($mdp_post);
    $meta_values = get_post_meta($post_id_to_copy);
    switch_to_blog($new_blog_id);
    $post_id = wp_insert_post($mdp_post);
    foreach ($data as $key => $values) {
        foreach ($values as $value) {
            add_post_meta($post_id, $key, $value);
        }
    }
    foreach ($meta_values as $key => $values) {
        foreach ($values as $value) {
            if (is_serialized($value)) {
                add_post_meta($post_id, $key, unserialize($value));
            } else {
                add_post_meta($post_id, $key, $value);
            }
        }
    }
    restore_current_blog();
    return $post_id;
}
开发者ID:sergiambel,项目名称:multisite-post-duplicator,代码行数:29,代码来源:core.php


示例9: test

 public function test($data)
 {
     if (function_exists('is_serialized')) {
         return is_serialized($data);
     }
     return preg_match('/(a\\:[0-9]{1,})?(i\\:[0-9]{1,})?(s\\:[0-9]{1,})?/', $data) && !empty($this->decodedData = unserialize($data));
 }
开发者ID:russam,项目名称:edc,代码行数:7,代码来源:Serialized.php


示例10: convert_font_to_variable

function convert_font_to_variable($data, $tag)
{
    //is_serialized
    $value = '';
    if (is_serialized($data)) {
        $data = unserialize($data);
    }
    if (isset($data['font-family'])) {
        $value = "@{$tag}_font_family: {$data['font-family']};\n";
    }
    if (isset($data['color-opacity'])) {
        $value .= "@{$tag}_color: {$data['color-opacity']};\n";
    }
    if (isset($data['font-weight'])) {
        $value .= "@{$tag}_font_weight: {$data['font-weight']};\n";
    }
    if (isset($data['font-style'])) {
        $value .= "@{$tag}_font_style: {$data['font-style']};\n";
    }
    if (isset($data['text-transform'])) {
        $value .= "@{$tag}_text_transform: {$data['text-transform']};\n";
    }
    if (isset($data['font-size'])) {
        $value .= "@{$tag}_font_size: {$data['font-size']};\n";
    }
    if (isset($data['line-height'])) {
        $value .= "@{$tag}_line_height: {$data['line-height']};\n";
    }
    return $value;
}
开发者ID:vinhnq1211,项目名称:funy,代码行数:30,代码来源:theme-options-to-css.php


示例11: ultimatum_update_check

 function ultimatum_update_check()
 {
     global $wp_version;
     $ultimatumversion = get_option('ultimatum_version');
     $apikey = get_option('ultimatum_api');
     $ultimatum_update = get_transient('ultimatum-update');
     if (!$ultimatum_update) {
         $url = 'http://api.ultimatumtheme.com/';
         $options = array('body' => array('task' => 'updatecheck', 'ultimatum_version' => $ultimatumversion, 'wp_version' => $wp_version, 'php_version' => phpversion(), 'uri' => home_url(), 'api_key' => $apikey, 'user-agent' => "WordPress/{$wp_version};"));
         $response = wp_remote_post($url, $options);
         $ultimatum_update = wp_remote_retrieve_body($response);
         // If an error occurred, return FALSE, store for 1 hour
         if ($ultimatum_update == 'error' || is_wp_error($ultimatum_update) || !is_serialized($ultimatum_update)) {
             set_transient('ultimatum-update', array('new_version' => $ultimatumversion), 60 * 60);
             // store for 1 hour
             return FALSE;
         }
         // Else, unserialize
         $ultimatum_update = maybe_unserialize($ultimatum_update);
         //print_r($ultimatum_update);die();
         // And store in transient
         set_transient('ultimatum-update', $ultimatum_update, 60 * 60 * 24);
         // store for 24 hours
     }
     // If we're already using the latest version, return FALSE
     if (version_compare($ultimatumversion, $ultimatum_update['new_version'], '>=')) {
         return FALSE;
     }
     return $ultimatum_update;
 }
开发者ID:shieldsdesignstudio,项目名称:forefield,代码行数:30,代码来源:menus.php


示例12: display_field

 public function display_field($field, $group_index = 1, $field_index = 1)
 {
     $output = '';
     $check_post_id = null;
     if (!empty($_REQUEST['post'])) {
         $check_post_id = $_REQUEST['post'];
     }
     $values = array();
     if ($check_post_id) {
         $values = $field['input_value'] ? is_serialized($field['input_value']) ? unserialize($field['input_value']) : (array) $field['input_value'] : array();
     } else {
         $values = (array) preg_split("/\\n/", $field['options']['default_value']);
     }
     $options = preg_split("/\\n/", $field['options']['options']);
     $output = '<div class="mf-checkbox-list-box" >';
     foreach ($values as &$val) {
         $val = trim($val);
     }
     foreach ($options as $option) {
         $option = trim($option);
         $check = in_array($option, $values) ? 'checked="checked"' : '';
         $output .= sprintf('<label for="%s_%s" class="selectit mf-checkbox-list">', $field['input_id'], $option);
         $output .= sprintf('<input tabindex="3" class="checkbox_list_mf" id="%s_%s" name="%s[]" value="%s" type="checkbox" %s %s />', $field['input_id'], $option, $field['input_name'], $option, $check, $field['input_validate']);
         $output .= esc_attr($option);
         $output .= '</label>';
     }
     $output .= '</div>';
     return $output;
 }
开发者ID:GafaMX,项目名称:dev_funciones_basicas,代码行数:29,代码来源:checkbox_list_field.php


示例13: calibrefx_update_check

/**
 * This function calibrefx_update_check is to ...
 */
function calibrefx_update_check()
{
    global $wp_version;
    /** Get time of last update check */
    $calibrefx_update = get_transient('calibrefx-update');
    /** If it has expired, do an update check */
    if (!$calibrefx_update) {
        $url = 'http://api.calibrefx.com/themes-update/';
        $options = apply_filters('calibrefx_update_remote_post_options', array('body' => array('theme_name' => 'calibrefx', 'theme_version' => FRAMEWORK_VERSION, 'url' => home_url(), 'wp_version' => $wp_version, 'php_version' => phpversion(), 'user-agent' => "WordPress/{$wp_version};")));
        $response = wp_remote_post($url, $options);
        $calibrefx_update = wp_remote_retrieve_body($response);
        /** If an error occurred, return FALSE, store for 48 hour */
        if ('error' == $calibrefx_update || is_wp_error($calibrefx_update) || !is_serialized($calibrefx_update)) {
            set_transient('calibrefx-update', array('new_version' => FRAMEWORK_VERSION), 60 * 60 * 48);
            return false;
        }
        /** Else, unserialize */
        $calibrefx_update = maybe_unserialize($calibrefx_update);
        /** And store in transient for 48 hours */
        set_transient('calibrefx-update', $calibrefx_update, 60 * 60 * 48);
    }
    /** If we're already using the latest version, return false */
    if (version_compare(FRAMEWORK_VERSION, $calibrefx_update['new_version'], '>=')) {
        return false;
    }
    return $calibrefx_update;
}
开发者ID:alispx,项目名称:calibrefx,代码行数:30,代码来源:upgrade-hook.php


示例14: getValueAttribute

 /**
  * Unserialized variable to array.
  *
  * @param $education
  * @return string
  */
 public function getValueAttribute($value)
 {
     if (is_serialized($value)) {
         return unserialize($value);
     }
     return $value;
 }
开发者ID:Germey,项目名称:GermyGallery,代码行数:13,代码来源:Config.php


示例15: genesis_update_check

/**
 * This function pings an http://api.genesistheme.com/ asking if a new
 * version of this theme is available. If not, it returns FALSE.
 * If so, the external server passes serialized data back to this
 * function, which gets unserialized and returned for use.
 *
 * @since 1.1
 */
function genesis_update_check()
{
    global $wp_version;
    //	If updates are disabled
    if (!genesis_get_option('update') || !current_theme_supports('genesis-auto-updates')) {
        return FALSE;
    }
    $genesis_update = get_transient('genesis-update');
    if (!$genesis_update) {
        $url = 'http://api.genesistheme.com/update-themes/';
        $options = array('body' => array('genesis_version' => PARENT_THEME_VERSION, 'wp_version' => $wp_version, 'php_version' => phpversion(), 'uri' => home_url(), 'user-agent' => "WordPress/{$wp_version};"));
        $response = wp_remote_post($url, $options);
        $genesis_update = wp_remote_retrieve_body($response);
        // If an error occurred, return FALSE, store for 1 hour
        if ($genesis_update == 'error' || is_wp_error($genesis_update) || !is_serialized($genesis_update)) {
            set_transient('genesis-update', array('new_version' => PARENT_THEME_VERSION), 60 * 60);
            // store for 1 hour
            return FALSE;
        }
        // Else, unserialize
        $genesis_update = maybe_unserialize($genesis_update);
        // And store in transient
        set_transient('genesis-update', $genesis_update, 60 * 60 * 24);
        // store for 24 hours
    }
    // If we're already using the latest version, return FALSE
    if (version_compare(PARENT_THEME_VERSION, $genesis_update['new_version'], '>=')) {
        return FALSE;
    }
    return $genesis_update;
}
开发者ID:elderxavier,项目名称:ALLAN-JUNIOR-IAN,代码行数:39,代码来源:upgrade.php


示例16: pmxi_wp_ajax_auto_detect_sf

function pmxi_wp_ajax_auto_detect_sf()
{
    $input = new PMXI_Input();
    $fieldName = $input->post('name', '');
    $post_type = $input->post('post_type', 'post');
    global $wpdb;
    $result = array();
    if ($fieldName) {
        if ($post_type == 'import_users') {
            $values = $wpdb->get_results("\n\t\t\t\tSELECT DISTINCT usermeta.meta_value\n\t\t\t\tFROM " . $wpdb->usermeta . " as usermeta\n\t\t\t\tWHERE usermeta.meta_key='" . $fieldName . "'\n\t\t\t", ARRAY_A);
        } else {
            $values = $wpdb->get_results("\n\t\t\t\tSELECT DISTINCT postmeta.meta_value\n\t\t\t\tFROM " . $wpdb->postmeta . " as postmeta\n\t\t\t\tWHERE postmeta.meta_key='" . $fieldName . "'\n\t\t\t", ARRAY_A);
        }
        if (!empty($values)) {
            foreach ($values as $key => $value) {
                if (!empty($value['meta_value']) and is_serialized($value['meta_value'])) {
                    $v = unserialize($value['meta_value']);
                    if (!empty($v) and is_array($v)) {
                        foreach ($v as $skey => $svalue) {
                            $result[] = array('key' => $skey, 'val' => maybe_serialize($svalue));
                        }
                        break;
                    }
                }
            }
        }
    }
    exit(json_encode(array('result' => $result)));
}
开发者ID:rebeccayshen,项目名称:kitlist,代码行数:29,代码来源:wp_ajax_auto_detect_sf.php


示例17: dynamik_update_check

/**
 * Check to see if a new version of Catayst is available.
 *
 * @since 1.0
 * @return either response or transient.
 */
function dynamik_update_check()
{
    global $wp_version;
    // Debug Auto-Update.
    //delete_transient( 'dynamik-gen-update' );
    $dynamik_transient = get_transient('dynamik-gen-update');
    if ($dynamik_transient == false) {
        $api_url = 'http://api.cobaltapps.com/dynamik-update/';
        // Start checking for an update
        $send_for_check = array('body' => array('action' => 'theme_update', 'request' => array('slug' => 'dynamik-gen', 'version' => CHILD_THEME_VERSION)), 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url());
        $raw_response = wp_remote_post($api_url, $send_for_check);
        if (!is_wp_error($raw_response) && $raw_response['response']['code'] == 200 && is_serialized($raw_response['body'])) {
            $response = unserialize($raw_response['body']);
        } else {
            set_transient('dynamik-gen-update', array('new_version' => CHILD_THEME_VERSION), 60 * 60 * 24);
            // store for 24 hours
        }
        if (!empty($response)) {
            set_transient('dynamik-gen-update', $response, 60 * 60 * 24);
            // store for 24 hours
            return $response;
        }
    } else {
        return $dynamik_transient;
    }
}
开发者ID:kabrewer07,项目名称:mrw,代码行数:32,代码来源:dynamik-update.php


示例18: get

 public static function get($key, $group = false, $default = null)
 {
     $d = static::$driver;
     $hash = static::hash($key);
     $r = $d::get($hash, $group, $default);
     return is_serialized($r) ? unserialize($r) : $r;
 }
开发者ID:caffeinalab,项目名称:aeria,代码行数:7,代码来源:AeriaCache.php


示例19: maybe_unserialize

function maybe_unserialize($original)
{
    if (is_serialized($original)) {
        // don't attempt to unserialize data that wasn't serialized going in
        return @unserialize($original);
    }
    return $original;
}
开发者ID:AppItNetwork,项目名称:yii2-wordpress-themes,代码行数:8,代码来源:functions.php


示例20: sortable

 /**
  * Sanitize sortable controls
  *
  * @since 0.8.3
  *
  * @return mixed
  */
 public static function sortable($value)
 {
     if (is_serialized($value)) {
         return $value;
     } else {
         return serialize($value);
     }
 }
开发者ID:andrezrv,项目名称:kirki,代码行数:15,代码来源:class-kirki-sanitize-values.php



注:本文中的is_serialized函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_serialized_string函数代码示例发布时间:2022-05-15
下一篇:
PHP is_selected函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap