Exemplo n.º 1
0
 function term_additions_form($term, $taxonomy)
 {
     $tax_meta = get_option('zeo_taxonomy_meta');
     $options = get_mervin_options();
     if (isset($tax_meta[$taxonomy][$term->term_id])) {
         $tax_meta = $tax_meta[$taxonomy][$term->term_id];
     }
     echo '<h3>' . __('Mervin Praison WordPress SEO Settings', 'wordpress-seo') . '</h3>';
     echo '<table class="form-table">';
     $this->form_row('zeo_title', __('SEO Title', 'wordpress-seo'), __('The SEO title is used on the archive page for this term.', 'wordpress-seo'), $tax_meta);
     $this->form_row('zeo_desc', __('SEO Description', 'wordpress-seo'), __('The SEO description is used for the meta description on the archive page for this term.', 'wordpress-seo'), $tax_meta);
     if (isset($options['usemetakeywords']) && $options['usemetakeywords']) {
         $this->form_row('zeo_metakey', __('Meta Keywords', 'wordpress-seo'), __('Meta keywords used on the archive page for this term.', 'wordpress-seo'), $tax_meta);
     }
     $this->form_row('zeo_canonical', __('Canonical', 'wordpress-seo'), __('The canonical link is shown on the archive page for this term.', 'wordpress-seo'), $tax_meta);
     $this->form_row('zeo_bctitle', __('Breadcrumbs Title', 'wordpress-seo'), sprintf(__('The Breadcrumbs title is used in the breadcrumbs where this %s appears.', 'wordpress-seo'), $taxonomy), $tax_meta);
     $this->form_row('zeo_noindex', sprintf(__('Noindex this %s', 'wordpress-seo'), $taxonomy), '', $tax_meta, 'checkbox');
     $this->form_row('zeo_nofollow', sprintf(__('Nofollow this %s', 'wordpress-seo'), $taxonomy), '', $tax_meta, 'checkbox');
     /*
     		$this->form_row( 'zeo_sitemap_include', __( 'Include in sitemap?', 'wordpress-seo' ), '', $tax_meta, 'select', array(
     			"-" => __("Auto detect", 'wordpress-seo' ),
     			"always" => __("Always include", 'wordpress-seo' ),
     			"never" => __("Never include", 'wordpress-seo' ),
     		) );
     */
     echo '</table>';
 }
Exemplo n.º 2
0
 /**
  * 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.
  *
  * @todo Potentially schedule a cron event instead so that pinging runs in the background.
  */
 function status_transition($new_status, $old_status, $post)
 {
     if ($new_status != 'publish') {
         return;
     }
     wp_cache_delete('lastpostmodified:gmt:' . $post->post_type, 'timeinfo');
     // #17455
     $options = get_mervin_options();
     if (isset($options['post_types-' . $post->post_type . '-not_in_sitemap']) && $options['post_types-' . $post->post_type . '-not_in_sitemap']) {
         return;
     }
     if (WP_CACHE) {
         wp_schedule_single_event(time(), 'zeo_hit_sitemap_index');
     }
     if (zeo_get_value('sitemap-include', $post->ID) != 'never') {
         $this->ping_search_engines();
     }
 }
Exemplo n.º 3
0
        $mervin_advanced['advanced-categorytrailing'] = 'yes';
    }
    if (isset($_POST['advanced-attachmentredirect'])) {
        $mervin_advanced['advanced-attachmentredirect'] = 'yes';
    }
    update_option('mervin_advanced', $mervin_advanced);
    echo '<div class="updated">
		<p>
			<strong>Options saved</strong>
		</p>
	</div>';
}
?>

<?php 
$options = get_mervin_options();
?>
<div class="postbox-container" style="width:70%;">
				<div class="metabox-holder">	                
					<div class="meta-box-sortables ui-sortable">
                    
<form method="POST" action="">  
		
        <input type="hidden" name="update_rss" value="true" />        
        <div class="postbox" id="support">
        <div class="handlediv" title="Click to toggle">
<br />
</div>
        <h3 class="hndle"><span>Permalink Settings</span></h3>
        <div class="container">
