本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}