From 9accef30b78cb10843657c2e8d3277141f34e8c9 Mon Sep 17 00:00:00 2001 From: 10upbot on GitHub <10upbot+github@10up.com> Date: Thu, 18 Jan 2024 17:29:54 +0000 Subject: [PATCH] Committing built version of e0d8218eadfd2e1deab7bf8bda85b807bf6f5330 --- .github/workflows/lint.yml | 2 +- CHANGELOG.md | 12 ++++++++++++ dist/css/admin.min.css | 2 +- dist/js/admin-css.min.asset.php | 2 +- dist/js/gutenberg-plugin.min.asset.php | 2 +- dist/js/gutenberg-plugin.min.js | 2 +- distributor.php | 4 ++-- includes/classes/DistributorPost.php | 12 +++++++++++- lang/distributor.pot | 27 ++++---------------------- readme.txt | 2 +- 10 files changed, 35 insertions(+), 32 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8c4917b62..7ec971b0a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -55,7 +55,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - id: changed-files - uses: tj-actions/changed-files@v36 + uses: tj-actions/changed-files@v41 with: files: | **/*.php diff --git a/CHANGELOG.md b/CHANGELOG.md index adc753703..806ccad89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file, per [the Ke ## [Unreleased] - TBD +## [2.0.3] - 2024-01-18 +### Added +- New filter, `dt_post_to_pull`, that allows modifying the post to be pulled (props [@leogermani](https://github.com/leogermani), [@peterwilsoncc](https://github.com/peterwilsoncc), [@dkotter](https://github.com/dkotter) via [#1181](https://github.com/10up/distributor/pull/1181)). + +### Fixed +- Ensure the code snippet for keeping the original post date is correct (props [@leogermani](https://github.com/leogermani), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#1160](https://github.com/10up/distributor/pull/1160)). + +### Security +- Bump `tj-actions/changed-files` from 36 to 41 (props [@dependabot[bot]](https://github.com/apps/dependabot), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#1172](https://github.com/10up/distributor/pull/1172)). +- Bump `@wordpress/scripts` from 26.6.0 to 26.19.0 (props [@dependabot[bot]](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#1174](https://github.com/10up/distributor/pull/1174)). + ## [2.0.2] - 2023-11-29 ### Added - New snippet detailing how to disable automatic content updates (props [@dkotter](https://github.com/dkotter), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#1145](https://github.com/10up/distributor/pull/1145)). @@ -504,6 +515,7 @@ This adds a post type selector when viewing the Pull Content list for both exter - Initial closed release. [Unreleased]: https://github.com/10up/distributor/compare/trunk...develop +[2.0.3]: https://github.com/10up/distributor/compare/2.0.2...2.0.3 [2.0.2]: https://github.com/10up/distributor/compare/2.0.1...2.0.2 [2.0.1]: https://github.com/10up/distributor/compare/2.0.0...2.0.1 [2.0.0]: https://github.com/10up/distributor/compare/1.9.1...2.0.0 diff --git a/dist/css/admin.min.css b/dist/css/admin.min.css index 004e8ee4d..2a59f8ffe 100644 --- a/dist/css/admin.min.css +++ b/dist/css/admin.min.css @@ -1 +1 @@ -.js-auth-app-card em,.js-auth-app-card kbd{display:none}.js-auth-app-card #app_name{border:none;box-shadow:none;width:380px}.js-auth-app-card label{font-size:14px;font-weight:700}@media (min-width:783px){body.is-showing-distributor.is-fullscreen-mode #wpadminbar{display:block}body.is-showing-distributor.is-fullscreen-mode .interface-interface-skeleton{top:32px}}.distributor-panel .components-panel__body-title svg{height:20px;width:20px}.distributor-toggle{margin-bottom:8px}.distributor-title--settings{align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;position:relative}.distributor-title--settings .distributor-title__text{flex:0 1 auto}.distributor-title--settings a.distributor-help-link{display:inline-block;flex:0 0 auto;line-height:0;margin-left:.5em;text-decoration:none}.distributor-title--settings a.distributor-help-link:not(:hover) span{color:#9ea3a8}.distributor-title--settings a.distributor-help-link .distributor-help-link__text{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px} +.js-auth-app-card em,.js-auth-app-card kbd{display:none}.js-auth-app-card #app_name{border:none;box-shadow:none;width:380px}.js-auth-app-card label{font-size:14px;font-weight:700}@media (min-width:783px){body.is-showing-distributor.is-fullscreen-mode #wpadminbar{display:block}body.is-showing-distributor.is-fullscreen-mode .interface-interface-skeleton{top:32px}}.distributor-panel .components-panel__body-title svg{height:20px;width:20px}.distributor-toggle{margin-bottom:8px}.distributor-title--settings{align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;position:relative}.distributor-title--settings .distributor-title__text{flex:0 1 auto}.distributor-title--settings a.distributor-help-link{display:inline-block;flex:0 0 auto;line-height:0;margin-left:.5em;text-decoration:none}.distributor-title--settings a.distributor-help-link:not(:hover) span{color:#9ea3a8}.distributor-title--settings a.distributor-help-link .distributor-help-link__text{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important} diff --git a/dist/js/admin-css.min.asset.php b/dist/js/admin-css.min.asset.php index 7e235a358..f852929f4 100644 --- a/dist/js/admin-css.min.asset.php +++ b/dist/js/admin-css.min.asset.php @@ -1 +1 @@ - array('wp-polyfill'), 'version' => '9a7e1b6ae7baeea80d4c'); + array('wp-polyfill'), 'version' => '8220a935bcadeb95c3f2'); diff --git a/dist/js/gutenberg-plugin.min.asset.php b/dist/js/gutenberg-plugin.min.asset.php index 10e32d72c..8ed9ac44e 100644 --- a/dist/js/gutenberg-plugin.min.asset.php +++ b/dist/js/gutenberg-plugin.min.asset.php @@ -1 +1 @@ - array('wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-primitives'), 'version' => 'e098cedb2b7751ef5b39'); + array('react', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-primitives'), 'version' => '97ad6470ab1749788a36'); diff --git a/dist/js/gutenberg-plugin.min.js b/dist/js/gutenberg-plugin.min.js index 1eebca4f8..aa3e19325 100644 --- a/dist/js/gutenberg-plugin.min.js +++ b/dist/js/gutenberg-plugin.min.js @@ -1 +1 @@ -(()=>{"use strict";const t=window.wp.element,e=window.wp.primitives,i=(0,t.createElement)(e.SVG,{width:"20",height:"20",viewBox:"13.4 8.8 573.2 573.2",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(e.Path,{d:"M195.113 411.033c45.835 46.692 119.124 58.488 178.387 24.273 70.262-40.566 94.371-130.544 53.806-200.806-40.566-70.262-130.544-94.371-200.806-53.806-19.873 11.474-36.055 26.899-48.124 44.715l64.722 33.186c22.201-25.593 59.796-33.782 91.279-17.639 37.002 18.973 51.64 64.418 32.667 101.421-18.973 37.002-64.418 51.64-101.421 32.667-31.483-16.143-46.776-51.45-38.951-84.415l-81.702-41.892c-8.838-4.532-12.335-15.367-7.814-24.211 15.514-30.346 39.658-56.715 71.344-75.009 87.469-50.5 199.482-20.486 249.983 66.983 50.5 87.469 20.486 199.482-66.983 249.983-75.235 43.437-168.63 27.307-225.419-33.717-17.809 3.778-36.797-4.055-46.387-20.666-11.922-20.648-4.837-47.091 15.812-59.012 20.648-11.922 47.091-4.836 59.012 15.812 7.77 13.458 7.466 29.377.595 42.133Z"}),(0,t.createElement)(e.Path,{d:"M262.237 72.985C148.8 91.101 62 189.494 62 308c0 131.356 106.644 238 238 238s238-106.644 238-238c0-34.059-7.168-66.458-20.08-95.766-15.121.99-30.323-6.014-39.137-19.626-12.959-20.014-7.231-46.783 12.783-59.742 20.014-12.958 46.783-7.231 59.742 12.783 10.095 15.592 8.849 35.284-1.657 49.352C565.288 229.461 574 267.721 574 308c0 151.225-122.775 274-274 274S26 459.225 26 308C26 170.539 127.443 56.584 259.487 36.98 265.594 20.533 281.438 8.8 300 8.8c23.843 0 43.2 19.357 43.2 43.2 0 23.843-19.357 43.2-43.2 43.2-16.229 0-30.38-8.968-37.763-22.215Z"})),n=window.wp.components,s=window.wp.data,r=window.wp.editPost,o=window.wp.i18n,l=window.wp.plugins,{document:c,dt:u,dtGutenberg:a,MouseEvent:d}=window,p=()=>{const e=c.body.classList;if(0!==parseInt(a.syndicationTime))return null;const i=c.querySelector("#wp-admin-bar-distributor"),n=c.querySelector("#wp-admin-bar-distributor > a");if(!i||!n)return(0,t.createElement)("div",{className:"distributor-toggle"},(0,t.createElement)("span",null,(0,o.__)("Refresh page to see distribution options","distributor")));const r=(0,s.select)("core/edit-post").isFeatureActive("fullscreenMode");return(0,t.createElement)("div",{className:"distributor-toggle"},(0,t.createElement)("button",{className:"components-button is-secondary",type:"button",onClick:()=>{const t=new d("mouseenter");r?e.add("is-showing-distributor"):e.remove("is-showing-distributor"),i.classList.toggle("hover"),n.dispatchEvent(t)}},(0,o.sprintf)((0,o.__)("Distribute %1$s","distributor"),a.postTypeSingular.toLowerCase()||(0,o._x)("content","generic term for post content","distributor"))))},m=()=>0!==parseInt(a.syndicationTime)?null:(0,t.createElement)("p",null,(0,o.__)("Distribution options available once published","distributor")),b=()=>0(0,t.createElement)("span",{id:"distributed-to"},(0,o.sprintf)((0,o._n)("Distributed to %1$s connection.","Distributed to %1$s connections.",1*a.syndicationCount,"distributor"),a.syndicationCount)),g=()=>(0,t.createElement)("span",{id:"distributed-from"},(0,o.sprintf)((0,o.__)("Distributed on: %1$s","distributor"),a.syndicationTime)),E=()=>(0,t.createElement)(n.Icon,{className:"components-panel__icon",icon:i,size:20});(0,l.registerPlugin)("distributor-plugin",{render:()=>{if(a.noPermissions&&1===parseInt(a.noPermissions))return null;const e=(0,s.useSelect)((t=>t("core/editor").getCurrentPostType())),i=(0,s.useSelect)((t=>t("core/editor").getCurrentPostAttribute("status")));if(a.supportedPostTypes&&void 0===a.supportedPostTypes[e])return null;const n=c.querySelector("#wp-admin-bar-distributor"),l=(0,s.useSelect)((t=>t("core/editor").getCurrentPost()));return u.postTitle=l.title,u.postStatus=l.status,a.supportedPostStati&&!a.supportedPostStati.includes(i)?(n?.classList.add("hide"),(0,t.createElement)(r.PluginDocumentSettingPanel,{title:(0,o.__)("Distributor","distributor"),icon:E,className:"distributor-panel"},(0,t.createElement)(m,null),(0,t.createElement)(b,null))):(n?.classList.remove("hide"),(0,t.createElement)(r.PluginDocumentSettingPanel,{title:(0,o.__)("Distributor","distributor"),icon:E,className:"distributor-panel"},(0,t.createElement)(p,null),(0,t.createElement)(b,null)))}})})(); \ No newline at end of file +(()=>{"use strict";const t=window.React,e=window.wp.primitives,i=(0,t.createElement)(e.SVG,{width:"20",height:"20",viewBox:"13.4 8.8 573.2 573.2",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(e.Path,{d:"M195.113 411.033c45.835 46.692 119.124 58.488 178.387 24.273 70.262-40.566 94.371-130.544 53.806-200.806-40.566-70.262-130.544-94.371-200.806-53.806-19.873 11.474-36.055 26.899-48.124 44.715l64.722 33.186c22.201-25.593 59.796-33.782 91.279-17.639 37.002 18.973 51.64 64.418 32.667 101.421-18.973 37.002-64.418 51.64-101.421 32.667-31.483-16.143-46.776-51.45-38.951-84.415l-81.702-41.892c-8.838-4.532-12.335-15.367-7.814-24.211 15.514-30.346 39.658-56.715 71.344-75.009 87.469-50.5 199.482-20.486 249.983 66.983 50.5 87.469 20.486 199.482-66.983 249.983-75.235 43.437-168.63 27.307-225.419-33.717-17.809 3.778-36.797-4.055-46.387-20.666-11.922-20.648-4.837-47.091 15.812-59.012 20.648-11.922 47.091-4.836 59.012 15.812 7.77 13.458 7.466 29.377.595 42.133Z"}),(0,t.createElement)(e.Path,{d:"M262.237 72.985C148.8 91.101 62 189.494 62 308c0 131.356 106.644 238 238 238s238-106.644 238-238c0-34.059-7.168-66.458-20.08-95.766-15.121.99-30.323-6.014-39.137-19.626-12.959-20.014-7.231-46.783 12.783-59.742 20.014-12.958 46.783-7.231 59.742 12.783 10.095 15.592 8.849 35.284-1.657 49.352C565.288 229.461 574 267.721 574 308c0 151.225-122.775 274-274 274S26 459.225 26 308C26 170.539 127.443 56.584 259.487 36.98 265.594 20.533 281.438 8.8 300 8.8c23.843 0 43.2 19.357 43.2 43.2 0 23.843-19.357 43.2-43.2 43.2-16.229 0-30.38-8.968-37.763-22.215Z"})),n=window.wp.components,s=window.wp.data,r=window.wp.editPost,o=window.wp.i18n,l=window.wp.plugins,{document:c,dt:u,dtGutenberg:a,MouseEvent:d}=window,p=()=>{const e=c.body.classList;if(0!==parseInt(a.syndicationTime))return null;const i=c.querySelector("#wp-admin-bar-distributor"),n=c.querySelector("#wp-admin-bar-distributor > a");if(!i||!n)return(0,t.createElement)("div",{className:"distributor-toggle"},(0,t.createElement)("span",null,(0,o.__)("Refresh page to see distribution options","distributor")));const r=(0,s.select)("core/edit-post").isFeatureActive("fullscreenMode");return(0,t.createElement)("div",{className:"distributor-toggle"},(0,t.createElement)("button",{className:"components-button is-secondary",type:"button",onClick:()=>{const t=new d("mouseenter");r?e.add("is-showing-distributor"):e.remove("is-showing-distributor"),i.classList.toggle("hover"),n.dispatchEvent(t)}},(0,o.sprintf)((0,o.__)("Distribute %1$s","distributor"),a.postTypeSingular.toLowerCase()||(0,o._x)("content","generic term for post content","distributor"))))},m=()=>0!==parseInt(a.syndicationTime)?null:(0,t.createElement)("p",null,(0,o.__)("Distribution options available once published","distributor")),b=()=>0(0,t.createElement)("span",{id:"distributed-to"},(0,o.sprintf)((0,o._n)("Distributed to %1$s connection.","Distributed to %1$s connections.",1*a.syndicationCount,"distributor"),a.syndicationCount)),g=()=>(0,t.createElement)("span",{id:"distributed-from"},(0,o.sprintf)((0,o.__)("Distributed on: %1$s","distributor"),a.syndicationTime)),E=()=>(0,t.createElement)(n.Icon,{className:"components-panel__icon",icon:i,size:20});(0,l.registerPlugin)("distributor-plugin",{render:()=>{if(a.noPermissions&&1===parseInt(a.noPermissions))return null;const e=(0,s.useSelect)((t=>t("core/editor").getCurrentPostType())),i=(0,s.useSelect)((t=>t("core/editor").getCurrentPostAttribute("status")));if(a.supportedPostTypes&&void 0===a.supportedPostTypes[e])return null;const n=c.querySelector("#wp-admin-bar-distributor"),l=(0,s.useSelect)((t=>t("core/editor").getCurrentPost()));return u.postTitle=l.title,u.postStatus=l.status,a.supportedPostStati&&!a.supportedPostStati.includes(i)?(n?.classList.add("hide"),(0,t.createElement)(r.PluginDocumentSettingPanel,{title:(0,o.__)("Distributor","distributor"),icon:E,className:"distributor-panel"},(0,t.createElement)(m,null),(0,t.createElement)(b,null))):(n?.classList.remove("hide"),(0,t.createElement)(r.PluginDocumentSettingPanel,{title:(0,o.__)("Distributor","distributor"),icon:E,className:"distributor-panel"},(0,t.createElement)(p,null),(0,t.createElement)(b,null)))}})})(); \ No newline at end of file diff --git a/distributor.php b/distributor.php index 95b8d2894..d65067e2c 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.2 + * Version: 2.0.3 * 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.2' ); +define( 'DT_VERSION', '2.0.3' ); 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/classes/DistributorPost.php b/includes/classes/DistributorPost.php index d1b5c3645..96e965704 100644 --- a/includes/classes/DistributorPost.php +++ b/includes/classes/DistributorPost.php @@ -918,7 +918,17 @@ protected function to_pull_list( $args = array() ) { $display_data['distributor_original_site_name'] = $this->source_site['name']; $display_data['distributor_original_site_url'] = $this->source_site['home_url']; - return $display_data; + /** + * Filters the post data for when they are being formated for a pull + * + * @since 2.0.3 + * @hook dt_post_to_pull + * + * @param {array} $display_data The post data. + * + * @return {array} Modified post data. + */ + return apply_filters( 'dt_post_to_pull', $display_data ); } /** diff --git a/lang/distributor.pot b/lang/distributor.pot index ff9915170..6fda930e5 100644 --- a/lang/distributor.pot +++ b/lang/distributor.pot @@ -1,15 +1,15 @@ -# Copyright (C) 2023 10up Inc. +# Copyright (C) 2024 10up Inc. # This file is distributed under the GPLv2 or later. msgid "" msgstr "" -"Project-Id-Version: Distributor 2.0.2\n" +"Project-Id-Version: Distributor 2.0.3\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/distributor\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2023-11-29T21:39:26+00:00\n" +"POT-Creation-Date: 2024-01-18T17:29:51+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.9.0\n" "X-Domain: distributor\n" @@ -612,6 +612,7 @@ msgid "Distributor not installed on remote site." msgstr "" #: dist/js/admin-external-connection.min.js:1 +#: release/dist/js/admin-external-connection.min.js:1 msgid "Authentication failed due to insufficient or invalid credentials." msgstr "" @@ -749,23 +750,3 @@ msgid "Selected connection (%d)" msgid_plural "Selected connections (%d)" msgstr[0] "" msgstr[1] "" - -#: release/dist/js/admin-external-connection.min.js:1 -msgid "Limited connection established." -msgstr "" - -#: release/dist/js/admin-external-connection.min.js:1 -msgid "Authentication failed due to invalid credentials." -msgstr "" - -#: release/dist/js/admin-external-connection.min.js:1 -msgid "Authentication succeeded but your account does not have permissions to create posts on the external site." -msgstr "" - -#: release/dist/js/admin-external-connection.min.js:1 -msgid "Push distribution unavailable." -msgstr "" - -#: release/dist/js/admin-external-connection.min.js:1 -msgid "Pull distribution limited to basic content, i.e. title and content body." -msgstr "" diff --git a/readme.txt b/readme.txt index aa38668b9..3e7d28617 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: content, distribution, syndication, management Requires at least: 5.7 Tested up to: 6.4 Requires PHP: 7.4 -Stable tag: 2.0.2 +Stable tag: 2.0.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html