<table cellpadding="6">
Exemplo n.º 4
0
 public function zeo_head()
 {
     if (is_feed()) {
         return;
     }
     $i = 1;
     $options = get_mervin_options();
     echo "\n<!-- Wordpress SEO Plugin by Mervin Praison ( http://mervin.info/seo-wordpress/ ) --> \n";
     foreach ($this->zeo_uniqueid as $uid) {
         $seo_data_class = new seo_data_class();
         $checkvalue = $seo_data_class->zeo_get_post_meta($uid);
         if (is_front_page() && $i == 1) {
             if (get_option('zeo_home_description') != NULL) {
                 echo "<meta name='description' content='" . get_option('zeo_home_description') . "'/> ";
             }
             if (get_option('zeo_home_keywords') != NULL) {
                 echo " <meta name='keywords' content='" . get_option('zeo_home_keywords') . "'/>";
             }
             /*  Adding Google Bing and Alexa Verifications  */
             if (is_front_page()) {
                 if (!empty($options['verification-google'])) {
                     $google_meta = $options['verification-google'];
                     if (strpos($google_meta, 'content')) {
                         preg_match('/content="([^"]+)"/', $google_meta, $match);
                         $google_meta = $match[1];
                     }
                     echo "<meta name=\"google-site-verification\" content=\"{$google_meta}\" />\n";
                 }
                 if (!empty($options['verification-bing'])) {
                     $bing_meta = $options['verification-bing'];
                     if (strpos($bing_meta, 'content')) {
                         preg_match('/content="([^"]+)"/', $bing_meta, $match);
                         $bing_meta = $match[1];
                     }
                     echo "<meta name=\"msvalidate.01\" content=\"{$bing_meta}\" />\n";
                 }
                 if (!empty($options['verification-alexa'])) {
                     echo "<meta name=\"alexaVerifyID\" content=\"" . esc_attr($options['verification-alexa']) . "\" />\n";
                 }
             }
             /*  Adding Google Bing and Alexa Verifications  */
             $i = 2;
         } elseif (is_home() && $i == 1) {
             if (get_option('zeo_blog_description') != NULL) {
                 echo "<meta name='description' content='" . get_option('zeo_blog_description') . "'/> ";
             }
             if (get_option('zeo_blog_keywords') != NULL) {
                 echo " <meta name='keywords' content='" . get_option('zeo_blog_keywords') . "'/>";
             }
             $i = 2;
         } elseif ($checkvalue != NULL && $i == 1) {
             if ($uid == 'zeo_description') {
                 echo "<meta name='description' content='" . $seo_data_class->zeo_get_post_meta($uid) . "'/>";
             }
             if ($uid == 'zeo_keywords') {
                 echo " <meta name='keywords' content='" . $seo_data_class->zeo_get_post_meta($uid) . "'/>";
             }
             if ($uid == 'zeo_index' && !is_front_page()) {
                 echo " <meta name='robots' content='" . $seo_data_class->zeo_get_post_meta($uid) . "'/>";
             }
         }
     }
     global $wp_query;
     $url = $this->zeo_get_url($wp_query);
     if (get_option('zeo_canonical_url') != NULL && get_option('zeo_canonical_url') == 'yes' && $url != NULL) {
         echo "<link rel='canonical' href='" . $url . "' />";
     }
     if (is_category() && $this->zeo_ischeck_head('zeo_category_nofollow', 'yes')) {
         echo ' <meta name="robots" content="noindex,follow" />';
     }
     if (is_tag() && $this->zeo_ischeck_head('zeo_tag_nofollow', 'yes')) {
         echo ' <meta name="robots" content="noindex,follow" />';
     }
     if (is_date() && $this->zeo_ischeck_head('zeo_date_nofollow', 'yes')) {
         echo ' <meta name="robots" content="noindex,follow" />';
     }
     echo "\n<!-- End of Wordpress SEO Plugin by Mervin Praison --> \n";
 }
