WP Meta and Date Remover - Version 1.3.0

Version Description

Download this release

Release Info

Developer prasadkirpekar
Plugin Icon 128x128 WP Meta and Date Remover
Version 1.3.0
Comparing to
See all releases

Code changes from version 1.2.2 to 1.3.0

Files changed (3) hide show
  1. admin/options.php +5 -0
  2. readme.txt +3 -1
  3. wp-meta-and-date-remover.php +61 -65
admin/options.php CHANGED
@@ -11,6 +11,11 @@
11
 
12
  <input type="hidden" name="submitted" value="1" />
13
  <table class="form-table">
 
 
 
 
 
14
  <tr>
15
  <th>Disable PHP removal<p>Plugin will not remove Meta and Date information from source code</p></th>
16
  <td><input type="checkbox" value="1" <?php if(get_option('wpmdr_disable_php')=="1") echo "checked='checked'" ;?> name="wpmdr_disable_php"/></td>
11
 
12
  <input type="hidden" name="submitted" value="1" />
13
  <table class="form-table">
14
+
15
+ <tr>
16
+ <th>Remove from Home page<p>Plugin will remove meta and date from home page</p></th>
17
+ <td><input type="checkbox" value="1" <?php if($from_['home']=="1") echo "checked='checked'" ;?> name="wpmdr_from_home"/></td>
18
+ </tr>
19
  <tr>
20
  <th>Disable PHP removal<p>Plugin will not remove Meta and Date information from source code</p></th>
21
  <td><input type="checkbox" value="1" <?php if(get_option('wpmdr_disable_php')=="1") echo "checked='checked'" ;?> name="wpmdr_disable_php"/></td>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: - https://paypal.me/prasadkirpekar
4
  Tags: free,theme,meta,date,author, website, posts, pages, metadata, post, home page, remover, entry-meta, css,front page
5
  Requires at least: 3.0.1
6
  Tested up to: 4.7
7
- Stable tag: 1.2.2
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -64,6 +64,8 @@ Use built in automatic installer or,
64
  3. After activation
65
 
66
  == Changelog ==
 
 
67
  1.2.2
68
  * Minor Improvments
69
  1.2.1
4
  Tags: free,theme,meta,date,author, website, posts, pages, metadata, post, home page, remover, entry-meta, css,front page
5
  Requires at least: 3.0.1
6
  Tested up to: 4.7
7
+ Stable tag: 1.3.0
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
64
  3. After activation
65
 
66
  == Changelog ==
67
+ 1.3.0
68
+ * Added option to choose whether to hide from home page or not.
69
  1.2.2
70
  * Minor Improvments
71
  1.2.1
wp-meta-and-date-remover.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Meta and Date Remover
4
  Plugin URI: mailto:prasadkirpekar@outlook.com
5
  Description: Remove Meta information such as Author and Date from posts and pages.
6
- Version: 1.2.2
7
  Author: Prasad Kirpekar
8
  Author URI: http://twitter.com.com/kirpekarprasad
9
  License: GPL v2
