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

PHP icl_unregister_string函数代码示例

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

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



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

示例1: icl_register_admin_options

 function icl_register_admin_options($array, $key = "", $option = array())
 {
     foreach ($array as $k => $v) {
         if (is_array($v)) {
             array_push($option, $k);
             $this->icl_register_admin_options($v, $key . '[' . $k . ']', $option);
             array_pop($option);
         } else {
             $context = $this->get_context($key, $k);
             if ($v === '') {
                 icl_unregister_string($context, $key . $k);
             } else {
                 icl_register_string($context, $key . $k, $v);
                 $vals = array($k => 1);
                 if (count($option)) {
                     for ($i = count($option) - 1; $i >= 0; $i--) {
                         $vals = array($option[$i] => $vals);
                     }
                 }
                 $_icl_admin_option_names = get_option('_icl_admin_option_names');
                 $_icl_admin_option_names = array_merge_recursive((array) $_icl_admin_option_names, $vals);
                 update_option('_icl_admin_option_names', $_icl_admin_option_names);
             }
         }
     }
 }
开发者ID:edgarter,项目名称:wecare,代码行数:26,代码来源:wpml-admin-texts.class.php


示例2: icl_register_admin_options

 function icl_register_admin_options($array, $key = "", $option = array())
 {
     if (is_object($option)) {
         $option = object_to_array($option);
     }
     foreach ($array as $k => $v) {
         $option = $key === '' ? array($k => maybe_unserialize($this->get_option_without_filtering($k))) : $option;
         if (is_array($v)) {
             $this->icl_register_admin_options($v, $key . '[' . $k . ']', $option[$k]);
         } else {
             $context = $this->get_context($key, $k);
             if ($v === '') {
                 icl_unregister_string($context, $key . $k);
             } elseif (isset($option[$k]) && ($key === '' || preg_match_all('#\\[([^\\]]+)\\]#', (string) $key, $opt_key_matches) > 0)) {
                 icl_register_string($context, $key . $k, $option[$k]);
                 $vals = array($k => 1);
                 $opt_keys = isset($opt_key_matches) ? array_reverse($opt_key_matches[1]) : array();
                 foreach ($opt_keys as $opt) {
                     $vals = array($opt => $vals);
                 }
                 update_option('_icl_admin_option_names', array_merge_recursive((array) get_option('_icl_admin_option_names'), $vals));
             }
         }
     }
 }
开发者ID:Junaid-Farid,项目名称:gocnex,代码行数:25,代码来源:wpml-admin-texts.class.php


示例3: deregister_string

 /**
  * Unregister multilanguage string, Polylang missing support of this feature
  *
  * @since   1.0.0
  *
  * @param string $plugin_name_human_format The Plugin name.
  * @param string $string_name The name of the string.
  */
 function deregister_string($plugin_name_human_format, $string_name)
 {
     if (function_exists('icl_unregister_string')) {
         icl_unregister_string($plugin_name_human_format, $string_name);
     } elseif (has_filter('cml_my_translations')) {
         $plugin_name_human_format_replaced = str_replace(' ', '-', $plugin_name_human_format);
         CMLTranslations::delete($plugin_name_human_format_replaced);
     }
 }
开发者ID:wpbp,项目名称:language,代码行数:17,代码来源:language.php


示例4: unregister_petition

 /**
  * Deletes custom petition form strings that are registered with WPML
  *
  * @param int $id value of the petition's 'id' field in the database
  */
 public function unregister_petition($id)
 {
     if (function_exists('icl_unregister_string')) {
         $context = 'Petition ' . $id;
         icl_unregister_string($context, 'petition title');
         icl_unregister_string($context, 'email subject');
         icl_unregister_string($context, 'greeting');
         icl_unregister_string($context, 'petition message');
         icl_unregister_string($context, 'custom field label');
         icl_unregister_string($context, 'twitter message');
         icl_unregister_string($context, 'optin label');
     }
 }
开发者ID:jmontane,项目名称:speakup-email-petitions,代码行数:18,代码来源:class.wpml.php


示例5: pc_cat_wpml_del_name

