当前位置: 首页>>代码示例>>PHP>>正文


PHP All_in_One_SEO_Pack_Module::get_current_options方法代码示例

本文整理汇总了PHP中All_in_One_SEO_Pack_Module::get_current_options方法的典型用法代码示例。如果您正苦于以下问题:PHP All_in_One_SEO_Pack_Module::get_current_options方法的具体用法?PHP All_in_One_SEO_Pack_Module::get_current_options怎么用?PHP All_in_One_SEO_Pack_Module::get_current_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在All_in_One_SEO_Pack_Module的用法示例。


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

示例1: array

 /**
  * @param array $opts
  * @param null $location
  * @param null $defaults
  * @param null $post
  *
  * @return array
  */
 function get_current_options($opts = array(), $location = null, $defaults = null, $post = null)
 {
     if ('aiosp' === $location && 'metabox' == $this->locations[$location]['type']) {
         if (null === $post) {
             global $post;
         }
         $post_id = $post;
         if (is_object($post_id)) {
             $post_id = $post_id->ID;
         }
         $get_opts = $this->default_options($location);
         $optlist = array('keywords', 'description', 'title', 'custom_link', 'sitemap_exclude', 'disable', 'disable_analytics', 'noindex', 'nofollow', 'noodp', 'noydir', 'titleatr', 'menulabel');
         if (!!empty($this->options['aiosp_can']) && !empty($this->options['aiosp_customize_canonical_links'])) {
             unset($optlist['custom_link']);
         }
         foreach ($optlist as $f) {
             $meta = '';
             $field = "aiosp_{$f}";
             if (AIOSEOPPRO) {
                 if (isset($_GET['taxonomy']) && isset($_GET['tag_ID']) || is_category() || is_tag() || is_tax()) {
                     if (is_admin() && isset($_GET['tag_ID'])) {
                         $meta = get_term_meta($_GET['tag_ID'], '_aioseop_' . $f, true);
                     } else {
                         $queried_object = get_queried_object();
                         if (!empty($queried_object) && !empty($queried_object->term_id)) {
                             $meta = get_term_meta($queried_object->term_id, '_aioseop_' . $f, true);
                         }
                     }
                 } else {
                     $meta = get_post_meta($post_id, '_aioseop_' . $f, true);
                 }
                 if ('title' === $f || 'description' === $f) {
                     $get_opts[$field] = htmlspecialchars($meta);
                 } else {
                     $get_opts[$field] = htmlspecialchars(stripslashes($meta));
                 }
             } else {
                 $field = "aiosp_{$f}";
                 $meta = get_post_meta($post_id, '_aioseop_' . $f, true);
                 if ('title' === $f || 'description' === $f) {
                     $get_opts[$field] = htmlspecialchars($meta);
                 } else {
                     $get_opts[$field] = htmlspecialchars(stripslashes($meta));
                 }
             }
         }
         $opts = wp_parse_args($opts, $get_opts);
         return $opts;
     } else {
         $options = parent::get_current_options($opts, $location, $defaults);
         return $options;
     }
 }
开发者ID:recetasdemama,项目名称:wordpress,代码行数:61,代码来源:aioseop_class.php

示例2: array

 function get_current_options($opts = array(), $location = null, $defaults = null, $post = null)
 {
     if ($location === 'aiosp' && $this->locations[$location]['type'] == 'metabox') {
         if ($post == null) {
             global $post;
         }
         $post_id = $post;
         if (is_object($post_id)) {
             $post_id = $post_id->ID;
         }
         $get_opts = $this->default_options($location);
         foreach (array('keywords', 'description', 'title', 'sitemap_exclude', 'disable', 'disable_analytics', 'noindex', 'nofollow', 'noodp', 'noydir', 'titleatr', 'menulabel') as $f) {
             $field = "aiosp_{$f}";
             $get_opts[$field] = htmlspecialchars(stripslashes(get_post_meta($post_id, '_aioseop_' . $f, true)));
         }
         $opts = wp_parse_args($opts, $get_opts);
         return $opts;
     } else {
         $options = parent::get_current_options($opts, $location, $defaults);
         return $options;
     }
 }
开发者ID:mahassan,项目名称:shellneverknow,代码行数:22,代码来源:aioseop_class.php

示例3: array

 function get_current_options($opts = array(), $location = null, $defaults = null, $post = null)
 {
     if ($location === 'aiosp' && $this->locations[$location]['type'] == 'metabox') {
         if ($post == null) {
             global $post;
         }
         $post_id = $post;
         if (is_object($post_id)) {
             $post_id = $post_id->ID;
         }
         $get_opts = $this->default_options($location);
         foreach (array('keywords', 'description', 'title', 'sitemap_exclude', 'disable', 'disable_analytics', 'noindex', 'nofollow', 'noodp', 'noydir', 'titleatr', 'menulabel') as $f) {
             $field = "aiosp_{$f}";
             if (isset($_GET['taxonomy']) && isset($_GET['tag_ID']) || is_category() || is_tag() || is_tax()) {
                 if (is_admin() && isset($_GET['tag_ID'])) {
                     $meta = get_term_meta($_GET['tag_ID'], '_aioseop_' . $f, true);
                 } else {
                     $queried_object = get_queried_object();
                     if (!empty($queried_object) && !empty($queried_object->term_id)) {
                         $meta = get_term_meta($queried_object->term_id, '_aioseop_' . $f, true);
                     }
                 }
             } else {
                 $meta = get_post_meta($post_id, '_aioseop_' . $f, true);
             }
             $get_opts[$field] = htmlspecialchars(stripslashes($meta));
         }
         $opts = wp_parse_args($opts, $get_opts);
         return $opts;
     } else {
         $options = parent::get_current_options($opts, $location, $defaults);
         return $options;
     }
 }
开发者ID:netfor,项目名称:nextrading,代码行数:34,代码来源:aioseop_class.php


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