@@ -24,7 +24,7 @@ Copyright: Prasad Kirpekar
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
- function extra_links($links){
28
  $donate="<a href='https://paypal.me/prasadkirpekar'>Support Development</a>";
29
  $fiverr="<a href='http://bit.ly/2bzAUb6'>More Customization</a>";
30
  $setting_link = '<a href="../wp-admin/options-general.php?page=wp-meta-and-date-remover.php">Settings</a>';
@@ -39,101 +39,97 @@ $plugin = plugin_basename(__FILE__);
39
 
40
  //Removal using css
41
 
42
- function inline_style_(){
43
  if(get_option('wpmdr_disable_css')=="0"){
44
  echo "<style>/* CSS added by WP Meta and Date Remover*/".get_option('wpmdr_css')."</style>";
45
  }
46
  }
47
- function wp_meta_settings()
48
  {
49
  $css=get_option('wpmdr_css');
50
  $disable_php=get_option('wpmdr_disable_php');
51
  $disable_css=get_option('wpmdr_disable_css');
 
52
  if(isset($_POST['submitted']))
53
  {
54
- if(isset($_POST['wpmdr_css']))
55
- {
56
- $css=$_POST['wpmdr_css'];
57
- }
58
- if(isset($_POST['wpmdr_disable_php']))
59
- {
60
- $disable_php="1";
61
- }
62
- else{
63
- $disable_php="0";
64
- }
65
- if(isset($_POST['wpmdr_disable_css']))
66
- {
67
- $disable_css="1";
68
- }
69
- else{
70
- $disable_css="0";
71
- }
72
 
73
  update_option('wpmdr_css',$css);
74
  update_option('wpmdr_disable_php',$disable_php);
75
  update_option('wpmdr_disable_css',$disable_css);
 
76
  echo '<div class="updated fade"><p>Settings Saved! </p></div>';
77
  }
78
  $action_url = $_SERVER['REQUEST_URI'];
79
  include "admin/options.php";
80
  }
81
- function register_wpmdr_settings()
82
- {
83
- register_setting( 'wpmdr_css', 'wpmdr_css' );
84
-
85
- }
86
- function admin_settings()
87
  {
88
- add_options_page('WP Meta and Date Remover', 'WP Meta and Date Remover', 10, basename(__FILE__), 'wp_meta_settings');
89
 
90
  }
91
- function init_option(){
92
- $css="/* Remove meta from post */
93
- .entry-meta {
94
- display:none !important;
 
 
 
95
  }
96
 
97
- /* Remove meta from home page */
98
- .home .entry-meta {
99
- display: none;
100
- }
101
- /* WPTheme 2015 Metadata Removal */
102
- .entry-footer {
103
- display:none !important;
104
  }
105
 
106
- /* WPTheme 2015 Metadata Removal */
107
- .home .entry-footer {
108
- display: none;
109
- }";
110
- add_option('wpmdr_css',$css);
111
- add_option('wpmdr_disable_php',"0");
112
- add_option('wpmdr_disable_css',"0");
 
113
  }
114
 
115
 
 
116
  // removal using php.
117
  //some times css removal don't work for every theme.
118
- function remove_meta_php() {
119
- if(get_option('wpmdr_disable_php')=="0"){
120
-
121
- add_filter('the_date', '__return_false');
122
- add_filter('the_author', '__return_false');
123
- add_filter('the_time', '__return_false');
124
- add_filter('the_modified_date', '__return_false');
125
- add_filter('get_the_date', '__return_false');
126
- add_filter('get_the_author', '__return_false');
127
- add_filter('get_the_title', '__return_false');
128
- add_filter('get_the_time', '__return_false');
129
- add_filter('get_the_modified_date', '__return_false');
130
- }
 
131
  }
132
 
133
  //do everything
134
- register_activation_hook(__FILE__, 'init_option');
135
 
136
- add_action('wp_head','inline_style_');
137
- add_filter("plugin_action_links_$plugin", 'extra_links' );
138
- add_action('loop_start', 'remove_meta_php');
139
- add_action('admin_menu','admin_settings');
3
  Plugin Name: WP Meta and Date Remover
4
  Plugin URI: mailto:prasadkirpekar@outlook.com
5
  Description: Remove Meta information such as Author and Date from posts and pages.
6
+ Version: 1.3.0
7
  Author: Prasad Kirpekar
8
  Author URI: http://twitter.com.com/kirpekarprasad
9
  License: GPL v2
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
+ function wpmdr_extra_links($links){
28
  $donate="<a href='https://paypal.me/prasadkirpekar'>Support Development</a>";
29
  $fiverr="<a href='http://bit.ly/2bzAUb6'>More Customization</a>";
30
  $setting_link = '<a href="../wp-admin/options-general.php?page=wp-meta-and-date-remover.php">Settings</a>';
39
 
40
  //Removal using css
41
 
42
+ function wpmdr_inline_style(){
43
  if(get_option('wpmdr_disable_css')=="0"){
44
  echo "<style>/* CSS added by WP Meta and Date Remover*/".get_option('wpmdr_css')."</style>";
45
  }
46
  }
47
+ function wpmdr_settings()
48
  {
49
  $css=get_option('wpmdr_css');
50
  $disable_php=get_option('wpmdr_disable_php');
51
  $disable_css=get_option('wpmdr_disable_css');
52
+ $from_=get_option('wpmdr_from_');
53
  if(isset($_POST['submitted']))
54
  {
55
+ if(isset($_POST['wpmdr_from_home'])) $from_['home']="1";
56
+ else $from_['home']="0";
57
+
58
+ if(isset($_POST['wpmdr_css'])) $css=$_POST['wpmdr_css'];
59
+
60
+ if(isset($_POST['wpmdr_disable_php'])) $disable_php="1";
61
+ else $disable_php="0";
62
+
63
+ if(isset($_POST['wpmdr_disable_css'])) $disable_css="1";
64
+ else $disable_css="0";
 
 
 
 
 
 
 
 
65
 
66
  update_option('wpmdr_css',$css);
67
  update_option('wpmdr_disable_php',$disable_php);
68
  update_option('wpmdr_disable_css',$disable_css);
69
+ update_option('wpmdr_from_',$from_);
70
  echo '<div class="updated fade"><p>Settings Saved! </p></div>';
71
  }
72
  $action_url = $_SERVER['REQUEST_URI'];
73
  include "admin/options.php";
74
  }
75
+
76
+ function wpmdr_admin_settings()
 
 
 
 
77
  {
78
+ add_options_page('WP Meta and Date Remover', 'WP Meta and Date Remover', 'manage_options', basename(__FILE__), 'wpmdr_settings');
79
 
80
  }
81
+ function wpmdr_init_option(){
82
+ $css=".entry-meta {display:none !important;}.home .entry-meta { display: none; }.entry-footer {display:none !important;}.home .entry-footer { display: none; }";
83
+
84
+ add_option('wpmdr_from_',array('home'=>'1'));
85
+ add_option('wpmdr_css',$css);
86
+ add_option('wpmdr_disable_php',"0");
87
+ add_option('wpmdr_disable_css',"0");
88
  }
89
 
90
+ function wpmdr_php_filter_option(){
91
+ $from_=get_option('wpmdr_from_');
92
+ if(is_front_page()||is_home()){
93
+ if($from_['home']=="1") wpmdr_remove_meta_php();
94
+ else return;
95
+ }
96
+ else wpmdr_remove_meta_php();
97
  }
98
 
99
+
100
+ function wpmdr_css_filter_option(){
101
+ $from_=get_option('wpmdr_from_');
102
+ if(is_front_page()||is_home()){
103
+ if($from_['home']=="1") wpmdr_inline_style();
104
+ else return;
105
+ }
106
+ else wpmdr_inline_style();
107
  }
108
 
109
 
110
+
111
  // removal using php.
112
  //some times css removal don't work for every theme.
113
+ function wpmdr_remove_meta_php() {
114
+
115
+ if(get_option('wpmdr_disable_php')=="0"){
116
+ add_filter('the_date', '__return_false');
117
+ add_filter('the_author', '__return_false');
118
+ add_filter('the_time', '__return_false');
119
+ add_filter('the_modified_date', '__return_false');
120
+ add_filter('get_the_date', '__return_false');
121
+ add_filter('get_the_author', '__return_false');
122
+ add_filter('get_the_title', '__return_false');
123
+ add_filter('get_the_time', '__return_false');
124
+ add_filter('get_the_modified_date', '__return_false');
125
+ }
126
+
127
  }
128
 
129
  //do everything
130
+ register_activation_hook(__FILE__, 'wpmdr_init_option');
131
 
132
+ add_action('wp_head','wpmdr_inline_style');
133
+ add_filter("plugin_action_links_$plugin", 'wpmdr_extra_links' );
134
+ add_action('loop_start', 'wpmdr_php_filter_option');
135
+ add_action('admin_menu','wpmdr_admin_settings');