/** * Echos the publisher's Google Plus URL to the header of the page, if it's defined. * * @version 1.0.0 * @since 3.4.0 */ function standard_google_plus() { global $post; $html = ''; if (standard_using_native_seo() && ((is_single() || is_page()) && 0 != strlen(trim($google_plus = get_user_meta($post->post_author, 'google_plus', true))))) { if (false != standard_is_gplusto_url($google_plus)) { $google_plus = standard_get_google_plus_from_gplus($google_plus); } // end if $html = '<link rel="author" href="' . trailingslashit($google_plus) . '"/>'; } // end if echo $html; }
/** * Renders the actual Standard SEO Preview meta box and preview area to the page. * * @params object $post The post on which the box should be rendered. * @since 3.0 * @version 1.0 */ public function post_level_display($post) { wp_nonce_field(plugin_basename(__FILE__), 'standard_seo_nonce'); $html = '<p>' . __('Search Results Preview ', 'standard') . '</p>'; $html .= '<div id="search-engine-preview">'; $html .= '<p id="search-results-title"><span id="post-title"></span>' . ' ' . __('|', 'standard') . ' ' . '<span id="blog-title"></span></p>'; $html .= '<p id="search-results-meta"><span id="permalink"></span></p>'; // Look to see if the user has the Google Profile URL specified $current_user = wp_get_current_user(); if ('' != get_user_meta($current_user->ID, 'google_plus', true)) { // Determine if the user is using a gplus.to address $google_plus_url = user_trailingslashit(get_user_meta($current_user->ID, 'google_plus', true)); if (standard_is_gplusto_url($google_plus_url)) { $google_plus_url = standard_get_google_plus_from_gplus($google_plus_url); // Read the URL into an array $google_plus_id = explode('/', trailingslashit($google_plus_url)); // Note the third index of this array should always be at 3 after user_trailingslashit $google_plus_id = isset($google_plus_id[3]) ? $google_plus_id[3] : $google_plus_id[1]; // The user isn't using gplus.to, so the index of the ID is different } else { // Read the URL into an array $google_plus_id = explode('/', trailingslashit($google_plus_url)); // Note the third index of this array should alwas be at 5 after user_trailingslashit $google_plus_id = $google_plus_id[3]; } // end if/else // Now create the element $html .= '<p id="google-plus-avatar">'; $html .= '<img src="https://profiles.google.com/s2/photos/profile/' . $google_plus_id . '" alt="" width="44" height="44" />'; $html .= '</p>'; } // end if $html .= '<p id="search-results-meta-description"><span id="date">Date</span> - <span id="description">' . get_post_meta($post->ID, 'standard_seo_post_meta_description', true) . '</span></p>'; $html .= '<span id="site-title" class="hidden">' . get_bloginfo('name') . '</span>'; $html .= '<span id="todays-date" class="hidden">' . date(get_option('date_format')) . '</span>'; $html .= '</div><!-- /#search-engine-preview -->'; $html .= '<div id="meta-description-container">'; // The label for the meta description $html .= '<p>' . __('Meta Description ', 'standard') . '(<span id="character-count">' . __('140', 'standard') . '</span>' . ' ' . __('characters remaining)', 'standard'); '</p>'; // The input field for the meta description $html .= '<textarea id="standard_seo_post_meta_description" name="standard_seo_post_meta_description" maxlength="140">' . get_post_meta($post->ID, 'standard_seo_post_meta_description', true) . '</textarea>'; // The description for the field $html .= '<p class="description">'; $html .= __('Writing a meta description for every post is strongly recommended for SEO. If not provided, no description will be published.', 'standard'); $html .= '</p>'; $html .= '</div><!-- /#meta-description-container -->'; echo $html; }
" /> <?php } // end if ?> <?php global $post; ?> <?php if (standard_using_native_seo() && ((is_single() || is_page()) && 0 != strlen(trim($google_plus = get_user_meta($post->post_author, 'google_plus', true))))) { ?> <?php if (false != standard_is_gplusto_url($google_plus)) { ?> <?php $google_plus = standard_get_google_plus_from_gplus($google_plus); ?> <?php } // end if ?> <link rel="author" href="<?php echo trailingslashit($google_plus); ?> "/> <?php } // end if ?> <?php $global_options = get_option('standard_theme_global_options');