function pc_cat_wpml_del_name($cat_id)
{
    if (function_exists('icl_unregister_string')) {
        icl_unregister_string('PrivateContent Categories', $cat_id);
    }
}
开发者ID:jfbelisle,项目名称:magexpress,代码行数:6,代码来源:user_categories.php


示例6: update_wpml_strings

 /**
  * WPML support: Update strings that need translation.
  *
  * @param array $old_menu The old custom menu, if any.
  * @param array $custom_menu The new custom menu.
  */
 private function update_wpml_strings($old_menu, $custom_menu)
 {
     if (!function_exists('icl_register_string')) {
         return;
     }
     $previous_strings = $this->get_wpml_strings($old_menu);
     $new_strings = $this->get_wpml_strings($custom_menu);
     //Delete strings that are no longer valid.
     if (function_exists('icl_unregister_string')) {
         $removed_strings = array_diff_key($previous_strings, $new_strings);
         foreach ($removed_strings as $name => $value) {
             icl_unregister_string(self::WPML_CONTEXT, $name);
         }
     }
     //Register/update the new menu strings.
     foreach ($new_strings as $name => $value) {
         icl_register_string(self::WPML_CONTEXT, $name, $value);
     }
 }
开发者ID:matthewepler,项目名称:moralcourage,代码行数:25,代码来源:menu-editor-core.php


示例7: languages_page


//.........这里部分代码省略.........
         case 'delete':
             check_admin_referer('delete-lang');
             if (!empty($_GET['lang'])) {
                 $this->model->delete_language((int) $_GET['lang']);
             }
             self::redirect();
             // to refresh the page ( possible thanks to the $_GET['noheader']=true )
             break;
         case 'edit':
             if (!empty($_GET['lang'])) {
                 $edit_lang = $this->model->get_language((int) $_GET['lang']);
             }
             break;
         case 'update':
             check_admin_referer('add-lang', '_wpnonce_add-lang');
             $error = $this->model->update_language($_POST);
             self::redirect();
             // to refresh the page ( possible thanks to the $_GET['noheader']=true )
             break;
         case 'default-lang':
             check_admin_referer('default-lang');
             if ($lang = $this->model->get_language((int) $_GET['lang'])) {
                 $this->model->update_default_lang($lang->slug);
             }
             self::redirect();
             // to refresh the page ( possible thanks to the $_GET['noheader']=true )
             break;
         case 'content-default-lang':
             check_admin_referer('content-default-lang');
             if ($nolang = $this->model->get_objects_with_no_lang()) {
                 if (!empty($nolang['posts'])) {
                     $this->model->set_language_in_mass('post', $nolang['posts'], $this->options['default_lang']);
                 }
                 if (!empty($nolang['terms'])) {
                     $this->model->set_language_in_mass('term', $nolang['terms'], $this->options['default_lang']);
                 }
             }
             self::redirect();
             // to refresh the page ( possible thanks to the $_GET['noheader']=true )
             break;
         case 'string-translation':
             if (!empty($_POST['submit'])) {
                 check_admin_referer('string-translation', '_wpnonce_string-translation');
                 $strings = PLL_Admin_Strings::get_strings();
                 foreach ($this->model->get_languages_list() as $language) {
                     if (empty($_POST['translation'][$language->slug])) {
                         // in case the language filter is active ( thanks to John P. Bloch )
                         continue;
                     }
                     $mo = new PLL_MO();
                     $mo->import_from_db($language);
                     foreach ($_POST['translation'][$language->slug] as $key => $translation) {
                         $translation = apply_filters('pll_sanitize_string_translation', $translation, $strings[$key]['name'], $strings[$key]['context']);
                         $mo->add_entry($mo->make_entry($strings[$key]['string'], $translation));
                     }
                     // clean database ( removes all strings which were registered some day but are no more )
                     if (!empty($_POST['clean'])) {
                         $new_mo = new PLL_MO();
                         foreach ($strings as $string) {
                             $new_mo->add_entry($mo->make_entry($string['string'], $mo->translate($string['string'])));
                         }
                     }
                     isset($new_mo) ? $new_mo->export_to_db($language) : $mo->export_to_db($language);
                 }
                 add_settings_error('general', 'pll_strings_translations_updated', __('Translations updated.', 'polylang'), 'updated');
                 do_action('pll_save_strings_translations');
             }
             // unregisters strings registered through WPML API
             if ($string_table->current_action() == 'delete' && !empty($_POST['strings']) && function_exists('icl_unregister_string')) {
                 check_admin_referer('string-translation', '_wpnonce_string-translation');
                 $strings = PLL_Admin_Strings::get_strings();
                 foreach ($_POST['strings'] as $key) {
                     icl_unregister_string($strings[$key]['context'], $strings[$key]['name']);
                 }
             }
             // to refresh the page ( possible thanks to the $_GET['noheader']=true )
             $args = array_intersect_key($_REQUEST, array_flip(array('s', 'paged', 'group')));
             if (!empty($args['s'])) {
                 $args['s'] = urlencode($args['s']);
                 // searched string needs to be encoded as it comes from $_POST
             }
             self::redirect($args);
             break;
         case 'activate':
             check_admin_referer('pll_activate');
             $this->modules[$_GET['module']]->activate();
             self::redirect();
             break;
         case 'deactivate':
             check_admin_referer('pll_deactivate');
             $this->modules[$_GET['module']]->deactivate();
             self::redirect();
             break;
         default:
             do_action("mlang_action_{$action}");
             break;
     }
     // displays the page
     include PLL_SETTINGS_INC . '/view-languages.php';
 }
