-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Template part 'replace' flow - don't show currently used template par…
…t as option. (#31720) * filter out current entity, apply message where necessary * hide replace button when no options exist * ensure boolean for enableSelection * reverse params on createTemplatePartId function * refactor group title translation to helper function, re-add fallback we should never see * make new button primary when the only button * contextual instructions based on options * fix test * fix other test
- Loading branch information
1 parent
7bd73e0
commit b3826d7
Showing
6 changed files
with
132 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/block-library/src/template-part/edit/utils/create-template-part-id.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Generates a template part Id based on slug and theme inputs. | ||
* | ||
* @param {string} theme the template part's theme. | ||
* @param {string} slug the template part's slug | ||
* @return {string|null} the template part's Id. | ||
*/ | ||
export function createTemplatePartId( theme, slug ) { | ||
return theme && slug ? theme + '//' + slug : null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters