Skip to content

Instantly share code, notes, and snippets.

@ootput
Created October 6, 2011 11:54
Show Gist options
  • Select an option

  • Save ootput/1267231 to your computer and use it in GitHub Desktop.

Select an option

Save ootput/1267231 to your computer and use it in GitHub Desktop.
patch metaseo for no-cache meta for robots
--- metaseo.plugin.php 2011-10-06 18:54:14.326378049 +0800
+++ metaseo.plugin.php-nocache 2011-10-06 18:53:37.566385150 +0800
@@ -69,10 +69,13 @@
'home_keywords' => $home_keys,
'home_index' => true,
'home_follow' => true,
+ 'home_cache' => true,
'posts_index' => true,
'posts_follow' => true,
+ 'posts_cache' => true,
'archives_index' => false,
'archives_follow' => true,
+ 'archives_cache' => false,
);
}
@@ -133,10 +136,13 @@
$ui->append( 'fieldset', 'Robots', _t( 'Robots', 'metaseo' ) );
$ui->Robots->append( 'checkbox', 'home_index', 'option:MetaSEO__home_index', _t( 'Index Home Page', 'metaseo' ) );
$ui->Robots->append( 'checkbox', 'home_follow', 'option:MetaSEO__home_follow', _t( 'Follow Home Page Links', 'metaseo' ) );
+ $ui->Robots->append( 'checkbox', 'home_cache', 'option:MetaSEO__home_cache', _t( 'Cache Home Page', 'metaseo' ) );
$ui->Robots->append( 'checkbox', 'posts_index', 'option:MetaSEO__posts_index', _t( 'Index Posts', 'metaseo' ) );
$ui->Robots->append( 'checkbox', 'posts_follow', 'option:MetaSEO__posts_follow', _t( 'Follow Post Links', 'metaseo' ) );
+ $ui->Robots->append( 'checkbox', 'posts_cache', 'option:MetaSEO__posts_cache', _t( 'Cache Posts', 'metaseo' ) );
$ui->Robots->append( 'checkbox', 'archives_index', 'option:MetaSEO__archives_index', _t( 'Index Archives', 'metaseo' ) );
$ui->Robots->append( 'checkbox', 'archives_follow', 'option:MetaSEO__archives_follow', _t( 'Follow Archive Links', 'metaseo' ) );
+ $ui->Robots->append( 'checkbox', 'archives_cache', 'option:MetaSEO__archives_cache', _t( 'Cache Archives', 'metaseo' ) );
$ui->append( 'submit', 'save', _t( 'Save', 'metaseo' ) );
$ui->out();
@@ -381,6 +387,12 @@
else {
$robots .= ', nofollow';
}
+ if ( !Options::get( 'MetaSEO__posts_cache' ) ) {
+ $robots .= ', noarchive';
+ }
break;
case 'display_home':
if ( Options::get( 'MetaSEO__home_index' ) ) {
@@ -395,6 +407,12 @@
else {
$robots .= ', nofollow';
}
+ if ( !Options::get( 'MetaSEO__home_cache' ) ) {
+ $robots .= ', noarchive';
+ }
break;
case 'display_entries_by_tag':
case 'display_entries_by_date':
@@ -411,6 +429,12 @@
else {
$robots .= ', nofollow';
}
+ if ( !Options::get( 'MetaSEO__archives_cache' ) ) {
+ $robots .= ', noarchive';
+ }
break;
default:
$robots = 'noindex, follow';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment