Show Hide Author - Version 2.2

Version Description

  • Support for IE8 and below.
Download this release

Release Info

Developer mspyratos
Plugin Icon 128x128 Show Hide Author
Version 2.2
Comparing to
See all releases

Code changes from version 2.1 to 2.2

Files changed (2) hide show
  1. readme.txt +7 -1
  2. show_hide_author.php +8 -4
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=EP9SL
4
  Tags: show author, hide author, remove author, author name
5
  Requires at least: 3.0.1
6
  Tested up to: 3.5
7
- Stable tag: 2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -111,6 +111,12 @@ The regular expressions: `<span class="meta-author(.*?)/span>`
111
 
112
  == Changelog ==
113
 
 
 
 
 
 
 
114
  = 2.0 =
115
  * Fixed a problem when multiple Regular Expressions were used.
116
 
4
  Tags: show author, hide author, remove author, author name
5
  Requires at least: 3.0.1
6
  Tested up to: 3.5
7
+ Stable tag: 2.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
111
 
112
  == Changelog ==
113
 
114
+ = 2.2 =
115
+ * Support for IE8 and below.
116
+
117
+ = 2.1 =
118
+ * Added more themes support.
119
+
120
  = 2.0 =
121
  * Fixed a problem when multiple Regular Expressions were used.
122
 
show_hide_author.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Show Hide Author
4
  Description: Choose whether to show or hide the author name.
5
- Version: 2.1
6
  Author: Michael Spyratos
7
  Author URI: http://mspyratos.com/
8
  License: GPL2
@@ -357,6 +357,10 @@ function remove_the_by() {
357
  var classes = ['meta'];
358
  var regex = '\\|\\s*<\/span>\\s*<span class="meta-author">\\s*<a(.*?)\/a>';
359
  break;
 
 
 
 
360
  default:
361
  var classes = ['entry-meta'];
362
  var regex = ' by <a(.*?)\/a>;<span class="sep"> by <\/span>; <span class="meta-sep">by<\/span>;<span class="meta-sep"> by <\/span>';
@@ -364,12 +368,12 @@ function remove_the_by() {
364
  <?php endif; ?>
365
  if (typeof classes[0] !== 'undefined' && classes[0] !== null) {
366
  for(var i = 0; i < classes.length; i++) {
367
- var elements = document.getElementsByClassName(classes[i]);
368
  for (var j = 0; j < elements.length; j++) {
369
  var regex_array = regex.split(";");
370
  for(var k = 0; k < regex_array.length; k++) {
371
- if (elements[j].innerHTML.match(new RegExp(regex_array[k]))) {
372
- var replaced_txt = elements[j].innerHTML.replace(new RegExp(regex_array[k]), '');
373
  elements[j].innerHTML = replaced_txt;
374
  }
375
  }
2
  /*
3
  Plugin Name: Show Hide Author
4
  Description: Choose whether to show or hide the author name.
5
+ Version: 2.2
6
  Author: Michael Spyratos
7
  Author URI: http://mspyratos.com/
8
  License: GPL2
357
  var classes = ['meta'];
358
  var regex = '\\|\\s*<\/span>\\s*<span class="meta-author">\\s*<a(.*?)\/a>';
359
  break;
360
+ case 'wp-clearphoto1' :
361
+ var classes = ['meta'];
362
+ var regex = '\\|\\s*<\/span>\\s*<span class="meta-author">\\s*<a(.*?)\/a>';
363
+ break;
364
  default:
365
  var classes = ['entry-meta'];
366
  var regex = ' by <a(.*?)\/a>;<span class="sep"> by <\/span>; <span class="meta-sep">by<\/span>;<span class="meta-sep"> by <\/span>';
368
  <?php endif; ?>
369
  if (typeof classes[0] !== 'undefined' && classes[0] !== null) {
370
  for(var i = 0; i < classes.length; i++) {
371
+ var elements = document.querySelectorAll('.'+classes[i]);
372
  for (var j = 0; j < elements.length; j++) {
373
  var regex_array = regex.split(";");
374
  for(var k = 0; k < regex_array.length; k++) {
375
+ if (elements[j].innerHTML.match(new RegExp(regex_array[k], "i"))) {
376
+ var replaced_txt = elements[j].innerHTML.replace(new RegExp(regex_array[k], "i"), '');
377
  elements[j].innerHTML = replaced_txt;
378
  }
379
  }