Exemplo n.º 5
0
 function breadcrumb($prefix = '', $suffix = '', $display = true)
 {
     $options = get_mervin_options();
     global $wp_query, $post, $paged;
     $opt = get_option("mervin_breadcrumbs");
     $on_front = get_option('show_on_front');
     $blog_page = get_option('page_for_posts');
     $sep = isset($opt['breadcrumbs-sep']) && $opt['breadcrumbs-sep'] != '' ? $opt['breadcrumbs-sep'] : '&raquo;';
     $home = isset($opt['breadcrumbs-home']) && $opt['breadcrumbs-home'] != '' ? $opt['breadcrumbs-home'] : __('Home');
     $selmenu = isset($opt['breadcrumbs-selectedmenu']) && $opt['breadcrumbs-selectedmenu'] != '' ? $opt['breadcrumbs-selectedmenu'] : 0;
     if ("page" == $on_front && 'post' == get_post_type()) {
         $homelink = '<a href="' . get_permalink(get_option('page_on_front')) . '">' . $home . '</a>';
         $bloglink = $homelink;
         if ($blog_page && (!isset($opt['breadcrumbs-blog-remove']) || !$opt['breadcrumbs-blog-remove'])) {
             $bloglink = $homelink . ' ' . $sep . ' <a href="' . get_permalink($blog_page) . '">' . $this->get_bc_title($blog_page) . '</a>';
         }
     } else {
         $homelink = '<a href="' . get_bloginfo('url') . '">' . $home . '</a>';
         $bloglink = $homelink;
     }
     if ($on_front == "page" && is_front_page() || $on_front == "posts" && is_home()) {
         $output = $this->bold_or_not($home);
     } else {
         if ($on_front == "page" && is_home()) {
             $output = $homelink . ' ' . $sep . ' ' . $this->bold_or_not($this->get_bc_title($blog_page));
         } else {
             if (is_singular()) {
                 $output = $bloglink . ' ' . $sep . ' ';
                 if (isset($opt['breadcrumbs-menus']) && ($opt['breadcrumbs-menus'] = 'on')) {
                     $use_menu = $this->in_menu($selmenu);
                 }
                 if (function_exists('bbp_body_class') && count(bbp_body_class(array())) > 1) {
                     remove_filter('bbp_get_breadcrumb', '__return_false');
                     $output .= bbp_get_breadcrumb(' ' . $sep . ' ');
                     add_filter('bbp_get_breadcrumb', '__return_false');
                 } else {
                     if (isset($use_menu) && $use_menu) {
                         $trail = $this->get_menu_trail();
                         $trail = array_reverse($trail);
                         $trailposts = array();
                         for ($t = 0; $t < count($trail); $t++) {
                             $trailposts[] = $this->get_post_for_menunode($trail[$t]);
                         }
                         for ($t = 0; $t < count($trail); $t++) {
                             $bctitle = get_the_title($trail[$t]) == '' ? get_the_title($trailposts[$t]) : get_the_title($trail[$t]);
                             $output .= '<a href="' . get_permalink($trailposts[$t]) . '">' . $bctitle . '</a> ' . $sep . ' ';
                         }
                         $output .= $this->bold_or_not($this->get_bc_title($post->ID));
                     } else {
                         $post_type = get_post_type();
                         if (function_exists('get_post_type_archive_link') && get_post_type_archive_link($post_type)) {
                             if (isset($options['bctitle-ptarchive-' . $post_type]) && '' != $options['bctitle-ptarchive-' . $post_type]) {
                                 $archive_title = $options['bctitle-ptarchive-' . $post_type];
                             } else {
                                 $post_type_obj = get_post_type_object($post_type);
                                 $archive_title = $post_type_obj->labels->menu_name;
                             }
                             $output .= '<a href="' . get_post_type_archive_link($post_type) . '">' . $archive_title . '</a> ' . $sep . ' ';
                         }
                         if (0 == $post->post_parent) {
                             if (isset($opt['post_types-' . $post->post_type . '-maintax']) && $opt['post_types-' . $post->post_type . '-maintax'] != '0') {
                                 $main_tax = $opt['post_types-' . $post->post_type . '-maintax'];
                                 $terms = wp_get_object_terms($post->ID, $main_tax);
                                 if (is_taxonomy_hierarchical($main_tax) && $terms[0]->parent != 0) {
                                     $parents = $this->get_term_parents($terms[0], $main_tax);
                                     $parents = array_reverse($parents);
                                     foreach ($parents as $parent) {
                                         $bctitle = zeo_get_term_meta($parent, $main_tax, 'bctitle');
                                         if (!$bctitle) {
                                             $bctitle = $parent->name;
                                         }
                                         $output .= '<a href="' . get_term_link($parent, $main_tax) . '">' . $bctitle . '</a> ' . $sep . ' ';
                                     }
                                 }
                                 if (count($terms) > 0) {
                                     $bctitle = zeo_get_term_meta($terms[0], $main_tax, 'bctitle');
                                     if (!$bctitle) {
                                         $bctitle = $terms[0]->name;
                                     }
                                     $output .= '<a href="' . get_term_link($terms[0], $main_tax) . '">' . $bctitle . '</a> ' . $sep . ' ';
                                 }
                             }
                             $output .= $this->bold_or_not($this->get_bc_title($post->ID));
                         } else {
                             if (isset($post->ancestors)) {
                                 if (is_array($post->ancestors)) {
                                     $ancestors = array_values($post->ancestors);
                                 } else {
                                     $ancestors = array($post->ancestors);
                                 }
                             } else {
                                 $ancestors = array($post->post_parent);
                             }
                             // Reverse the order so it's oldest to newest
                             $ancestors = array_reverse($ancestors);
                             foreach ($ancestors as $ancestor) {
                                 $output .= '<a href="' . get_permalink($ancestor) . '">' . $this->get_bc_title($ancestor) . '</a> ' . $sep . ' ';
                             }
                             $output .= $this->bold_or_not($this->get_bc_title($post->ID));
                         }
                     }
                 }
             } else {
                 if (!is_404()) {
                     $output = $bloglink . ' ' . $sep . ' ';
                 } else {
                     $output = $homelink . ' ' . $sep . ' ';
                 }
                 // echo '<pre>'.print_r($wp_query,1).'</pre>';
                 if (function_exists('is_post_type_archive') && is_post_type_archive()) {
                     $post_type = get_post_type();
                     if (isset($options['bctitle-ptarchive-' . $post_type]) && '' != $options['bctitle-ptarchive-' . $post_type]) {
                         $archive_title = $options['bctitle-ptarchive-' . $post_type];
                     } else {
                         $post_type_obj = get_post_type_object($post_type);
                         $archive_title = $post_type_obj->labels->menu_name;
                     }
                     $output .= $this->bold_or_not($archive_title);
                 } else {
                     if (is_tax() || is_tag() || is_category()) {
                         $term = $wp_query->get_queried_object();
                         if (isset($options['taxonomy-' . $term->taxonomy . '-ptparent']) && $options['taxonomy-' . $term->taxonomy . '-ptparent'] != '') {
                             $post_type = $options['taxonomy-' . $term->taxonomy . '-ptparent'];
                             if ('post' == $post_type && get_option('show_on_front') == 'page') {
                                 $posts_page = get_option('page_for_posts');
                                 if ($posts_page) {
                                     $output .= '<a href="' . get_permalink($posts_page) . '">' . $this->get_bc_title($posts_page) . '</a> ' . $sep . ' ';
                                 }
                             } else {
                                 if (isset($options['bctitle-ptarchive-' . $post_type]) && '' != $options['bctitle-ptarchive-' . $post_type]) {
                                     $archive_title = $options['bctitle-ptarchive-' . $post_type];
                                 } else {
                                     $post_type_obj = get_post_type_object($post_type);
                                     $archive_title = $post_type_obj->labels->menu_name;
                                 }
                                 $output .= '<a href="' . get_post_type_archive_link($post_type) . '">' . $archive_title . '</a> ' . $sep . ' ';
                             }
                         }
                         if (is_taxonomy_hierarchical($term->taxonomy) && $term->parent != 0) {
                             $parents = $this->get_term_parents($term, $term->taxonomy);
                             $parents = array_reverse($parents);
                             foreach ($parents as $parent) {
                                 $bctitle = zeo_get_term_meta($parent, $term->taxonomy, 'bctitle');
                                 if (!$bctitle) {
                                     $bctitle = $parent->name;
                                 }
                                 $output .= '<a href="' . get_term_link($parent, $term->taxonomy) . '">' . $bctitle . '</a> ' . $sep . ' ';
                             }
                         }
                         $bctitle = zeo_get_term_meta($term, $term->taxonomy, 'bctitle');
                         if (!$bctitle) {
                             $bctitle = $term->name;
                         }
                         if ($paged) {
                             $output .= $this->bold_or_not('<a href="' . get_term_link($term, $term->taxonomy) . '">' . $bctitle . '</a>');
                         } else {
                             $output .= $this->bold_or_not($bctitle);
                         }
                     } else {
                         if (is_date()) {
                             if (isset($opt['breadcrumbs-archiveprefix'])) {
                                 $bc = $opt['breadcrumbs-archiveprefix'];
                             } else {
                                 $bc = __('Archives for');
                             }
                             if (is_day()) {
                                 global $wp_locale;
                                 $output .= '<a href="' . get_month_link(get_query_var('year'), get_query_var('monthnum')) . '">' . $wp_locale->get_month(get_query_var('monthnum')) . ' ' . get_query_var('year') . '</a> ' . $sep . ' ';
                                 $output .= $this->bold_or_not($bc . " " . get_the_date());
                             } else {
                                 if (is_month()) {
                                     $output .= $this->bold_or_not($bc . " " . single_month_title(' ', false));
                                 } else {
                                     if (is_year()) {
                                         $output .= $this->bold_or_not($bc . " " . get_query_var('year'));
                                     }
                                 }
                             }
                         } elseif (is_author()) {
                             if (isset($opt['breadcrumbs-archiveprefix'])) {
                                 $bc = $opt['breadcrumbs-archiveprefix'];
                             } else {
                                 $bc = __('Archives for');
                             }
                             $user = $wp_query->get_queried_object();
                             $output .= $this->bold_or_not($bc . " " . $user->display_name);
                         } elseif (is_search()) {
                             if (isset($opt['breadcrumbs-searchprefix']) && $opt['breadcrumbs-searchprefix'] != '') {
                                 $bc = $opt['breadcrumbs-searchprefix'];
                             } else {
                                 $bc = __('You searched for');
                             }
                             $output .= $this->bold_or_not($bc . ' "' . stripslashes(strip_tags(get_search_query())) . '"');
                         } elseif (isset($wp_query->query_vars['bbp_topic_tag'])) {
                             remove_filter('bbp_get_breadcrumb', '__return_false');
                             $output .= bbp_get_breadcrumb(' ' . $sep . ' ');
                             add_filter('bbp_get_breadcrumb', '__return_false');
                         } elseif (is_404()) {
                             if (isset($opt['breadcrumbs-404crumb']) && $opt['breadcrumbs-404crumb'] != '') {
                                 $crumb404 = $opt['breadcrumbs-404crumb'];
                             } else {
                                 $crumb404 = __('Error 404: Page not found');
                             }
                             $output .= $this->bold_or_not($crumb404);
                         }
                     }
                 }
             }
         }
     }
     if (isset($opt['breadcrumbs-prefix']) && $opt['breadcrumbs-prefix'] != "") {
         $output = $opt['breadcrumbs-prefix'] . " " . $output;
     }
     if ($display) {
         echo $prefix . $output . $suffix;
         return true;
     } else {
         return $prefix . $output . $suffix;
     }
 }
