From 445825d8df13b7a7464892bc8093d9b76f79815a Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Fri, 6 Dec 2019 12:03:07 +0000 Subject: [PATCH 1/2] Access the new API endpoint for editing the site title --- package-lock.json | 4 ++-- packages/block-library/src/site-title/edit.js | 4 ++-- packages/core-data/src/entities.js | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3036560328e42..ae106a9794763 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22812,7 +22812,7 @@ "dependencies": { "clone-deep": { "version": "0.2.4", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-0.2.4.tgz", + "resolved": "http://registry.npmjs.org/clone-deep/-/clone-deep-0.2.4.tgz", "integrity": "sha1-TnPdCen7lxzDhnDF3O2cGJZIHMY=", "dev": true, "requires": { @@ -22846,7 +22846,7 @@ "dependencies": { "kind-of": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-2.0.1.tgz", + "resolved": "http://registry.npmjs.org/kind-of/-/kind-of-2.0.1.tgz", "integrity": "sha1-AY7HpM5+OobLkUG+UZ0kyPqpgbU=", "dev": true, "requires": { diff --git a/packages/block-library/src/site-title/edit.js b/packages/block-library/src/site-title/edit.js index 0294fb82d17a1..20d784e6e2cca 100644 --- a/packages/block-library/src/site-title/edit.js +++ b/packages/block-library/src/site-title/edit.js @@ -10,10 +10,10 @@ import { __ } from '@wordpress/i18n'; import { RichText } from '@wordpress/block-editor'; export default function SiteTitleEdit() { - const [ title, setTitle ] = useEntityProp( 'root', 'site', 'title' ); + const [ title, setTitle ] = useEntityProp( 'root', 'siteTitle', 'title' ); const [ isDirty, isSaving, save ] = __experimentalUseEntitySaving( 'root', - 'site', + 'siteTitle', 'title' ); return ( diff --git a/packages/core-data/src/entities.js b/packages/core-data/src/entities.js index ec4c3712da6d1..2ecbfd7ca5a74 100644 --- a/packages/core-data/src/entities.js +++ b/packages/core-data/src/entities.js @@ -13,6 +13,7 @@ export const DEFAULT_ENTITY_KEY = 'id'; export const defaultEntities = [ { name: 'site', kind: 'root', baseURL: '/wp/v2/settings' }, + { name: 'siteTitle', kind: 'root', baseURL: '/wp/v2/settings/title' }, { name: 'postType', kind: 'root', key: 'slug', baseURL: '/wp/v2/types' }, { name: 'media', kind: 'root', baseURL: '/wp/v2/media', plural: 'mediaItems' }, { name: 'taxonomy', kind: 'root', key: 'slug', baseURL: '/wp/v2/taxonomies', plural: 'taxonomies' }, From 54118c39868be19efd92e73fc315a88981917e86 Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Mon, 9 Dec 2019 13:52:59 +0000 Subject: [PATCH 2/2] update the API to use /settings/publc --- packages/block-library/src/site-title/edit.js | 4 ++-- packages/core-data/src/entities.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/block-library/src/site-title/edit.js b/packages/block-library/src/site-title/edit.js index 20d784e6e2cca..dc51af555a966 100644 --- a/packages/block-library/src/site-title/edit.js +++ b/packages/block-library/src/site-title/edit.js @@ -10,10 +10,10 @@ import { __ } from '@wordpress/i18n'; import { RichText } from '@wordpress/block-editor'; export default function SiteTitleEdit() { - const [ title, setTitle ] = useEntityProp( 'root', 'siteTitle', 'title' ); + const [ title, setTitle ] = useEntityProp( 'root', 'public', 'title' ); const [ isDirty, isSaving, save ] = __experimentalUseEntitySaving( 'root', - 'siteTitle', + 'public', 'title' ); return ( diff --git a/packages/core-data/src/entities.js b/packages/core-data/src/entities.js index 2ecbfd7ca5a74..f34e8686af509 100644 --- a/packages/core-data/src/entities.js +++ b/packages/core-data/src/entities.js @@ -13,7 +13,7 @@ export const DEFAULT_ENTITY_KEY = 'id'; export const defaultEntities = [ { name: 'site', kind: 'root', baseURL: '/wp/v2/settings' }, - { name: 'siteTitle', kind: 'root', baseURL: '/wp/v2/settings/title' }, + { name: 'public', kind: 'root', baseURL: '/wp/v2/settings/public' }, { name: 'postType', kind: 'root', key: 'slug', baseURL: '/wp/v2/types' }, { name: 'media', kind: 'root', baseURL: '/wp/v2/media', plural: 'mediaItems' }, { name: 'taxonomy', kind: 'root', key: 'slug', baseURL: '/wp/v2/taxonomies', plural: 'taxonomies' },