本文整理汇总了PHP中WPSEO_Meta类的典型用法代码示例。如果您正苦于以下问题:PHP WPSEO_Meta类的具体用法?PHP WPSEO_Meta怎么用?PHP WPSEO_Meta使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WPSEO_Meta类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upgrade_15
/**
* Run the Yoast SEO 1.5 upgrade routine
*
* @param string $version Current plugin version.
*/
private function upgrade_15($version)
{
// Clean up options and meta.
WPSEO_Options::clean_up(null, $version);
WPSEO_Meta::clean_up();
// Add new capabilities on upgrade.
wpseo_add_capabilities();
}
示例2: has_video
/**
* Helper function to check if the metabox functionality should be loaded
*
* @return bool
*/
public function has_video()
{
if (isset($GLOBALS['post']->ID)) {
$video = WPSEO_Meta::get_value('video_meta', $GLOBALS['post']->ID);
if (is_array($video) && $video !== array()) {
return true;
}
}
return false;
}
示例3: import_post_robot
/**
* Getting the wpSEO robot value and map this to Yoast SEO values.
*
* @param integer $post_id The post id of the current post.
*/
private function import_post_robot($post_id)
{
$wpseo_robots = get_post_meta($post_id, '_wpseo_edit_robots', true);
// Does the value exists in our mapping.
if ($robot_value = $this->get_robot_value($wpseo_robots)) {
// Saving the new meta values for Yoast SEO.
WPSEO_Meta::set_value($robot_value['index'], 'meta-robots-noindex', $post_id);
WPSEO_Meta::set_value($robot_value['follow'], 'meta-robots-nofollow', $post_id);
}
$this->delete_post_robot($post_id);
}
示例4: description
/**
* Output the Google+ specific description
*/
public function description()
{
if (is_singular()) {
$desc = WPSEO_Meta::get_value('google-plus-description');
/**
* Filter: 'wpseo_googleplus_desc' - Allow developers to change the Google+ specific description output
*
* @api string $desc The description string
*/
$desc = apply_filters('wpseo_googleplus_desc', $desc);
if (is_string($desc) && '' !== $desc) {
echo '<meta itemprop="description" content="' . $desc . '">' . "\n";
}
}
}
示例5: italystrap_open_graph_desc
/**
* Display post description for Open Graph and Twitter card
*
* @return string A description text of post
*
* @todo Sanitize $excerpt http://codex.wordpress.org/Function_Reference/sanitize_text_field
*/
function italystrap_open_graph_desc()
{
global $post;
if (function_exists('aioseop_load_modules')) {
$excerpt = get_post_meta($post->ID, '_aioseop_description', true);
} else {
if (class_exists('WPSEO_Meta')) {
$excerpt = WPSEO_Meta::get_value('metadesc');
} else {
if ($post->post_excerpt) {
$excerpt = trim(str_replace(array("\n", "\r", "\t"), ' ', substr(strip_tags($post->post_excerpt), 0, 200)));
} else {
$excerpt = trim(str_replace(array("\n", "\r", "\t", "[", "]", "\""), ' ', substr(strip_tags($post->post_content), 0, 200))) . ' ...';
}
}
}
echo $excerpt;
}
示例6: test_description
/**
* @covers WPSEO_GooglePlus::description
*/
public function test_description()
{
self::$class_instance->description();
$this->expectOutput('');
// create and go to post
$post_id = $this->factory->post->create();
$this->go_to(get_permalink($post_id));
// should be empty, didn't set google-plus-description
self::$class_instance->description();
$this->expectOutput('');
// set meta
$description = 'Google description';
WPSEO_Meta::set_value('google-plus-description', $description, $post_id);
// test output
$expected = '<meta itemprop="description" content="' . $description . '">' . "\n";
self::$class_instance->description();
$this->expectOutput($expected);
}
示例7: status_transition
/**
* Hooked into transition_post_status. Will initiate search engine pings
* if the post is being published, is a post type that a sitemap is built for
* and is a post that is included in sitemaps.
*/
function status_transition($new_status, $old_status, $post)
{
if ($new_status != 'publish') {
return;
}
wp_cache_delete('lastpostmodified:gmt:' . $post->post_type, 'timeinfo');
// #17455
$options = WPSEO_Options::get_all();
if (isset($options['post_types-' . $post->post_type . '-not_in_sitemap']) && $options['post_types-' . $post->post_type . '-not_in_sitemap'] === true) {
return;
}
if (WP_CACHE) {
wp_schedule_single_event(time() + 300, 'wpseo_hit_sitemap_index');
}
// Allow the pinging to happen slightly after the hit sitemap index so the sitemap is fully regenerated when the ping happens.
if (WPSEO_Meta::get_value('sitemap-include', $post->ID) !== 'never') {
if (defined('YOAST_SEO_PING_IMMEDIATELY') && YOAST_SEO_PING_IMMEDIATELY) {
wpseo_ping_search_engines();
} else {
wp_schedule_single_event(time() + 300, 'wpseo_ping_search_engines');
}
}
}
示例8: get_opengraph_image
/**
* If opengraph-image is set, call add_image and return true
*
* @return bool
*/
private function get_opengraph_image()
{
$ogimg = WPSEO_Meta::get_value('opengraph-image');
if ($ogimg !== '') {
$this->add_image($ogimg);
return true;
}
}
示例9: foreach
$posts = $wpdb->get_results("SELECT ID, robotsmeta FROM {$wpdb->posts}");
if (is_array($posts) && $posts !== array()) {
foreach ($posts as $post) {
// sync all possible settings
if ($post->robotsmeta) {
$pieces = explode(',', $post->robotsmeta);
foreach ($pieces as $meta) {
switch ($meta) {
case 'noindex':
WPSEO_Meta::set_value('meta-robots-noindex', '1', $post->ID);
break;
case 'index':
WPSEO_Meta::set_value('meta-robots-noindex', '2', $post->ID);
break;
case 'nofollow':
WPSEO_Meta::set_value('meta-robots-nofollow', '1', $post->ID);
break;
}
}
}
}
}
unset($posts, $post, $pieces, $meta);
$msg .= __(sprintf('Robots Meta values imported. We recommend %sdisabling the Robots-Meta plugin%s to avoid any conflicts.', '<a href="' . esc_url(admin_url('admin.php?page=wpseo_import&deactivate_robots_meta=1')) . '">', '</a>'), 'wordpress-seo');
}
if (isset($_POST['wpseo']['importrssfooter'])) {
$optold = get_option('RSSFooterOptions');
$optnew = get_option('wpseo_rss');
if ($optold['position'] == 'after') {
if ($optnew['rssafter'] === '' || $optnew['rssafter'] === WPSEO_Options::get_default('wpseo_rss', 'rssafter')) {
$optnew['rssafter'] = $optold['footerstring'];
示例10: get_link_info_for_id
/**
* Retrieve link url and text based on post id
*
* @param int $id Post id
*
* @return array $link Array of link text and url
*/
private function get_link_info_for_id($id)
{
$link = array();
$link['url'] = get_permalink($id);
$link['text'] = WPSEO_Meta::get_value('bctitle', $id);
if ($link['text'] === '') {
$link['text'] = strip_tags(get_the_title($id));
}
/**
* Filter: 'wp_seo_get_bc_title' - Allow developer to filter the WP SEO Breadcrumb title.
*
* @api string $link_text The Breadcrumb title text
*
* @param int $link_id The post ID
*/
$link['text'] = apply_filters('wp_seo_get_bc_title', $link['text'], $id);
return $link;
}
示例11: wpseo_admin_bar_menu
/**
* Adds an SEO admin bar menu with several options. If the current user is an admin he can also go straight to several settings menu's from here.
*/
function wpseo_admin_bar_menu()
{
// If the current user can't write posts, this is all of no use, so let's not output an admin menu.
if (!current_user_can('edit_posts')) {
return;
}
global $wp_admin_bar, $post;
$focuskw = '';
$score = '';
$seo_url = get_admin_url(null, 'admin.php?page=wpseo_dashboard');
if ((is_singular() || is_admin() && in_array($GLOBALS['pagenow'], array('post.php', 'post-new.php'), true)) && isset($post) && is_object($post) && apply_filters('wpseo_use_page_analysis', true) === true) {
$focuskw = WPSEO_Meta::get_value('focuskw', $post->ID);
$perc_score = WPSEO_Meta::get_value('linkdex', $post->ID);
$txtscore = WPSEO_Utils::translate_score($perc_score);
$title = WPSEO_Utils::translate_score($perc_score, false);
$score = '<div title="' . esc_attr($title) . '" class="' . esc_attr('wpseo-score-icon ' . $txtscore . ' ' . $perc_score) . ' adminbar-seo-score' . '"></div>';
$seo_url = get_edit_post_link($post->ID);
}
$wp_admin_bar->add_menu(array('id' => 'wpseo-menu', 'title' => __('SEO', 'wordpress-seo') . $score, 'href' => $seo_url));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-menu', 'id' => 'wpseo-kwresearch', 'title' => __('Keyword Research', 'wordpress-seo'), '#'));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-kwresearch', 'id' => 'wpseo-adwordsexternal', 'title' => __('AdWords External', 'wordpress-seo'), 'href' => 'http://adwords.google.com/keywordplanner', 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-kwresearch', 'id' => 'wpseo-googleinsights', 'title' => __('Google Insights', 'wordpress-seo'), 'href' => 'http://www.google.com/insights/search/#q=' . urlencode($focuskw) . '&cmpt=q', 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-kwresearch', 'id' => 'wpseo-wordtracker', 'title' => __('SEO Book', 'wordpress-seo'), 'href' => 'http://tools.seobook.com/keyword-tools/seobook/?keyword=' . urlencode($focuskw), 'meta' => array('target' => '_blank')));
if (!is_admin()) {
$url = WPSEO_Frontend::get_instance()->canonical(false);
if (is_string($url)) {
$wp_admin_bar->add_menu(array('parent' => 'wpseo-menu', 'id' => 'wpseo-analysis', 'title' => __('Analyze this page', 'wordpress-seo'), '#'));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-inlinks-ose', 'title' => __('Check Inlinks (OSE)', 'wordpress-seo'), 'href' => '//moz.com/researchtools/ose/links?site=' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-kwdensity', 'title' => __('Check Keyword Density', 'wordpress-seo'), 'href' => '//www.zippy.co.uk/keyworddensity/index.php?url=' . urlencode($url) . '&keyword=' . urlencode($focuskw), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-cache', 'title' => __('Check Google Cache', 'wordpress-seo'), 'href' => '//webcache.googleusercontent.com/search?strip=1&q=cache:' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-header', 'title' => __('Check Headers', 'wordpress-seo'), 'href' => '//quixapp.com/headers/?r=' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-richsnippets', 'title' => __('Check Rich Snippets', 'wordpress-seo'), 'href' => '//www.google.com/webmasters/tools/richsnippets?q=' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-facebookdebug', 'title' => __('Facebook Debugger', 'wordpress-seo'), 'href' => '//developers.facebook.com/tools/debug/og/object?q=' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-pinterestvalidator', 'title' => __('Pinterest Rich Pins Validator', 'wordpress-seo'), 'href' => '//developers.pinterest.com/rich_pins/validator/?link=' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-htmlvalidation', 'title' => __('HTML Validator', 'wordpress-seo'), 'href' => '//validator.w3.org/check?uri=' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-cssvalidation', 'title' => __('CSS Validator', 'wordpress-seo'), 'href' => '//jigsaw.w3.org/css-validator/validator?uri=' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-pagespeed', 'title' => __('Google Page Speed Test', 'wordpress-seo'), 'href' => '//developers.google.com/speed/pagespeed/insights/?url=' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-modernie', 'title' => __('Modern IE Site Scan', 'wordpress-seo'), 'href' => '//www.modern.ie/en-us/report#' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-google-mobile-friendly', 'title' => __('Mobile-Friendly Test', 'wordpress-seo'), 'href' => 'https://www.google.com/webmasters/tools/mobile-friendly/?url=' . urlencode($url), 'meta' => array('target' => '_blank')));
}
}
$admin_menu = current_user_can('manage_options');
if (!$admin_menu && is_multisite()) {
$options = get_site_option('wpseo_ms');
$admin_menu = $options['access'] === 'superadmin' && is_super_admin();
}
// @todo: add links to bulk title and bulk description edit pages.
if ($admin_menu) {
$wp_admin_bar->add_menu(array('parent' => 'wpseo-menu', 'id' => 'wpseo-settings', 'title' => __('SEO Settings', 'wordpress-seo')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-general', 'title' => __('General', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_dashboard')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-titles', 'title' => __('Titles & Metas', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_titles')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-social', 'title' => __('Social', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_social')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-xml', 'title' => __('XML Sitemaps', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_xml')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-wpseo-advanced', 'title' => __('Advanced', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_advanced')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-tools', 'title' => __('Tools', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_tools')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-search-console', 'title' => __('Search Console', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_search_console')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-licenses', 'title' => '<span style="color:#f18500">' . __('Extensions', 'wordpress-seo') . '</span>', 'href' => admin_url('admin.php?page=wpseo_licenses')));
}
}
示例12: wpseo_admin_bar_menu
/**
* Adds an SEO admin bar menu with several options. If the current user is an admin he can also go straight to several settings menu's from here.
*/
function wpseo_admin_bar_menu()
{
// If the current user can't write posts, this is all of no use, so let's not output an admin menu
if (!current_user_can('edit_posts')) {
return;
}
global $wp_admin_bar, $post;
$url = WPSEO_Frontend::get_instance()->canonical(false);
$focuskw = '';
$score = '';
$seo_url = get_admin_url(null, 'admin.php?page=wpseo_dashboard');
if ((is_singular() || is_admin() && in_array($GLOBALS['pagenow'], array('post.php', 'post-new.php'), true)) && isset($post) && is_object($post) && apply_filters('wpseo_use_page_analysis', true) === true) {
$focuskw = WPSEO_Meta::get_value('focuskw', $post->ID);
$perc_score = WPSEO_Meta::get_value('linkdex', $post->ID);
$calc_score = WPSEO_Utils::calc($perc_score, '/', 10, true);
$txtscore = WPSEO_Utils::translate_score($calc_score);
$title = WPSEO_Utils::translate_score($calc_score, false);
$score = '<div title="' . esc_attr($title) . '" class="' . esc_attr('wpseo-score-icon ' . $txtscore . ' ' . $perc_score) . '"></div>';
$seo_url = get_edit_post_link($post->ID);
if ($txtscore !== 'na') {
$seo_url .= '#wpseo_linkdex';
}
}
$wp_admin_bar->add_menu(array('id' => 'wpseo-menu', 'title' => __('SEO', 'wordpress-seo') . $score, 'href' => $seo_url));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-menu', 'id' => 'wpseo-kwresearch', 'title' => __('Keyword Research', 'wordpress-seo'), '#'));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-kwresearch', 'id' => 'wpseo-adwordsexternal', 'title' => __('AdWords External', 'wordpress-seo'), 'href' => 'http://adwords.google.com/keywordplanner', 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-kwresearch', 'id' => 'wpseo-googleinsights', 'title' => __('Google Insights', 'wordpress-seo'), 'href' => 'http://www.google.com/insights/search/#q=' . urlencode($focuskw) . '&cmpt=q', 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-kwresearch', 'id' => 'wpseo-wordtracker', 'title' => __('SEO Book', 'wordpress-seo'), 'href' => 'http://tools.seobook.com/keyword-tools/seobook/?keyword=' . urlencode($focuskw), 'meta' => array('target' => '_blank')));
if (!is_admin()) {
$wp_admin_bar->add_menu(array('parent' => 'wpseo-menu', 'id' => 'wpseo-analysis', 'title' => __('Analyze this page', 'wordpress-seo'), '#'));
if (is_string($url)) {
// @todo [JRF => whomever] check if this url shouldn't be encoded either with urlencode or with esc_url or something
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-inlinks-ose', 'title' => __('Check Inlinks (OSE)', 'wordpress-seo'), 'href' => '//moz.com/researchtools/ose/links?site=' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-kwdensity', 'title' => __('Check Keyword Density', 'wordpress-seo'), 'href' => '//www.zippy.co.uk/keyworddensity/index.php?url=' . urlencode($url) . '&keyword=' . urlencode($focuskw), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-cache', 'title' => __('Check Google Cache', 'wordpress-seo'), 'href' => '//webcache.googleusercontent.com/search?strip=1&q=cache:' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-header', 'title' => __('Check Headers', 'wordpress-seo'), 'href' => '//quixapp.com/headers/?r=' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-richsnippets', 'title' => __('Check Rich Snippets', 'wordpress-seo'), 'href' => '//www.google.com/webmasters/tools/richsnippets?q=' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-facebookdebug', 'title' => __('Facebook Debugger', 'wordpress-seo'), 'href' => '//developers.facebook.com/tools/debug/og/object?q=' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-pinterestvalidator', 'title' => __('Pinterest Rich Pins Validator', 'wordpress-seo'), 'href' => '//developers.pinterest.com/rich_pins/validator/?link=' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-htmlvalidation', 'title' => __('HTML Validator', 'wordpress-seo'), 'href' => '//validator.w3.org/check?uri=' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-cssvalidation', 'title' => __('CSS Validator', 'wordpress-seo'), 'href' => '//jigsaw.w3.org/css-validator/validator?uri=' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-pagespeed', 'title' => __('Google Page Speed Test', 'wordpress-seo'), 'href' => '//developers.google.com/speed/pagespeed/insights/?url=' . urlencode($url), 'meta' => array('target' => '_blank')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-analysis', 'id' => 'wpseo-modernie', 'title' => __('Modern IE Site Scan', 'wordpress-seo'), 'href' => '//www.modern.ie/en-us/report#' . urlencode($url), 'meta' => array('target' => '_blank')));
}
}
$admin_menu = false;
if (is_multisite()) {
$options = get_site_option('wpseo_ms');
if ($options['access'] === 'superadmin' && is_super_admin()) {
$admin_menu = true;
} elseif (current_user_can('manage_options')) {
$admin_menu = true;
}
} elseif (current_user_can('manage_options')) {
$admin_menu = true;
}
// @todo: add links to bulk title and bulk description edit pages
if ($admin_menu) {
$wp_admin_bar->add_menu(array('parent' => 'wpseo-menu', 'id' => 'wpseo-settings', 'title' => __('SEO Settings', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_titles')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-titles', 'title' => __('Titles & Metas', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_titles')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-social', 'title' => __('Social', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_social')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-xml', 'title' => __('XML Sitemaps', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_xml')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-permalinks', 'title' => __('Permalinks', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_permalinks')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-internal-links', 'title' => __('Internal Links', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_internal-links')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-rss', 'title' => __('RSS', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_rss')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-import', 'title' => esc_html__('Import & Export', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_import')));
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo_bulk-editor', 'title' => __('Bulk Editor', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_bulk-editor')));
// Check where to add the edit files page
if (WPSEO_Utils::allow_system_file_edit() === true) {
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-files', 'title' => __('Edit Files', 'wordpress-seo'), 'href' => network_admin_url('admin.php?page=wpseo_files')));
// will auto-use admin_url if not in multi-site
}
$wp_admin_bar->add_menu(array('parent' => 'wpseo-settings', 'id' => 'wpseo-licenses', 'title' => __('Extensions', 'wordpress-seo'), 'href' => admin_url('admin.php?page=wpseo_licenses')));
}
}
示例13: import_metas
/**
* Import All In One SEO meta values
*/
private function import_metas()
{
WPSEO_Meta::replace_meta('_aioseop_description', WPSEO_Meta::$meta_prefix . 'metadesc', $this->replace);
WPSEO_Meta::replace_meta('_aioseop_keywords', WPSEO_Meta::$meta_prefix . 'metakeywords', $this->replace);
WPSEO_Meta::replace_meta('_aioseop_title', WPSEO_Meta::$meta_prefix . 'title', $this->replace);
}
示例14: retrieve_focuskw
/**
* Retrieve the post/page/cpt's focus keyword for use as replacement string.
*
* @return string|null
*/
private function retrieve_focuskw()
{
$replacement = null;
if (!empty($this->args->ID)) {
$focus_kw = WPSEO_Meta::get_value('focuskw', $this->args->ID);
if ($focus_kw !== '') {
$replacement = $focus_kw;
}
}
return $replacement;
}
示例15: test_get_post_value_default
/**
* Test default value returned when non-existant $_POST key supplied
* @covers WPSEO_Meta::get_post_value
*/
public function test_get_post_value_default()
{
$this->assertEquals('', WPSEO_Meta::get_post_value('my_missing_test_key'));
}