开发者ID:britwayresources,项目名称:website,代码行数:101,代码来源:settings.php


示例8: get_theme_mod

            }
        }
    }
    /*Contact*/
    $parallax_one_contact_pl = get_theme_mod('parallax_one_contact_info_content');
    if (!empty($parallax_one_contact_pl)) {
        $parallax_one_contact_pl_decoded = json_decode($parallax_one_contact_pl);
        foreach ($parallax_one_contact_pl_decoded as $parallax_one_contact_box) {
            $text = $parallax_one_contact_box->text;
            $id = esc_attr($parallax_one_contact_box->id);
            if (!empty($id)) {
                if (!empty($text)) {
                    icl_unregister_string('Contact', $id . '_contact');
                    icl_register_string('Contact', $id . '_contact', $title);
                } else {
                    icl_unregister_string('Contact', $id . '_contact');
                }
            }
        }
    }
}
/*Check if Repeater is empty*/
function parallax_one_general_repeater_is_empty($parallax_one_arr)
{
    $parallax_one_services_decoded = json_decode($parallax_one_arr);
    foreach ($parallax_one_services_decoded as $parallax_box) {
        if (!empty($parallax_box->choice) && $parallax_box->choice == 'parallax_none') {
            $parallax_box->icon_value = '';
            $parallax_box->image_url = '';
        }
        foreach ($parallax_box as $key => $value) {
开发者ID:vanlight,项目名称:wp,代码行数:31,代码来源:functions.php


示例9: ot_wpml_unregister_string

/**
 * Helper function to unregister a WPML string
 *
 * @access    public
 * @since     2.1
 */
function ot_wpml_unregister_string($id)
{
    if (function_exists('icl_unregister_string')) {
        icl_unregister_string('Opções do Tema', $id);
    }
}
开发者ID:ericsoncardosoweb,项目名称:agatha-wp,代码行数:12,代码来源:ot-functions-admin.php


示例10: fp_rac_delete_email_template

 public static function fp_rac_delete_email_template()
 {
     if (isset($_POST['row_id'])) {
         global $wpdb;
         $row_id = $_POST['row_id'];
         $table_name_email = $wpdb->prefix . 'rac_templates_email';
         $wpdb->delete($table_name_email, array('id' => $row_id));
         //removing registered WPML strings
         if (function_exists('icl_unregister_string')) {
             icl_unregister_string('RAC', 'rac_template_' . $row_id . '_message');
             icl_unregister_string('RAC', 'rac_template_' . $row_id . '_subject');
         }
     }
     exit;
 }
开发者ID:bear12345678,项目名称:keylessoption,代码行数:15,代码来源:recoverabandoncart.php


示例11: tg_unregister_string_wpml

/**
 * Asks WPML to forget about $name
 * 
 * @param stirn $name
 */
function tg_unregister_string_wpml($name)
{
    if (function_exists('icl_unregister_string')) {
        icl_unregister_string('tag-groups', $name);
    }
}
开发者ID:booklein,项目名称:wpbookle,代码行数:11,代码来源:tag-groups.php


示例12: mg_options_wpml_sync

function mg_options_wpml_sync()
{
    if (!function_exists('icl_register_string')) {
        die('error');
    }
    require_once MG_DIR . '/functions.php';
    $already_saved = get_option('mg_wpml_synced_opts');
    $to_save = array();
    foreach (mg_main_types() as $type => $name) {
        $type_opts = get_option('mg_' . $type . '_opt');
        $typename = $type == 'img_gallery' ? 'Image Gallery' : ucfirst($type);
        if (is_array($type_opts) && count($type_opts) > 0) {
            foreach ($type_opts as $opt) {
                $index = $typename . ' Options - ' . $opt;
                $to_save[$index] = $index;
                icl_register_string('Media Grid - Item Options', $index, $opt);
                if (isset($already_saved[$index])) {
                    unset($already_saved[$index]);
                }
            }
        }
    }
    if (is_array($already_saved) && count($already_saved) > 0) {
        foreach ($already_saved as $opt) {
            icl_unregister_string('Media Grid - Item Options', $opt);
        }
    }
    if (!get_option('mg_wpml_synced_opts')) {
        add_option('mg_wpml_synced_opts', '255', '', 'yes');
    }
    update_option('mg_wpml_synced_opts', $to_save);
    die('success');
}
开发者ID:hurtzi,项目名称:Marino-Pardo-WEB-,代码行数:33,代码来源:ajax.php


示例13: foreach

$sql_signatures_table = "DROP TABLE {$db_signatures}";
$wpdb->query($sql_signatures_table);
// delete WPML strings
if (function_exists('icl_unregister_string')) {
    // delete petition strings in WPML
    foreach ($petitions as $petition) {
        $context = 'Petition ' . $petition->id;
        icl_unregister_string($context, 'petition title');
        icl_unregister_string($context, 'email subject');
        icl_unregister_string($context, 'greeting');
        icl_unregister_string($context, 'petition message');
        icl_unregister_string($context, 'custom field label');
        icl_unregister_string($context, 'twitter message');
        icl_unregister_string($context, 'optin label');
    }
    // delete widget strings in WPML
    foreach ($petitions as $petition) {
        $context = 'Petition ' . $petition->id;
        icl_unregister_string($context, 'widget title');
        icl_unregister_string($context, 'widget call to action');
    }
    // delete options strings in WPML
    icl_unregister_string('Petition', 'submit button text');
    icl_unregister_string('Petition', 'success message');
    icl_unregister_string('Petition', 'share message');
    icl_unregister_string('Petition', 'expiration message');
    icl_unregister_string('Petition', 'already signed message');
    icl_unregister_string('Petition', 'signaturelist title');
    icl_unregister_string('Petition', 'confirmation email subject');
    icl_unregister_string('Petition', 'confirmation email message');
}
开发者ID:jmontane,项目名称:speakup-email-petitions,代码行数:31,代码来源:uninstall.php


示例14: icl_register_admin_options

function icl_register_admin_options($array, $key = "")
{
    foreach ($array as $k => $v) {
        if (is_array($v)) {
            icl_register_admin_options($v, $key . '[' . $k . ']');
        } else {
            if ($v === '') {
                icl_unregister_string('admin_options_' . get_option('template'), $key . $k);
            } else {
                icl_register_string('admin_options_' . get_option('template'), $key . $k, $v);
            }
        }
    }
}
开发者ID:winyatasenjaya,项目名称:sitepress-multilingual-cms,代码行数:14,代码来源:functions-string-translation.php


示例15: languages_page


//.........这里部分代码省略.........
             if (!empty($_GET['lang'])) {
                 $edit_lang = $this->model->get_language((int) $_GET['lang']);
             }
             break;
         case 'update':
             check_admin_referer('add-lang', '_wpnonce_add-lang');
             $error = $this->model->update_language($_POST);
             wp_redirect('admin.php?page=mlang' . ($error ? '&error=' . $error : ''));
             // to refresh the page (possible thanks to the $_GET['noheader']=true)
             exit;
             break;
         case 'string-translation':
             if (!empty($_REQUEST['submit'])) {
                 check_admin_referer('string-translation', '_wpnonce_string-translation');
                 $strings = $this->get_strings();
                 foreach ($this->model->get_languages_list() as $language) {
                     if (empty($_POST['translation'][$language->name])) {
                         // in case the language filter is active (thanks to John P. Bloch)
                         continue;
                     }
                     $mo = new PLL_MO();
                     $mo->import_from_db($language);
                     foreach ($_POST['translation'][$language->name] as $key => $translation) {
                         $mo->add_entry($mo->make_entry($strings[$key]['string'], stripslashes($translation)));
                     }
                     // clean database (removes all strings which were registered some day but are no more)
                     if (!empty($_POST['clean'])) {
                         $new_mo = new PLL_MO();
                         foreach ($strings as $string) {
                             $new_mo->add_entry($mo->make_entry($string['string'], $mo->translate($string['string'])));
                         }
                     }
                     isset($new_mo) ? $new_mo->export_to_db($language) : $mo->export_to_db($language);
                 }
             }
             do_action('pll_save_strings_translations');
             // unregisters strings registered through WPML API
             if ($string_table->current_action() == 'delete' && !empty($_REQUEST['strings']) && function_exists('icl_unregister_string')) {
                 check_admin_referer('string-translation', '_wpnonce_string-translation');
                 $strings = $this->get_strings();
                 foreach ($_REQUEST['strings'] as $key) {
                     icl_unregister_string($strings[$key]['context'], $strings[$key]['name']);
                 }
             }
             // to refresh the page (possible thanks to the $_GET['noheader']=true)
             $url = 'admin.php?page=mlang&tab=strings';
             foreach (array('s', 'paged', 'group') as $qv) {
                 $url = empty($_REQUEST[$qv]) ? $url : $url . '&' . $qv . '=' . $_REQUEST[$qv];
             }
             wp_redirect($url);
             exit;
             break;
         case 'options':
             check_admin_referer('options-lang', '_wpnonce_options-lang');
             $this->options['default_lang'] = sanitize_title($_POST['default_lang']);
             // we have slug as value
             foreach (array('force_lang', 'rewrite') as $key) {
                 $this->options[$key] = isset($_POST[$key]) ? (int) $_POST[$key] : 0;
             }
             // FIXME : TODO error message if not a valid url
             if (3 == $this->options['force_lang'] && isset($_POST['domains']) && is_array($_POST['domains'])) {
                 foreach ($_POST['domains'] as $key => $domain) {
                     $this->options['domains'][$key] = esc_url_raw(trim($domain));
                 }
                 $this->options['domains'][$this->options['default_lang']] = get_option('home');
             }
             foreach (array('browser', 'hide_default', 'redirect_lang', 'media_support') as $key) {
                 $this->options[$key] = isset($_POST[$key]) ? 1 : 0;
             }
             if (3 == $this->options['force_lang']) {
                 $this->options['browser'] = $this->options['hide_default'] = 0;
             }
             foreach (array('sync', 'post_types', 'taxonomies') as $key) {
                 $this->options[$key] = empty($_POST[$key]) ? array() : array_keys($_POST[$key], 1);
             }
             update_option('polylang', $this->options);
             // refresh rewrite rules in case rewrite,  hide_default, post types or taxonomies options have been modified
             // it seems useless to refresh permastruct here
             flush_rewrite_rules();
             // refresh language cache in case home urls have been modified
             $this->model->clean_languages_cache();
             // fills existing posts & terms with default language
             if (isset($_POST['fill_languages']) && ($nolang = $this->model->get_objects_with_no_lang())) {
                 if (!empty($nolang['posts'])) {
                     $this->model->set_language_in_mass('post', $nolang['posts'], $this->options['default_lang']);
                 }
                 if (!empty($nolang['terms'])) {
                     $this->model->set_language_in_mass('term', $nolang['terms'], $this->options['default_lang']);
                 }
             }
             wp_redirect('admin.php?page=mlang&tab=settings&updated=true');
             // updated=true interpreted by WP
             exit;
             break;
         default:
             break;
     }
     // displays the page
     include PLL_ADMIN_INC . '/view-languages.php';
 }
开发者ID:kivivuori,项目名称:jotain,代码行数:101,代码来源:settings.php


示例16: foreach

            foreach ($shop_isle_advantages_pl_decoded as $shop_isle_advantages) {
                if (!empty($shop_isle_advantages->id)) {
                    $id = $shop_isle_advantages->id;
                }
                $icon_value = $shop_isle_advantages->icon_value;
                $text = $shop_isle_advantages->text;
                $subtext = $shop_isle_advantages->subtext;
                if (!empty($id)) {
                    if (!empty($icon_value)) {
                        icl_unregister_string('Advantage ' . $id, 'Advantage icon');
                        icl_register_string('Advantage ' . $id, 'Advantage icon', $icon_value);
                    } else {
                        icl_unregister_string('Advantage ' . $id, 'Advantage icon');
                    }
                    if (!empty($text)) {
                        icl_unregister_string('Advantage ' . $id, 'Advantage text');
                        icl_register_string('Advantage ' . $id, 'Advantage text', $text);
                    } else {
                        icl_unregister_string('Advantage ' . $id, 'Advantage text');
                    }
                    if (!empty($subtext)) {
                        icl_unregister_string('Advantage ' . $id, 'Advantage subtext');
                        icl_register_string('Advantage ' . $id, 'Advantage subtext', $subtext);
                    } else {
                        icl_unregister_string('Advantage ' . $id, 'Advantage subtext');
                    }
                }
            }
        }
    }
}
开发者ID:sucun21,项目名称:Ginseng,代码行数:31,代码来源:setup.php


