diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d8a5b429..299dfb4f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file, per [the Ke ## [2.0.0] - TBD **Note that Distributor now requires PHP 7.4 or later and WordPress 5.7 or later.** -_This entry was generated for the 2.0.0-beta2 release and will be updated during the Beta and Release Candidate processes._ +_This entry was generated for the 2.0.0-rc1 release and will be updated during the Beta and Release Candidate processes._ ### Added - Migration guide for version 1 to version 2 (props [@peterwilsoncc](https://github.com/peterwilsoncc), [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul) via [#996](https://github.com/10up/distributor/pull/996)). @@ -27,7 +27,7 @@ _This entry was generated for the 2.0.0-beta2 release and will be updated during - Now requires PHP 7.4 or later and WordPress 5.7 or later (props [@peterwilsoncc](https://github.com/peterwilsoncc), [@vikrampm1](https://github.com/vikrampm1), [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter) via [#917](https://github.com/10up/distributor/pull/917)). - Descriptive warning message copy on remote, distributed posts (props [@jeffpaul](https://github.com/jeffpaul), [@peterwilsoncc](https://github.com/peterwilsoncc), [@cadic](https://github.com/cadic) via [#1006](https://github.com/10up/distributor/pull/1006)). - Indicate if the origin post has been deleted in Distributor push interface (props [@peterwilsoncc](https://github.com/peterwilsoncc), [@cadic](https://github.com/cadic), [@jeffpaul](https://github.com/jeffpaul), [@faisal-alvi](https://github.com/faisal-alvi) via [#1067](https://github.com/10up/distributor/pull/1067)). -- Toggles the Distributor admin bar element in Gutenberg based on the post status (props [@ggutenberg](https://github.com/ggutenberg), [@jeffpaul](https://github.com/jeffpaul), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#1022](https://github.com/10up/distributor/pull/1022)). +- Toggles the Distributor admin bar element in Gutenberg based on the post status (props [@ggutenberg](https://github.com/ggutenberg), [@jeffpaul](https://github.com/jeffpaul), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#1022](https://github.com/10up/distributor/pull/1022), [#1114](https://github.com/10up/distributor/pull/1114)). - Reduced duplicate code pushing posts to connections (props [@peterwilsoncc](https://github.com/peterwilsoncc), [@cadic](https://github.com/cadic), [@jeffpaul](https://github.com/jeffpaul), [@faisal-alvi](https://github.com/faisal-alvi), [@aaronware](https://github.com/aaronware) via [#999](https://github.com/10up/distributor/pull/999)). - Unified translator comments (props [@peterwilsoncc](https://github.com/peterwilsoncc), [@cadic](https://github.com/cadic) via [#949](https://github.com/10up/distributor/pull/949)). - WordPress "tested up to" version 6.2 (props [@jayedul](https://github.com/jayedul), [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul) via [#1047](https://github.com/10up/distributor/pull/1047)). @@ -61,6 +61,7 @@ _This entry was generated for the 2.0.0-beta2 release and will be updated during - Bump `loader-utils` from 2.0.2 to 2.0.4 (props [@dependabot[bot]](https://github.com/apps/dependabot), [@jeffpaul](https://github.com/jeffpaul), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#963](https://github.com/10up/distributor/pull/963), [#970](https://github.com/10up/distributor/pull/970)). - Bump `simple-git` from 3.11.0 to 3.15.1 (props [@dependabot[bot]](https://github.com/apps/dependabot), [@jeffpaul](https://github.com/jeffpaul), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#983](https://github.com/10up/distributor/pull/983)). - Bump `webpack` from 5.74.0 to 5.76.2 (props [@dependabot[bot]](https://github.com/apps/dependabot), [@jeffpaul](https://github.com/jeffpaul), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#1029](https://github.com/10up/distributor/pull/1029), [#1032](https://github.com/10up/distributor/pull/1032)). +- Bump `word-wrap` from 1.2.3 to 1.2.4 (props [@dependabot[bot]](https://github.com/apps/dependabot), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#1116](https://github.com/10up/distributor/pull/1116)). ## [1.9.1] - 2023-03-15 ### Security diff --git a/assets/js/gutenberg-plugin.js b/assets/js/gutenberg-plugin.js index 6d8306c24..2fe6800c2 100644 --- a/assets/js/gutenberg-plugin.js +++ b/assets/js/gutenberg-plugin.js @@ -187,8 +187,9 @@ const DistributorPlugin = () => { const post = useSelect( ( select ) => select( 'core/editor' ).getCurrentPost() ); - // Make the post title available to the top menu. + // Make the post title and status available to the top menu. dt.postTitle = post.title; + dt.postStatus = post.status; // If we are on a non-supported post status, change what we show if ( diff --git a/assets/js/push.js b/assets/js/push.js index eb26e12db..4846c8185 100755 --- a/assets/js/push.js +++ b/assets/js/push.js @@ -50,7 +50,6 @@ jQuery( window ).on( 'load', () => { let selectAllConnections = ''; let selectNoConnections = ''; let connectionsSearchInput = ''; - let postStatusInput = ''; let asDraftInput = ''; let errorDetails = ''; @@ -91,7 +90,6 @@ jQuery( window ).on( 'load', () => { connectionsSearchInput = document.getElementById( 'dt-connection-search' ); - postStatusInput = document.getElementById( 'dt-post-status' ); asDraftInput = document.getElementById( 'dt-as-draft' ); errorDetails = document.querySelector( '.dt-error ul.details' ); @@ -516,7 +514,7 @@ jQuery( window ).on( 'load', () => { data.postStatus = null !== asDraftInput && asDraftInput.checked ? 'draft' - : postStatusInput.value; + : dt.postStatus; const xhr = dt.usexhr ? { withCredentials: true } : false; diff --git a/distributor.php b/distributor.php index c0ccad235..e031d2a56 100644 --- a/distributor.php +++ b/distributor.php @@ -4,7 +4,7 @@ * Plugin URI: https://github.com/10up/distributor * Update URI: https://distributorplugin.com * Description: Makes it easy to distribute and reuse content across your websites, whether inside of a multisite or across the web. - * Version: 2.0.0-beta2 + * Version: 2.0.0-rc1 * Requires at least: 5.7 * Requires PHP: 7.4 * Author: 10up Inc. @@ -28,7 +28,7 @@ exit; // Exit if accessed directly. } -define( 'DT_VERSION', '2.0.0-beta2' ); +define( 'DT_VERSION', '2.0.0-rc1' ); define( 'DT_PLUGIN_FILE', preg_replace( '#^.*plugins/(.*)$#i', '$1', __FILE__ ) ); define( 'DT_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); define( 'DT_PLUGIN_FULL_FILE', __FILE__ ); diff --git a/includes/push-ui.php b/includes/push-ui.php index b58a5ad7e..d883425ed 100644 --- a/includes/push-ui.php +++ b/includes/push-ui.php @@ -414,6 +414,7 @@ function enqueue_scripts( $hook ) { 'loadConnectionsNonce' => wp_create_nonce( 'dt-load-connections' ), 'postId' => (int) get_the_ID(), 'postTitle' => get_the_title(), + 'postStatus' => get_post_status(), 'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ), /** diff --git a/package-lock.json b/package-lock.json index 6de36b4b1..fb17111ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "distributor", - "version": "2.0.0-beta.2", + "version": "2.0.0-rc.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "distributor", - "version": "2.0.0-beta.2", + "version": "2.0.0-rc.1", "license": "GPL-2.0-or-later", "dependencies": { "mustache": "^4.2.0" @@ -18602,9 +18602,9 @@ "dev": true }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -32724,9 +32724,9 @@ "dev": true }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true }, "workerpool": { diff --git a/package.json b/package.json index 2486c3b4e..293d85be0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "distributor", - "version": "2.0.0-beta.2", + "version": "2.0.0-rc.1", "description": "Distributor is a WordPress plugin that makes it easy to distribute and reuse content across your websites — whether in a single multisite or across the web.", "author": { "name": "10up", diff --git a/templates/show-connections-amp.php b/templates/show-connections-amp.php index 98cdda683..a50833b5d 100644 --- a/templates/show-connections-amp.php +++ b/templates/show-connections-amp.php @@ -55,7 +55,6 @@ class="add-connection{{#syndicated}} syndicated{{/syndicated}}"
- post_status ) ? true : false; /** diff --git a/templates/show-connections.php b/templates/show-connections.php index cbc74ae68..cdfeb7c2f 100644 --- a/templates/show-connections.php +++ b/templates/show-connections.php @@ -53,7 +53,6 @@ class="add-connection<# if ( ! _.isEmpty( connections[ key ]['syndicated'] ) ) {
- post_status ) ? true : false; /** diff --git a/tests/php/bootstrap.php b/tests/php/bootstrap.php index 2f7552642..9ebbc224d 100644 --- a/tests/php/bootstrap.php +++ b/tests/php/bootstrap.php @@ -10,7 +10,7 @@ WP_Mock::bootstrap(); define( 'DT_PLUGIN_PATH', dirname( __DIR__, 2 ) ); -define( 'DT_VERSION', '2.0.0-beta2' ); +define( 'DT_VERSION', '2.0.0-rc1' ); require_once __DIR__ . '/includes/common.php'; require_once __DIR__ . '/includes/TestCase.php';