Skip to content

Commit

Permalink
Merge pull request #51 from brainstormforce/wp57-compatibility
Browse files Browse the repository at this point in the history
Remove deprecated for wp_no_robots and use escaping for string.
  • Loading branch information
patilvikasj committed Mar 11, 2021
2 parents ebd295b + d1a309f commit 4c83fab
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 21 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
**Donate link:** https://www.paypal.me/BrainstormForce
**Tags:** post, unlist posts, hide posts,
**Requires at least:** 4.4
**Tested up to:** 5.6
**Stable tag:** 1.1.2
**Tested up to:** 5.7
**Stable tag:** 1.1.3
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

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

## Changelog ##

### 1.1.3 ###
- Deprecated: wp_no_robots() has been deprecated.
- Security: Use escaping for displaying unlist post description.

### 1.1.2 ###
- Fix: Post metabox did not show the correct status if the post is unlisted or not in the classic editor.

Expand Down
4 changes: 2 additions & 2 deletions class-unlist-posts-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ function metabox_render( $post ) {
?>
<p>
<label class="checkbox-inline">
<input name="unlist_posts" type="checkbox" <?php echo esc_attr( $checked ); ?> value=""><?php _e( 'Unlist this post?', 'unlist-posts' ); ?>
<input name="unlist_posts" type="checkbox" <?php echo esc_attr( $checked ); ?> value=""><?php esc_html_e( 'Unlist this post?', 'unlist-posts' ); ?>
</label>
</p>
<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>
<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>
<?php
}

Expand Down
2 changes: 1 addition & 1 deletion class-unlist-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function hide_post_from_searchengines() {
$hidden_posts = get_option( 'unlist_posts', array() );

if ( in_array( get_the_ID(), $hidden_posts, true ) && false !== get_the_ID() ) {
wp_no_robots();
add_filter( 'wp_robots', 'wp_robots_no_robots' );
}
}

Expand Down
18 changes: 9 additions & 9 deletions languages/unlist-posts.pot
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Copyright (C) 2019 Nikhil Chavan
# Copyright (C) 2021 Nikhil Chavan
# This file is distributed under the same license as the Unlist Posts & Pages package.
msgid ""
msgstr ""
"Project-Id-Version: Unlist Posts & Pages 1.0.4\n"
"Project-Id-Version: Unlist Posts & Pages 1.1.3\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/unlist-posts\n"
"POT-Creation-Date: 2019-01-10 06:14:02+00:00\n"
"POT-Creation-Date: 2021-03-10 11:43:27+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2021-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: en\n"
Expand All @@ -24,21 +24,21 @@ msgstr ""
"X-Textdomain-Support: yes\n"
"X-Generator: grunt-wp-i18n 1.0.3\n"

#: class-unlist-posts-admin.php:57
#: class-unlist-posts-admin.php:60
msgid "Unlist Post"
msgstr ""

#: class-unlist-posts-admin.php:92
#: class-unlist-posts-admin.php:95
msgid "Unlist this post?"
msgstr ""

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

#: class-unlist-posts-admin.php:167
#: class-unlist-posts-admin.php:172 class-unlist-posts-admin.php:215
msgid "Unlisted"
msgstr ""

Expand All @@ -62,4 +62,4 @@ msgstr ""

#. Author URI of the plugin/theme
msgid "https://www.nikhilchavan.com/"
msgstr ""
msgstr ""
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "hide-post",
"version": "1.1.1",
"version": "1.1.3",
"main": "Gruntfile.js",
"author": "Nikhil Chavan",
"devDependencies": {
"grunt": "^1.0.4",
"grunt-wp-i18n": "~1.0.3",
"grunt": "^1.3.0",
"grunt-wp-i18n": "^1.0.3",
"grunt-wp-readme-to-markdown": "^2.0.1"
}
}
8 changes: 6 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: brainstormforce, Nikschavan
Donate link: https://www.paypal.me/BrainstormForce
Tags: post, unlist posts, hide posts,
Requires at least: 4.4
Tested up to: 5.6
Stable tag: 1.1.2
Tested up to: 5.7
Stable tag: 1.1.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

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

== Changelog ==

= 1.1.3 =
- Deprecated: wp_no_robots() has been deprecated.
- Security: Use escaping for displaying unlist post description.

= 1.1.2 =
- Fix: Post metabox did not show the correct status if the post is unlisted or not in the classic editor.

Expand Down
4 changes: 2 additions & 2 deletions unlist-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Author URI: https://www.nikhilchavan.com/
* Text Domain: unlist-posts
* Domain Path: /languages
* Version: 1.1.2
* Version: 1.1.3
*
* @package Hide_Post
*/
Expand All @@ -16,6 +16,6 @@

define( 'UNLIST_POSTS_DIR', plugin_dir_path( __FILE__ ) );
define( 'UNLIST_POSTS_URI', plugins_url( '/', __FILE__ ) );
define( 'UNLIST_POSTS_VER', '1.1.2' );
define( 'UNLIST_POSTS_VER', '1.1.3' );

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

0 comments on commit 4c83fab

Please sign in to comment.