示例17: foreach

        foreach ($llorix_one_lite_social_icons_pl_decoded as $llorix_one_header_social_box) {
            $icon = $llorix_one_header_social_box->icon_value;
            $link = $llorix_one_header_social_box->link;
            $id = $llorix_one_header_social_box->id;
            if (!empty($id)) {
                if (!empty($icon)) {
                    icl_unregister_string('Footer Social Icon', $id . '_footer_social_icon');
                    icl_register_string('Footer Social Icon', $id . '_footer_social_icon', $icon);
                } else {
                    icl_unregister_string('Footer Social Icon', $id . '_footer_social_icon');
                }
                if (!empty($link)) {
                    icl_unregister_string('Footer Social Link', $id . '_footer_social_link');
                    icl_register_string('Footer Social Link', $id . '_footer_social_link', $link);
                } else {
                    icl_unregister_string('Footer Social Link', $id . '_footer_social_link');
                }
            }
        }
    }
}
/*Check if Repeater is empty*/
function llorix_one_lite_general_repeater_is_empty($llorix_one_lite_arr)
{
    $llorix_one_lite_arr_decoded = json_decode($llorix_one_lite_arr);
    foreach ($llorix_one_lite_arr_decoded as $llorix_one_lite_box) {
        if (!empty($llorix_one_lite_box->choice) && $llorix_one_lite_box->choice == 'llorix_one_lite_none') {
            $llorix_one_lite_box->icon_value = '';
            $llorix_one_lite_box->image_url = '';
        }
        foreach ($llorix_one_lite_box as $key => $value) {
开发者ID:jenia-buianov,项目名称:all_my_sites,代码行数:31,代码来源:functions.php


示例18: icl_register_admin_options

function icl_register_admin_options($array, $key = "")
{
    foreach ($array as $k => $v) {
        if (is_array($v)) {
            icl_register_admin_options($v, $key . '[' . $k . ']');
        } else {
            if ($v === '') {
                icl_unregister_string('admin_texts_theme_' . get_option('template'), $key . $k);
            } else {
                icl_register_string('admin_texts_theme_' . get_option('template'), $key . $k, $v);
                $vals[$k] = 1;
                $_icl_admin_option_names = get_option('_icl_admin_option_names');
                if (!isset($_icl_admin_option_names['theme'])) {
                    $_icl_admin_option_names['theme'] = array();
                }
                $theme_used = get_option('template');
                if (!isset($_icl_admin_option_names['theme'][$theme_used])) {
                    $_icl_admin_option_names['theme'][$theme_used] = array();
                }
                $_icl_admin_option_names['theme'][get_option('template')] = array_merge_recursive((array) $_icl_admin_option_names['theme'][get_option('template')], $vals);
                $_icl_admin_option_names['theme'][get_option('template')] = __array_unique_recursive($_icl_admin_option_names['theme'][get_option('template')]);
                update_option('_icl_admin_option_names', $_icl_admin_option_names);
            }
        }
    }
}
开发者ID:StudioCreate,项目名称:Uncle-Hummer-WordPress-Theme,代码行数:26,代码来源:functions.php


示例19: pcud_fields_wpml_sync

function pcud_fields_wpml_sync($fdata)
{
    if (!function_exists('icl_register_string')) {
        return false;
    }
    $saved = (array) get_option('pcud_wpml_synced_fields', array());
    $to_save = array();
    foreach ($fdata['pcud_f_index'] as $key => $val) {
        $index = $val;
        $to_save[$index] = array('label');
        //// label
        // check if unregister before
        if (isset($saved[$index]) && isset($saved[$index]['label']) && $saved[$index]['label'] != $fdata['pcud_f_label'][$key]) {
            icl_unregister_string('PrivateContent User Data', 'Custom fields - ' . $index);
            // retrocompatibility
            icl_unregister_string('PrivateContent User Data', $index . ' - label');
        }
        $to_save[$index]['label'] = $fdata['pcud_f_label'][$key];
        icl_register_string('PrivateContent User Data', $index . ' - label', $fdata['pcud_f_label'][$key]);
        //// options
        // check if unregister before
        if (isset($saved[$index]) && isset($saved[$index]['opt']) && $saved[$index]['label'] != $fdata['pcud_f_options'][$key]) {
            icl_unregister_string('PrivateContent User Data', 'Custom fields opt - ' . $index);
            // retrocompatibility
            icl_unregister_string('PrivateContent User Data', $index . ' - options');
        }
        if (!empty($fdata['pcud_f_options'][$key])) {
            $to_save[$index]['opt'] = $fdata['pcud_f_options'][$key];
            icl_register_string('PrivateContent User Data', $index . ' - options', $fdata['pcud_f_options'][$key]);
        }
        //// placeholder
        // check if unregister before
        if (isset($saved[$index]) && isset($saved[$index]['placeh']) && $saved[$index]['placeh'] != $fdata['pcud_f_placeh'][$key]) {
            icl_unregister_string('PrivateContent User Data', 'Custom fields placeholder - ' . $index);
            // retrocompatibility
            icl_unregister_string('PrivateContent User Data', $index . ' - placeholder');
        }
        if (!empty($fdata[$key]['pcud_f_placeh'])) {
            $to_save[$index]['placeh'] = $fdata['pcud_f_placeh'][$key];
            icl_register_string('PrivateContent User Data', $index . ' - placeholder', $fdata['pcud_f_placeh'][$key]);
        }
        //// single checkbox text
        // check if unregister before
        if (isset($saved[$index]) && isset($saved[$index]['check_txt']) && $saved[$index]['check_txt'] != $fdata['pcud_f_check_txt'][$key]) {
            icl_unregister_string('PrivateContent User Data', $index . ' - checkbox text');
        }
        if (!empty($fdata[$key]['pcud_f_check_txt'])) {
            $to_save[$index]['check_txt'] = $fdata['pcud_f_check_txt'][$key];
            icl_register_string('PrivateContent User Data', $index . ' - checkbox text', $fdata['pcud_f_check_txt'][$key]);
        }
    }
    // save registered fields
    update_option('pcud_wpml_synced_fields', $to_save);
}
开发者ID:jfbelisle,项目名称:magexpress,代码行数:54,代码来源:functions.php


示例20: deleted_group_action

 public function deleted_group_action($group)
 {
     // Unregister name
     if (!empty($group->name)) {
         icl_unregister_string($this->_context, "{$this->_group_string_prefix}{$group->id} name", $group->name);
     }
     // Unregister description
     if (!empty($group->description)) {
         icl_unregister_string($this->_context, "{$this->_group_string_prefix}{$group->id} description", $group->description);
     }
 }
开发者ID:OnTheGoSystems,项目名称:buddypress-multilingual,代码行数:11,代码来源:class.xprofile.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP icl_update_string_status函数代码示例发布时间:2022-05-15
下一篇:
PHP icl_translate函数代码示例发布时间: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