當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WPSEO_Options::get_option_names方法代碼示例

本文整理匯總了PHP中WPSEO_Options::get_option_names方法的典型用法代碼示例。如果您正苦於以下問題:PHP WPSEO_Options::get_option_names方法的具體用法?PHP WPSEO_Options::get_option_names怎麽用?PHP WPSEO_Options::get_option_names使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WPSEO_Options的用法示例。


在下文中一共展示了WPSEO_Options::get_option_names方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: wpseo_translate_options

 public function wpseo_translate_options()
 {
     if (defined('WPSEO_VERSION') && !PLL_ADMIN && did_action('wp_loaded')) {
         global $wpseo_front;
         $options = version_compare(WPSEO_VERSION, '1.5', '<') ? get_wpseo_options_arr() : WPSEO_Options::get_option_names();
         foreach ($options as $opt) {
             $wpseo_front->options = array_merge($wpseo_front->options, (array) get_option($opt));
         }
     }
 }
開發者ID:MaryMaffka,項目名稱:dpm,代碼行數:10,代碼來源:plugins-compat.php

示例2: export_settings

 /**
  * Exports the current site's WP SEO settings.
  */
 private function export_settings()
 {
     $this->export_header();
     foreach (WPSEO_Options::get_option_names() as $opt_group) {
         $this->write_opt_group($opt_group);
     }
     $this->taxonomy_metadata();
     if (!$this->write_settings_file()) {
         $this->error = __('Could not write settings to file.', 'wordpress-seo');
         return;
     }
     if ($this->zip_file()) {
         // Just exit, because there is a download being served.
         exit;
     }
 }
開發者ID:jesusmarket,項目名稱:jesusmarket,代碼行數:19,代碼來源:class-export.php

示例3: export_settings

 /**
  * Exports the current site's WP SEO settings.
  *
  * @return boolean|string $return true when success, error when failed.
  */
 private function export_settings()
 {
     $this->export_header();
     foreach (WPSEO_Options::get_option_names() as $opt_group) {
         $this->write_opt_group($opt_group, $this->export);
     }
     $this->taxonomy_metadata();
     if ($this->write_file()) {
         if ($this->zip_file()) {
             return true;
         } else {
             $this->error = __('Could not zip settings-file.', 'wordpress-seo');
             return false;
         }
     }
     $this->error = __('Could not write settings to file.', 'wordpress-seo');
     return false;
 }
開發者ID:flasomm,項目名稱:Montkailash,代碼行數:23,代碼來源:class-export.php

示例4: get_wpseo_options_arr

/**
 * Retrieve an array of all the options the plugin uses. It can't use only one due to limitations of the options API.
 *
 * @deprecated 1.5.0
 * @deprecated use WPSEO_Options::get_option_names()
 * @see        WPSEO_Options::get_option_names()
 *
 * @return array of options.
 */
function get_wpseo_options_arr()
{
    _deprecated_function(__FUNCTION__, 'WPSEO 1.5.0', 'WPSEO_Options::get_option_names()');
    return WPSEO_Options::get_option_names();
}
開發者ID:presteege,項目名稱:presteege.fr,代碼行數:14,代碼來源:wpseo-functions.php

示例5: export_settings

 /**
  * Exports the current site's WP SEO settings.
  *
  * @param bool $include_taxonomy Whether to include the taxonomy metadata the plugin creates.
  *
  * @return bool|string $return False when failed, the URL to the export file when succeeded.
  */
 function export_settings($include_taxonomy)
 {
     $content = '; ' . __('This is a settings export file for the WordPress SEO plugin by Yoast.com', 'wordpress-seo') . " - https://yoast.com/wordpress/plugins/seo/ \r\n";
     $optarr = WPSEO_Options::get_option_names();
     foreach ($optarr as $optgroup) {
         $content .= "\n" . '[' . $optgroup . ']' . "\n";
         $options = get_option($optgroup);
         if (!is_array($options)) {
             continue;
         }
         foreach ($options as $key => $elem) {
             if (is_array($elem)) {
                 $elm_count = count($elem);
                 for ($i = 0; $i < $elm_count; $i++) {
                     $content .= $key . '[] = "' . $elem[$i] . "\"\n";
                 }
             } elseif (is_string($elem) && $elem == '') {
                 $content .= $key . " = \n";
             } elseif (is_bool($elem)) {
                 $content .= $key . ' = "' . ($elem === true ? 'on' : 'off') . "\"\n";
             } else {
                 $content .= $key . ' = "' . $elem . "\"\n";
             }
         }
     }
     if ($include_taxonomy) {
         $content .= "\r\n\r\n[wpseo_taxonomy_meta]\r\n";
         $content .= 'wpseo_taxonomy_meta = "' . urlencode(json_encode(get_option('wpseo_taxonomy_meta'))) . '"';
     }
     $dir = wp_upload_dir();
     if (!($handle = fopen($dir['path'] . '/settings.ini', 'w'))) {
         die;
     }
     if (!fwrite($handle, $content)) {
         die;
     }
     fclose($handle);
     chdir($dir['path']);
     $zip = new PclZip('./settings.zip');
     if ($zip->create('./settings.ini') == 0) {
         return false;
     }
     return $dir['url'] . '/settings.zip';
 }
