Skip to content

Commit 4c83fab

Browse files
authored
Merge pull request #51 from brainstormforce/wp57-compatibility
Remove deprecated for wp_no_robots and use escaping for string.
2 parents ebd295b + d1a309f commit 4c83fab

7 files changed

+29
-21
lines changed

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
**Donate link:** https://www.paypal.me/BrainstormForce
44
**Tags:** post, unlist posts, hide posts,
55
**Requires at least:** 4.4
6-
**Tested up to:** 5.6
7-
**Stable tag:** 1.1.2
6+
**Tested up to:** 5.7
7+
**Stable tag:** 1.1.3
88
**License:** GPLv2 or later
99
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -37,6 +37,10 @@ Just select option "Unlist Post" in any post of any type and that post will be h
3737

3838
## Changelog ##
3939

40+
### 1.1.3 ###
41+
- Deprecated: wp_no_robots() has been deprecated.
42+
- Security: Use escaping for displaying unlist post description.
43+
4044
### 1.1.2 ###
4145
- Fix: Post metabox did not show the correct status if the post is unlisted or not in the classic editor.
4246

class-unlist-posts-admin.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ function metabox_render( $post ) {
9292
?>
9393
<p>
9494
<label class="checkbox-inline">
95-
<input name="unlist_posts" type="checkbox" <?php echo esc_attr( $checked ); ?> value=""><?php _e( 'Unlist this post?', 'unlist-posts' ); ?>
95+
<input name="unlist_posts" type="checkbox" <?php echo esc_attr( $checked ); ?> value=""><?php esc_html_e( 'Unlist this post?', 'unlist-posts' ); ?>
9696
</label>
9797
</p>
98-
<p class="description"><?php _e( 'This will hide the post from your site, The post can only be accessed from direct URL.', 'unlist-posts' ); ?> </p>
98+
<p class="description"><?php esc_html_e( 'This will hide the post from your site, The post can only be accessed from direct URL.', 'unlist-posts' ); ?> </p>
9999
<?php
100100
}
101101

class-unlist-posts.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function hide_post_from_searchengines() {
150150
$hidden_posts = get_option( 'unlist_posts', array() );
151151

152152
if ( in_array( get_the_ID(), $hidden_posts, true ) && false !== get_the_ID() ) {
153-
wp_no_robots();
153+
add_filter( 'wp_robots', 'wp_robots_no_robots' );
154154
}
155155
}
156156

languages/unlist-posts.pot

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Copyright (C) 2019 Nikhil Chavan
1+
# Copyright (C) 2021 Nikhil Chavan
22
# This file is distributed under the same license as the Unlist Posts & Pages package.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: Unlist Posts & Pages 1.0.4\n"
5+
"Project-Id-Version: Unlist Posts & Pages 1.1.3\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/unlist-posts\n"
7-
"POT-Creation-Date: 2019-01-10 06:14:02+00:00\n"
7+
"POT-Creation-Date: 2021-03-10 11:43:27+00:00\n"
88
"MIME-Version: 1.0\n"
99
"Content-Type: text/plain; charset=utf-8\n"
1010
"Content-Transfer-Encoding: 8bit\n"
11-
"PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
11+
"PO-Revision-Date: 2021-MO-DA HO:MI+ZONE\n"
1212
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1313
"Language-Team: LANGUAGE <[email protected]>\n"
1414
"Language: en\n"
@@ -24,21 +24,21 @@ msgstr ""
2424
"X-Textdomain-Support: yes\n"
2525
"X-Generator: grunt-wp-i18n 1.0.3\n"
2626

27-
#: class-unlist-posts-admin.php:57
27+
#: class-unlist-posts-admin.php:60
2828
msgid "Unlist Post"
2929
msgstr ""
3030

31-
#: class-unlist-posts-admin.php:92
31+
#: class-unlist-posts-admin.php:95
3232
msgid "Unlist this post?"
3333
msgstr ""
3434

35-
#: class-unlist-posts-admin.php:95
35+
#: class-unlist-posts-admin.php:98
3636
msgid ""
3737
"This will hide the post from your site, The post can only be accessed from "
3838
"direct URL."
3939
msgstr ""
4040

41-
#: class-unlist-posts-admin.php:167
41+
#: class-unlist-posts-admin.php:172 class-unlist-posts-admin.php:215
4242
msgid "Unlisted"
4343
msgstr ""
4444

@@ -62,4 +62,4 @@ msgstr ""
6262

6363
#. Author URI of the plugin/theme
6464
msgid "https://www.nikhilchavan.com/"
65-
msgstr ""
65+
msgstr ""

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "hide-post",
3-
"version": "1.1.1",
3+
"version": "1.1.3",
44
"main": "Gruntfile.js",
55
"author": "Nikhil Chavan",
66
"devDependencies": {
7-
"grunt": "^1.0.4",
8-
"grunt-wp-i18n": "~1.0.3",
7+
"grunt": "^1.3.0",
8+
"grunt-wp-i18n": "^1.0.3",
99
"grunt-wp-readme-to-markdown": "^2.0.1"
1010
}
1111
}

readme.txt

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Contributors: brainstormforce, Nikschavan
33
Donate link: https://www.paypal.me/BrainstormForce
44
Tags: post, unlist posts, hide posts,
55
Requires at least: 4.4
6-
Tested up to: 5.6
7-
Stable tag: 1.1.2
6+
Tested up to: 5.7
7+
Stable tag: 1.1.3
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -37,6 +37,10 @@ Just select option "Unlist Post" in any post of any type and that post will be h
3737

3838
== Changelog ==
3939

40+
= 1.1.3 =
41+
- Deprecated: wp_no_robots() has been deprecated.
42+
- Security: Use escaping for displaying unlist post description.
43+
4044
= 1.1.2 =
4145
- Fix: Post metabox did not show the correct status if the post is unlisted or not in the classic editor.
4246

unlist-posts.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Author URI: https://www.nikhilchavan.com/
88
* Text Domain: unlist-posts
99
* Domain Path: /languages
10-
* Version: 1.1.2
10+
* Version: 1.1.3
1111
*
1212
* @package Hide_Post
1313
*/
@@ -16,6 +16,6 @@
1616

1717
define( 'UNLIST_POSTS_DIR', plugin_dir_path( __FILE__ ) );
1818
define( 'UNLIST_POSTS_URI', plugins_url( '/', __FILE__ ) );
19-
define( 'UNLIST_POSTS_VER', '1.1.2' );
19+
define( 'UNLIST_POSTS_VER', '1.1.3' );
2020

2121
require_once UNLIST_POSTS_DIR . 'class-unlist-posts.php';

0 commit comments

Comments
 (0)