diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml new file mode 100644 index 0000000..ceb2443 --- /dev/null +++ b/.github/workflows/phpcs.yml @@ -0,0 +1,20 @@ +name: PHPCS check + +on: pull_request + +jobs: + phpcs: + name: PHPCS + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + run: composer install --dev --prefer-dist --no-progress --no-suggest + + - name: PHPCS check + uses: chekalsky/phpcs-action@v1 + with: + enable_warnings: true + phpcs_bin_path: './vendor/bin/phpcs' diff --git a/README.md b/README.md index 26c37d3..b696674 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Tags:** post, unlist posts, hide posts, **Requires at least:** 4.4 **Tested up to:** 5.6 -**Stable tag:** 1.1.1 +**Stable tag:** 1.1.2 **License:** GPLv2 or later **License URI:** http://www.gnu.org/licenses/gpl-2.0.html @@ -37,6 +37,9 @@ Just select option "Unlist Post" in any post of any type and that post will be h ## Changelog ## +### 1.1.2 ### +- Fix: Post metabox did not show the correct status if the post is unlisted or not in the classic editor. + ### 1.1.1 ### - Improvement: Added the WordPress 5.6 compatibilty. diff --git a/class-unlist-posts-admin.php b/class-unlist-posts-admin.php index 24f4783..117d4eb 100644 --- a/class-unlist-posts-admin.php +++ b/class-unlist-posts-admin.php @@ -83,7 +83,7 @@ function metabox_render( $post ) { $checked = ''; - if ( in_array( $post->ID, $hidden_posts, true ) ) { + if ( in_array( (int) $post->ID, $hidden_posts, true ) ) { $checked = 'checked'; } diff --git a/composer.json b/composer.json index 567436d..45699fc 100644 --- a/composer.json +++ b/composer.json @@ -1,9 +1,10 @@ { - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "wp-coding-standards/wpcs": "dev-master", - "phpcompatibility/phpcompatibility-wp": "*" - }, - "require": { - } + "name": "brainstormforce/unlist-posts", + "description": "Unlist Posts from displaying anywhere on the site, only access the post with a direct link.", + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "phpcompatibility/phpcompatibility-wp": "*", + "wp-coding-standards/wpcs": "^2" + }, + "require": {} } diff --git a/phpcs.ruleset.xml b/phpcs.ruleset.xml deleted file mode 100644 index 210c25a..0000000 --- a/phpcs.ruleset.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - Generally-applicable sniffs for WordPress plugins - - - - - */node_modules/* - */vendor/* - diff --git a/readme.txt b/readme.txt index 31be65c..4a0de61 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ 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.1 +Stable tag: 1.1.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -37,6 +37,9 @@ Just select option "Unlist Post" in any post of any type and that post will be h == Changelog == += 1.1.2 = +- Fix: Post metabox did not show the correct status if the post is unlisted or not in the classic editor. + = 1.1.1 = - Improvement: Added the WordPress 5.6 compatibilty. diff --git a/unlist-posts.php b/unlist-posts.php index 58e7834..3930b9e 100644 --- a/unlist-posts.php +++ b/unlist-posts.php @@ -7,7 +7,7 @@ * Author URI: https://www.nikhilchavan.com/ * Text Domain: unlist-posts * Domain Path: /languages - * Version: 1.1.1 + * Version: 1.1.2 * * @package Hide_Post */ @@ -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.1' ); +define( 'UNLIST_POSTS_VER', '1.1.2' ); require_once UNLIST_POSTS_DIR . 'class-unlist-posts.php';