From 0fb606a688dcbd2660a7a31ac5db6835d99c8452 Mon Sep 17 00:00:00 2001 From: Ned Zimmerman Date: Tue, 7 Jan 2020 16:38:52 -0700 Subject: [PATCH] Fix changelog --- CHANGELOG.md | 4 +++ readme.txt | 4 +++ src/sidebar/index.js | 84 -------------------------------------------- 3 files changed, 8 insertions(+), 84 deletions(-) delete mode 100644 src/sidebar/index.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ac2bbf..cd7dcce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ * Bump @wordpress/scripts from 6.0.0 to 6.1.1: #101 * Add support for custom authors: #102 +**Patches** + +* Bump autoprefixer from 9.7.2 to 9.7.3: #97 + ## 2.1.0 ## **Minor Changes** diff --git a/readme.txt b/readme.txt index 7eb3ac7..4dafcb7 100644 --- a/readme.txt +++ b/readme.txt @@ -52,6 +52,10 @@ None yet. * Bump @wordpress/scripts from 6.0.0 to 6.1.1: #101 * Add support for custom authors: #102 +**Patches** + +* Bump autoprefixer from 9.7.2 to 9.7.3: #97 + = 2.1.0 = **Minor Changes** diff --git a/src/sidebar/index.js b/src/sidebar/index.js deleted file mode 100644 index ac114e4..0000000 --- a/src/sidebar/index.js +++ /dev/null @@ -1,84 +0,0 @@ -import { registerPlugin } from '@wordpress/plugins'; -import { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/edit-post'; -import { __ } from '@wordpress/i18n'; -import { SelectControl } from '@wordpress/components'; -import { withDispatch, withSelect } from '@wordpress/data'; -import { Component, Fragment, compose } from '@wordpress/element'; - -class AuthorshipPlugin extends Component { - render() { - // Nested object destructuring. - const { - meta: { - pcc_post_authors: postAuthors, - } = {}, - updateMeta, - } = this.props; - - const authors = [ - { - value: '', - label: 'Use default author', - }, - { - value: '1567', - label: 'Danny Spitzberg', - }, - { - value: '742', - label: 'Trebor Scholz', - }, - ]; - - return ( - - - { __( 'Authorship', 'pcc-framework' ) } - - - updateMeta( { pcc_post_authors: value || '' } ) } - /> - - - ); - } -} - -// Fetch the post meta. -const applyWithSelect = withSelect( ( select ) => { - const { getEditedPostAttribute } = select( 'core/editor' ); - - return { - meta: getEditedPostAttribute( 'meta' ), - }; -} ); - -// Provide method to update post meta. -const applyWithDispatch = withDispatch( ( dispatch, { meta } ) => { - const { editPost } = dispatch( 'core/editor' ); - - return { - updateMeta( newMeta ) { - editPost( { meta: { ...meta, ...newMeta } } ); // Important: Old and new meta need to be merged in a non-mutating way! - }, - }; -} ); - -// Combine the higher-order components. -const render = compose( [ - applyWithSelect, - applyWithDispatch, -] )( AuthorshipPlugin ); - -registerPlugin( 'pcc-sidebar', { - icon: 'edit', - render, -} );