本文整理汇总了PHP中hocwp_get_value_by_key函数的典型用法代码示例。如果您正苦于以下问题:PHP hocwp_get_value_by_key函数的具体用法?PHP hocwp_get_value_by_key怎么用?PHP hocwp_get_value_by_key使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hocwp_get_value_by_key函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
public function update($new_instance, $old_instance)
{
$instance = $old_instance;
$instance['title'] = strip_tags(hocwp_get_value_by_key($new_instance, 'title'));
$instance['category'] = hocwp_get_value_by_key($new_instance, 'category', json_encode($this->args['category']));
return $instance;
}
示例2: hocwp_force_admin_english
function hocwp_force_admin_english()
{
$args = hocwp_option_utilities();
$force_admin_english = (bool) hocwp_get_value_by_key($args, 'force_admin_english');
$force_admin_english = apply_filters('hocwp_force_admin_english', $force_admin_english);
return $force_admin_english;
}
示例3: update
public function update($new_instance, $old_instance)
{
$instance = $old_instance;
$instance['title'] = strip_tags(hocwp_get_value_by_key($new_instance, 'title'));
$instance['order'] = hocwp_get_value_by_key($new_instance, 'order', hocwp_get_value_by_key($this->args, 'order'));
$instance['description'] = hocwp_get_value_by_key($new_instance, 'description');
return $instance;
}
示例4: hocwp_option_theme_setting_defaults
function hocwp_option_theme_setting_defaults()
{
$alls = hocwp_option_defaults();
$defaults = hocwp_get_value_by_key($alls, 'theme_setting');
if (!hocwp_array_has_value($defaults)) {
$defaults = array('language' => 'vi');
}
return apply_filters('hocwp_option_theme_setting_defaults', $defaults);
}
示例5: hocwp_option_theme_custom_defaults
function hocwp_option_theme_custom_defaults()
{
$alls = hocwp_option_defaults();
$defaults = hocwp_get_value_by_key($alls, 'theme_custom');
if (!hocwp_array_has_value($defaults)) {
$defaults = array('background_lazyload' => 0);
}
return apply_filters('hocwp_option_theme_custom_defaults', $defaults);
}
示例6: update
public function update($new_instance, $old_instance)
{
$instance = $old_instance;
$instance['title'] = strip_tags(hocwp_get_value_by_key($new_instance, 'title'));
$instance['banner_image'] = hocwp_get_value_by_key($new_instance, 'banner_image');
$instance['banner_url'] = hocwp_get_value_by_key($new_instance, 'banner_url');
$instance['nofollow'] = hocwp_checkbox_post_data_value($new_instance, 'nofollow');
return $instance;
}
示例7: hocwp_option_optimize_defaults
function hocwp_option_optimize_defaults()
{
$alls = hocwp_option_defaults();
$defaults = hocwp_get_value_by_key($alls, 'optimize');
if (!hocwp_array_has_value($defaults)) {
$defaults = array('use_jquery_cdn' => 1, 'use_bootstrap_cdn' => 1, 'use_fontawesome_cdn' => 1, 'use_superfish_cdn' => 1);
}
return apply_filters('hocwp_option_optimize_defaults', $defaults);
}
示例8: hocwp_option_home_setting_defaults
function hocwp_option_home_setting_defaults()
{
$alls = hocwp_option_defaults();
$defaults = hocwp_get_value_by_key($alls, 'home_setting');
if (!hocwp_array_has_value($defaults)) {
$defaults = array('recent_posts' => 1, 'posts_per_page' => hocwp_get_posts_per_page(), 'pagination' => 1);
}
return apply_filters('hocwp_option_home_setting_defaults', $defaults);
}
示例9: hocwp_setup_enable_session
function hocwp_setup_enable_session()
{
$options = get_option('hocwp_user_login');
$use_captcha = hocwp_get_value_by_key($options, 'use_captcha');
$options = get_option('hocwp_discussion');
$comment_captcha = hocwp_get_value_by_key($options, 'captcha');
if ((bool) $use_captcha || (bool) $comment_captcha) {
add_filter('hocwp_use_session', '__return_true');
}
}
示例10: get_taxonomy_base
public function get_taxonomy_base($taxonomy = null)
{
if (empty($taxonomy)) {
$taxonomy = $this->taxonomy;
}
$base_slug = '';
if (taxonomy_exists($taxonomy)) {
$taxonomy = get_taxonomy($taxonomy);
$base_slug = hocwp_get_value_by_key($taxonomy->rewrite, 'slug');
}
return $base_slug;
}
示例11: hocwp_plugin_load_custom_css
function hocwp_plugin_load_custom_css()
{
$option = get_option('hocwp_plugin_custom_css');
$css = hocwp_get_value_by_key($option, 'code');
if (!empty($css)) {
$css = hocwp_minify_css($css);
$style = new HOCWP_HTML('style');
$style->set_attribute('type', 'text/css');
$style->set_text($css);
$style->output();
}
}
示例12: hocwp_plugin_upgrader_process_complete
function hocwp_plugin_upgrader_process_complete($upgrader, $options)
{
$plugins = hocwp_get_value_by_key($options, 'plugins');
if (!hocwp_array_has_value($plugins)) {
return;
}
foreach ($plugins as $plugin) {
$slug = hocwp_get_plugin_slug_from_file_path($plugin);
$transient_name = 'hocwp_plugins_api_' . $slug . '_plugin_information';
$transient_name = hocwp_sanitize_id($transient_name);
delete_transient($transient_name);
}
}
示例13: hocwp_theme_meta_box_sidebar_information
function hocwp_theme_meta_box_sidebar_information($post_type, $post)
{
if (!hocwp_is_post($post)) {
return;
}
global $pagenow;
if ('hocwp_sidebar' == $post_type) {
$readonly = false;
$post_id = 0;
if ('post.php' == $pagenow) {
$post_id = hocwp_get_value_by_key($_REQUEST, 'post');
$default = (bool) get_post_meta($post_id, 'sidebar_default');
if ($default) {
$readonly = true;
}
}
$post_id = $post->ID;
$meta = new HOCWP_Meta('post');
$meta->set_id('hocwp_sidebar_information');
$meta->set_title(__('Sidebar Information', 'hocwp-theme'));
$meta->add_post_type('hocwp_sidebar');
$field_args = array('id' => 'sidebar_id', 'label' => __('Sidebar ID:', 'hocwp-theme'));
if ($readonly) {
$field_args['readonly'] = true;
}
$meta->add_field($field_args);
$field_args = array('id' => 'sidebar_name', 'label' => __('Sidebar name:', 'hocwp-theme'));
if ($readonly) {
$field_args['readonly'] = true;
}
$meta->add_field($field_args);
$field_args = array('id' => 'sidebar_description', 'label' => __('Sidebar description:', 'hocwp-theme'));
if ($readonly) {
$field_args['readonly'] = true;
}
$meta->add_field($field_args);
$field_args = array('id' => 'sidebar_tag', 'label' => __('Sidebar tag:', 'hocwp-theme'));
if ($readonly) {
$field_args['readonly'] = true;
}
$meta->add_field($field_args);
$meta->init();
}
}
示例14: hocwp_register_string_language
function hocwp_register_string_language($args = array())
{
if (!did_action('init')) {
_doing_it_wrong(__FUNCTION__, __('Please call this function in <strong>hocwp_register_string_translation</strong> hook.', 'hocwp-theme'), HOCWP_VERSION);
return;
}
if (!is_array($args)) {
$args = array('string' => $args);
}
$name = hocwp_get_value_by_key($args, 'name');
$string = hocwp_get_value_by_key($args, 'string');
$context = hocwp_get_value_by_key($args, 'context', 'HocWP');
$multiline = hocwp_get_value_by_key($args, 'multiline');
$key = md5($string);
$active_strings = hocwp_get_active_registered_string_language();
$active_strings[$key]['name'] = $name;
$active_strings[$key]['string'] = $string;
$active_strings[$key]['context'] = $context;
$active_strings[$key]['multiline'] = $multiline;
global $hocwp_active_registered_string_translations;
$hocwp_active_registered_string_translations = $active_strings;
$transient_name = hocwp_build_transient_name('hocwp_string_translation_registered_%s', $args);
if (false === get_transient($transient_name)) {
$strings = hocwp_get_registered_string_language();
$strings[$key]['name'] = $name;
$strings[$key]['string'] = $string;
$strings[$key]['context'] = $context;
$strings[$key]['multiline'] = $multiline;
update_option('hocwp_string_translations', $strings);
$mo = new HOCWP_MO();
$translation = '';
$object = $mo->get_object($string);
if (is_a($object, 'WP_Post')) {
$translation = $object->post_content;
}
$post_id = $mo->export_to_db($string, $translation);
if (hocwp_id_number_valid($post_id)) {
set_transient($transient_name, $post_id, WEEK_IN_SECONDS);
}
}
}
示例15: hocwp_get_mailer
function hocwp_get_mailer()
{
$data = hocwp_get_smtp_mail_data();
$mailer = hocwp_get_value_by_key($data, 'mailer');
return apply_filters('hocwp_mailer', $mailer);
}