開發者ID:johnreytepacia,項目名稱:etarticles,代碼行數:51,代碼來源:class-config.php

示例6: wpseo_init

 /**
  * Yoast SEO
  * Translate options and add specific filters and actions
  *
  * @since 1.6.4
  */
 public function wpseo_init()
 {
     if (!defined('WPSEO_VERSION') || PLL_ADMIN) {
         return;
     }
     // Reloads options once the language has been defined to enable translations
     // Useful only when the language is set from content
     if (did_action('wp_loaded')) {
         if (version_compare(WPSEO_VERSION, '1.7.2', '<')) {
             global $wpseo_front;
         } else {
             $wpseo_front = WPSEO_Frontend::get_instance();
         }
         $options = version_compare(WPSEO_VERSION, '1.5', '<') ? get_wpseo_options_arr() : WPSEO_Options::get_option_names();
         foreach ($options as $opt) {
             $wpseo_front->options = array_merge($wpseo_front->options, (array) get_option($opt));
         }
     }
     // One sitemap per language when using multiple domains or subdomains
     // because WPSEO does not accept several domains or subdomains in one sitemap
     if (PLL()->options['force_lang'] > 1) {
         add_filter('wpseo_enable_xml_sitemap_transient_caching', '__return_false');
         // disable cache! otherwise WPSEO keeps only one domain (thanks to Junaid Bhura)
         add_filter('home_url', array(&$this, 'wpseo_home_url'), 10, 2);
         // fix home_url
         add_filter('wpseo_posts_join', array(&$this, 'wpseo_posts_join'), 10, 2);
         add_filter('wpseo_posts_where', array(&$this, 'wpseo_posts_where'), 10, 2);
         add_filter('wpseo_typecount_join', array(&$this, 'wpseo_posts_join'), 10, 2);
         add_filter('wpseo_typecount_where', array(&$this, 'wpseo_posts_where'), 10, 2);
     } else {
         add_filter('get_terms_args', array(&$this, 'wpseo_remove_terms_filter'));
         // Add the homepages for all languages to the sitemap when the front page displays posts
         if (!get_option('page_on_front')) {
             add_filter('wpseo_sitemap_post_content', array(&$this, 'add_language_home_urls'));
         }
     }
     add_filter('pll_home_url_white_list', array(&$this, 'wpseo_home_url_white_list'));
     add_action('wpseo_opengraph', array(&$this, 'wpseo_ogp'), 2);
     add_filter('wpseo_canonical', array(&$this, 'wpseo_canonical'));
 }
開發者ID:spielhoelle,項目名稱:amnesty,代碼行數:46,代碼來源:plugins-compat.php

示例7: wpseo_init

 public function wpseo_init()
 {
     global $polylang;
     if (!defined('WPSEO_VERSION') || PLL_ADMIN) {
         return;
     }
     // reloads options once the language has been defined to enable translations
     // useful only when the language is set from content
     if (did_action('wp_loaded')) {
         if (version_compare(WPSEO_VERSION, '1.7.2', '<')) {
             global $wpseo_front;
         } else {
             $wpseo_front = WPSEO_Frontend::get_instance();
         }
         $options = version_compare(WPSEO_VERSION, '1.5', '<') ? get_wpseo_options_arr() : WPSEO_Options::get_option_names();
         foreach ($options as $opt) {
             $wpseo_front->options = array_merge($wpseo_front->options, (array) get_option($opt));
         }
     }
     // one sitemap per language when using multiple domains or subdomains
     // because WPSEO does not accept several domains or subdomains in one sitemap
     if ($polylang->options['force_lang'] > 1) {
         add_filter('wpseo_enable_xml_sitemap_transient_caching', '__return_false');
         // disable cache! otherwise WPSEO keeps only one domain
         add_filter('home_url', array(&$this, 'wpseo_home_url'), 10, 2);
         // fix home_url
         add_filter('wpseo_posts_join', array(&$this, 'wpseo_posts_join'), 10, 2);
         add_filter('wpseo_posts_where', array(&$this, 'wpseo_posts_where'), 10, 2);
         add_filter('wpseo_typecount_join', array(&$this, 'wpseo_posts_join'), 10, 2);
         add_filter('wpseo_typecount_where', array(&$this, 'wpseo_posts_where'), 10, 2);
     } else {
         add_filter('get_terms_args', array(&$this, 'wpseo_remove_terms_filter'));
     }
     add_filter('pll_home_url_white_list', create_function('$arr', "return array_merge(\$arr, array(array('file' => 'wordpress-seo')));"));
     add_action('wpseo_opengraph', array(&$this, 'wpseo_ogp'), 2);
 }
開發者ID:radabass,項目名稱:polylang,代碼行數:36,代碼來源:plugins-compat.php


注:本文中的WPSEO_Options::get_option_names方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。