Version Description
- Small fixes.
Download this release
Release Info
Developer | selmam |
Plugin | WP Date Remover |
Version | 1.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.1.1
- README.txt +7 -6
- public/class-wp-date-remover-public.php +186 -186
- wp-date-remover.php +1 -1
README.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: selmam
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HDDZC67MECKQQ
|
4 |
Tags: Remove Time And Date, Date Information, Date, Posting Date, Remove, Remover, Entry-Meta, Free, Post, Posts, Category, Categories, Specific Post Categories, WP Date Remover, Timeless, Timeless Content, Evergreen
|
5 |
Requires at least: 4.0
|
6 |
-
Tested up to: 4.8.
|
7 |
-
Stable tag: 1.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -51,6 +51,9 @@ Feel free to send me an email, if more people request the same feature I will ad
|
|
51 |
|
52 |
== Changelog ==
|
53 |
|
|
|
|
|
|
|
54 |
= 1.1.0 =
|
55 |
* WPML 3.8 compatibility.
|
56 |
|
@@ -65,8 +68,6 @@ Feel free to send me an email, if more people request the same feature I will ad
|
|
65 |
|
66 |
== Upgrade Notice ==
|
67 |
|
68 |
-
= 1.1.
|
69 |
-
*
|
70 |
-
|
71 |
-
|
72 |
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HDDZC67MECKQQ
|
4 |
Tags: Remove Time And Date, Date Information, Date, Posting Date, Remove, Remover, Entry-Meta, Free, Post, Posts, Category, Categories, Specific Post Categories, WP Date Remover, Timeless, Timeless Content, Evergreen
|
5 |
Requires at least: 4.0
|
6 |
+
Tested up to: 4.8.1
|
7 |
+
Stable tag: 1.1.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
51 |
|
52 |
== Changelog ==
|
53 |
|
54 |
+
= 1.1.1 =
|
55 |
+
* Small fixes.
|
56 |
+
|
57 |
= 1.1.0 =
|
58 |
* WPML 3.8 compatibility.
|
59 |
|
68 |
|
69 |
== Upgrade Notice ==
|
70 |
|
71 |
+
= 1.1.1 - October 17th, 2017 =
|
72 |
+
* Small fixes.
|
|
|
|
|
73 |
|
public/class-wp-date-remover-public.php
CHANGED
@@ -1,186 +1,186 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* The public-facing functionality of the plugin.
|
5 |
-
*
|
6 |
-
* @link http://selmamariudottir.com
|
7 |
-
* @since 1.0.0
|
8 |
-
*
|
9 |
-
* @package Wp_Date_Remover
|
10 |
-
* @subpackage Wp_Date_Remover/public
|
11 |
-
*/
|
12 |
-
|
13 |
-
/**
|
14 |
-
* The public-facing functionality of the plugin.
|
15 |
-
*
|
16 |
-
* Defines the plugin name, version, and two examples hooks for how to
|
17 |
-
* enqueue the admin-specific stylesheet and JavaScript.
|
18 |
-
*
|
19 |
-
* @package Wp_Date_Remover
|
20 |
-
* @subpackage Wp_Date_Remover/public
|
21 |
-
* @author Selma Mariudottir <selma@selmamariudottir.com>
|
22 |
-
*/
|
23 |
-
class Wp_Date_Remover_Public {
|
24 |
-
|
25 |
-
/**
|
26 |
-
* The ID of this plugin.
|
27 |
-
*
|
28 |
-
* @since 1.0.0
|
29 |
-
* @access private
|
30 |
-
* @var string $plugin_name The ID of this plugin.
|
31 |
-
*/
|
32 |
-
private $plugin_name;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* The version of this plugin.
|
36 |
-
*
|
37 |
-
* @since 1.0.0
|
38 |
-
* @access private
|
39 |
-
* @var string $version The current version of this plugin.
|
40 |
-
*/
|
41 |
-
private $version;
|
42 |
-
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Initialize the class and set its properties.
|
46 |
-
*
|
47 |
-
* @since 1.0.0
|
48 |
-
* @param string $plugin_name The name of the plugin.
|
49 |
-
* @param string $version The version of this plugin.
|
50 |
-
*/
|
51 |
-
public function __construct( $plugin_name, $version ) {
|
52 |
-
|
53 |
-
$this->plugin_name = $plugin_name;
|
54 |
-
$this->version = $version;
|
55 |
-
$this->wp_date_remover_options = get_option($this->plugin_name);
|
56 |
-
}
|
57 |
-
|
58 |
-
/**
|
59 |
-
* Register the stylesheets for the public-facing side of the site.
|
60 |
-
*
|
61 |
-
* @since 1.0.0
|
62 |
-
*/
|
63 |
-
public function enqueue_styles() {
|
64 |
-
|
65 |
-
/**
|
66 |
-
* This function is provided for demonstration purposes only.
|
67 |
-
*
|
68 |
-
* An instance of this class should be passed to the run() function
|
69 |
-
* defined in Wp_Date_Remover_Loader as all of the hooks are defined
|
70 |
-
* in that particular class.
|
71 |
-
*
|
72 |
-
* The Wp_Date_Remover_Loader will then create the relationship
|
73 |
-
* between the defined hooks and the functions defined in this
|
74 |
-
* class.
|
75 |
-
*/
|
76 |
-
|
77 |
-
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wp-date-remover-public.css', array(), $this->version, 'all' );
|
78 |
-
|
79 |
-
}
|
80 |
-
|
81 |
-
/**
|
82 |
-
* Register the JavaScript for the public-facing side of the site.
|
83 |
-
*
|
84 |
-
* @since 1.0.0
|
85 |
-
*/
|
86 |
-
public function enqueue_scripts() {
|
87 |
-
|
88 |
-
/**
|
89 |
-
* This function is provided for demonstration purposes only.
|
90 |
-
*
|
91 |
-
* An instance of this class should be passed to the run() function
|
92 |
-
* defined in Wp_Date_Remover_Loader as all of the hooks are defined
|
93 |
-
* in that particular class.
|
94 |
-
*
|
95 |
-
* The Wp_Date_Remover_Loader will then create the relationship
|
96 |
-
* between the defined hooks and the functions defined in this
|
97 |
-
* class.
|
98 |
-
*/
|
99 |
-
|
100 |
-
wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wp-date-remover-public.js', array( 'jquery' ), $this->version, false );
|
101 |
-
|
102 |
-
}
|
103 |
-
|
104 |
-
public function wp_date_remover_remove() {
|
105 |
-
global $wdr_cat_arry,$wdr_post_arry;
|
106 |
-
$wdr_cat_arry=array();
|
107 |
-
$wdr_post_arry=array();
|
108 |
-
$wdr_args = array(
|
109 |
-
'orderby' => 'name',
|
110 |
-
'order' => 'ASC'
|
111 |
-
);
|
112 |
-
$wdr_categories = get_categories($wdr_args);
|
113 |
-
if(is_array($wdr_categories) && !empty($wdr_categories))
|
114 |
-
{
|
115 |
-
foreach($wdr_categories as $wdr_cat)
|
116 |
-
{
|
117 |
-
//Remove This OLD CODE WP DATE REMOVER
|
118 |
-
//if($this->wp_date_remover_options['removedt_'.$wdr_cat->term_id])
|
119 |
-
if(get_term_meta($wdr_cat->term_id, 'wp-date-remover', true) == 1)
|
120 |
-
{
|
121 |
-
if(!in_array($wdr_cat->term_id,$wdr_cat_arry))
|
122 |
-
{
|
123 |
-
array_push($wdr_cat_arry,$wdr_cat->term_id);
|
124 |
-
}
|
125 |
-
}
|
126 |
-
}
|
127 |
-
}
|
128 |
-
|
129 |
-
}
|
130 |
-
// remove date/time using php.
|
131 |
-
public function wp_date_remover_remove_date_php() {
|
132 |
-
global $wdr_cat_arry,$wdr_post_arry;
|
133 |
-
remove_filter('the_date', '__return_false');
|
134 |
-
remove_filter('the_time', '__return_false');
|
135 |
-
|
136 |
-
remove_filter('get_the_date', '__return_false');
|
137 |
-
remove_filter('get_the_time', '__return_false');
|
138 |
-
|
139 |
-
|
140 |
-
if(is_array($wdr_cat_arry) && !empty($wdr_cat_arry))
|
141 |
-
{
|
142 |
-
foreach($wdr_cat_arry as $term_id)
|
143 |
-
{
|
144 |
-
if(in_category($term_id,get_the_id()))
|
145 |
-
{
|
146 |
-
if(!in_array(get_the_id(),$wdr_post_arry))
|
147 |
-
{
|
148 |
-
array_push($wdr_post_arry,get_the_id());
|
149 |
-
}
|
150 |
-
add_filter('the_date', '__return_false');
|
151 |
-
add_filter('the_time', '__return_false');
|
152 |
-
|
153 |
-
add_filter('get_the_date', '__return_false');
|
154 |
-
add_filter('get_the_time', '__return_false');
|
155 |
-
|
156 |
-
break;
|
157 |
-
}
|
158 |
-
}
|
159 |
-
}
|
160 |
-
|
161 |
-
}
|
162 |
-
public function wp_date_remover_custom_script()
|
163 |
-
{
|
164 |
-
?>
|
165 |
-
<script type="text/javascript">
|
166 |
-
<?php
|
167 |
-
global $wdr_post_arry;
|
168 |
-
if(is_array($wdr_post_arry) && !empty($wdr_post_arry))
|
169 |
-
{
|
170 |
-
foreach($wdr_post_arry as $wdr_post_id)
|
171 |
-
{
|
172 |
-
?>
|
173 |
-
jQuery("#post-<?php echo $wdr_post_id?> .entry-meta .date").css("display","none");
|
174 |
-
jQuery("#post-<?php echo $wdr_post_id?> .entry-date").css("display","none");
|
175 |
-
jQuery("#post-<?php echo $wdr_post_id?> .posted-on").css("display","none");
|
176 |
-
<?php
|
177 |
-
}
|
178 |
-
|
179 |
-
}
|
180 |
-
?>
|
181 |
-
</script>
|
182 |
-
<?php
|
183 |
-
}
|
184 |
-
|
185 |
-
|
186 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* The public-facing functionality of the plugin.
|
5 |
+
*
|
6 |
+
* @link http://selmamariudottir.com
|
7 |
+
* @since 1.0.0
|
8 |
+
*
|
9 |
+
* @package Wp_Date_Remover
|
10 |
+
* @subpackage Wp_Date_Remover/public
|
11 |
+
*/
|
12 |
+
|
13 |
+
/**
|
14 |
+
* The public-facing functionality of the plugin.
|
15 |
+
*
|
16 |
+
* Defines the plugin name, version, and two examples hooks for how to
|
17 |
+
* enqueue the admin-specific stylesheet and JavaScript.
|
18 |
+
*
|
19 |
+
* @package Wp_Date_Remover
|
20 |
+
* @subpackage Wp_Date_Remover/public
|
21 |
+
* @author Selma Mariudottir <selma@selmamariudottir.com>
|
22 |
+
*/
|
23 |
+
class Wp_Date_Remover_Public {
|
24 |
+
|
25 |
+
/**
|
26 |
+
* The ID of this plugin.
|
27 |
+
*
|
28 |
+
* @since 1.0.0
|
29 |
+
* @access private
|
30 |
+
* @var string $plugin_name The ID of this plugin.
|
31 |
+
*/
|
32 |
+
private $plugin_name;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* The version of this plugin.
|
36 |
+
*
|
37 |
+
* @since 1.0.0
|
38 |
+
* @access private
|
39 |
+
* @var string $version The current version of this plugin.
|
40 |
+
*/
|
41 |
+
private $version;
|
42 |
+
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Initialize the class and set its properties.
|
46 |
+
*
|
47 |
+
* @since 1.0.0
|
48 |
+
* @param string $plugin_name The name of the plugin.
|
49 |
+
* @param string $version The version of this plugin.
|
50 |
+
*/
|
51 |
+
public function __construct( $plugin_name, $version ) {
|
52 |
+
|
53 |
+
$this->plugin_name = $plugin_name;
|
54 |
+
$this->version = $version;
|
55 |
+
$this->wp_date_remover_options = get_option($this->plugin_name);
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Register the stylesheets for the public-facing side of the site.
|
60 |
+
*
|
61 |
+
* @since 1.0.0
|
62 |
+
*/
|
63 |
+
public function enqueue_styles() {
|
64 |
+
|
65 |
+
/**
|
66 |
+
* This function is provided for demonstration purposes only.
|
67 |
+
*
|
68 |
+
* An instance of this class should be passed to the run() function
|
69 |
+
* defined in Wp_Date_Remover_Loader as all of the hooks are defined
|
70 |
+
* in that particular class.
|
71 |
+
*
|
72 |
+
* The Wp_Date_Remover_Loader will then create the relationship
|
73 |
+
* between the defined hooks and the functions defined in this
|
74 |
+
* class.
|
75 |
+
*/
|
76 |
+
|
77 |
+
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wp-date-remover-public.css', array(), $this->version, 'all' );
|
78 |
+
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Register the JavaScript for the public-facing side of the site.
|
83 |
+
*
|
84 |
+
* @since 1.0.0
|
85 |
+
*/
|
86 |
+
public function enqueue_scripts() {
|
87 |
+
|
88 |
+
/**
|
89 |
+
* This function is provided for demonstration purposes only.
|
90 |
+
*
|
91 |
+
* An instance of this class should be passed to the run() function
|
92 |
+
* defined in Wp_Date_Remover_Loader as all of the hooks are defined
|
93 |
+
* in that particular class.
|
94 |
+
*
|
95 |
+
* The Wp_Date_Remover_Loader will then create the relationship
|
96 |
+
* between the defined hooks and the functions defined in this
|
97 |
+
* class.
|
98 |
+
*/
|
99 |
+
|
100 |
+
wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wp-date-remover-public.js', array( 'jquery' ), $this->version, false );
|
101 |
+
|
102 |
+
}
|
103 |
+
|
104 |
+
public function wp_date_remover_remove() {
|
105 |
+
global $wdr_cat_arry,$wdr_post_arry;
|
106 |
+
$wdr_cat_arry=array();
|
107 |
+
$wdr_post_arry=array();
|
108 |
+
$wdr_args = array(
|
109 |
+
'orderby' => 'name',
|
110 |
+
'order' => 'ASC'
|
111 |
+
);
|
112 |
+
$wdr_categories = get_categories($wdr_args);
|
113 |
+
if(is_array($wdr_categories) && !empty($wdr_categories))
|
114 |
+
{
|
115 |
+
foreach($wdr_categories as $wdr_cat)
|
116 |
+
{
|
117 |
+
//Remove This OLD CODE WP DATE REMOVER
|
118 |
+
//if($this->wp_date_remover_options['removedt_'.$wdr_cat->term_id])
|
119 |
+
if(get_term_meta($wdr_cat->term_id, 'wp-date-remover', true) == 1)
|
120 |
+
{
|
121 |
+
if(!in_array($wdr_cat->term_id,$wdr_cat_arry))
|
122 |
+
{
|
123 |
+
array_push($wdr_cat_arry,$wdr_cat->term_id);
|
124 |
+
}
|
125 |
+
}
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
}
|
130 |
+
// remove date/time using php.
|
131 |
+
public function wp_date_remover_remove_date_php() {
|
132 |
+
global $wdr_cat_arry,$wdr_post_arry;
|
133 |
+
remove_filter('the_date', '__return_false');
|
134 |
+
remove_filter('the_time', '__return_false');
|
135 |
+
remove_filter('the_modified_date', '__return_false');
|
136 |
+
remove_filter('get_the_date', '__return_false');
|
137 |
+
remove_filter('get_the_time', '__return_false');
|
138 |
+
remove_filter('get_the_modified_date', '__return_false');
|
139 |
+
|
140 |
+
if(is_array($wdr_cat_arry) && !empty($wdr_cat_arry))
|
141 |
+
{
|
142 |
+
foreach($wdr_cat_arry as $term_id)
|
143 |
+
{
|
144 |
+
if(in_category($term_id,get_the_id()))
|
145 |
+
{
|
146 |
+
if(!in_array(get_the_id(),$wdr_post_arry))
|
147 |
+
{
|
148 |
+
array_push($wdr_post_arry,get_the_id());
|
149 |
+
}
|
150 |
+
add_filter('the_date', '__return_false');
|
151 |
+
add_filter('the_time', '__return_false');
|
152 |
+
add_filter('the_modified_date', '__return_false');
|
153 |
+
add_filter('get_the_date', '__return_false');
|
154 |
+
add_filter('get_the_time', '__return_false');
|
155 |
+
add_filter('get_the_modified_date', '__return_false');
|
156 |
+
break;
|
157 |
+
}
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
}
|
162 |
+
public function wp_date_remover_custom_script()
|
163 |
+
{
|
164 |
+
?>
|
165 |
+
<script type="text/javascript">
|
166 |
+
<?php
|
167 |
+
global $wdr_post_arry;
|
168 |
+
if(is_array($wdr_post_arry) && !empty($wdr_post_arry))
|
169 |
+
{
|
170 |
+
foreach($wdr_post_arry as $wdr_post_id)
|
171 |
+
{
|
172 |
+
?>
|
173 |
+
jQuery("#post-<?php echo $wdr_post_id?> .entry-meta .date").css("display","none");
|
174 |
+
jQuery("#post-<?php echo $wdr_post_id?> .entry-date").css("display","none");
|
175 |
+
jQuery("#post-<?php echo $wdr_post_id?> .posted-on").css("display","none");
|
176 |
+
<?php
|
177 |
+
}
|
178 |
+
|
179 |
+
}
|
180 |
+
?>
|
181 |
+
</script>
|
182 |
+
<?php
|
183 |
+
}
|
184 |
+
|
185 |
+
|
186 |
+
}
|
wp-date-remover.php
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
* Plugin Name: WP Date Remover
|
17 |
* Plugin URI: http://wpdateremover.com/
|
18 |
* Description: WP Date Remover allows you to quickly and easily remove the time and date from specific post categories.
|
19 |
-
* Version: 1.1.
|
20 |
* Author: Selma Mariudottir
|
21 |
* Author URI: http://selmamariudottir.com
|
22 |
* License: GPL-2.0+
|
16 |
* Plugin Name: WP Date Remover
|
17 |
* Plugin URI: http://wpdateremover.com/
|
18 |
* Description: WP Date Remover allows you to quickly and easily remove the time and date from specific post categories.
|
19 |
+
* Version: 1.1.1
|
20 |
* Author: Selma Mariudottir
|
21 |
* Author URI: http://selmamariudottir.com
|
22 |
* License: GPL-2.0+
|