Exemplo n.º 6
0
function select($id, $label, $values, $option = '')
{
    if ($option == '') {
        $options = get_mervin_options();
        $option = !empty($option) ? $option : 'mervin_breadcrumbs';
    } else {
        if (function_exists('is_network_admin') && is_network_admin()) {
            $options = get_site_option($option);
        } else {
            $options = get_option($option);
        }
    }
    $output = '<tr><td style="width:230px;" ><label style="float:right;" for="' . $id . '">' . $label . ':</label></td>';
    $output .= '<td><select name="' . $option . '[' . $id . ']" id="' . $id . '">';
    foreach ($values as $value => $label) {
        $sel = '';
        if (isset($options[$id]) && $options[$id] == $value) {
            $sel = 'selected="selected" ';
        }
        if (!empty($label)) {
            $output .= '<option ' . $sel . 'value="' . $value . '">' . $label . '</option>';
        }
    }
    $output .= '</select></td><tr>';
    return $output . '';
}
Exemplo n.º 7
0
function zeo_embed_rssfooter_excerpt($content)
{
    if (is_feed()) {
        $options = get_mervin_options();
        if (isset($options['rss-header-content']) && !empty($options['rss-header-content'])) {
            $content = "<p>" . zeo_rss_replace_vars($options['rss-header-content']) . "</p><p>" . $content . "</p>";
        }
        if (isset($options['rss-footer-content']) && !empty($options['rss-footer-content'])) {
            $content = "<p>" . $content . "</p><p>" . zeo_rss_replace_vars($options['rss-footer-content']) . "</p>";
        }
    }
    return $content;
}