You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Full Site Editing]: Expand the templates that can be added - custom taxonomies, specific term, specific category and tag (#41875)
* [Full Site Editing]: Expand the templates that can be added - custom taxonomies, specific term, specific category and tag
* refactor: remove extraneous exports
* refactor: SuggestionList
* refactor: SuggestionListItem
* refactor: NewTemplate (first pass)
Isolate all template-computing logic in a macro hook (useMarkPersistent)
* config: add getOrderBy
* refactor: aliasTemplateSlug -> templateSlug
Also rename and move some other variables for clarity.
* minor comment tweaks
* Update packages/edit-site/src/components/add-new-template/new-template.js
Co-authored-by: Miguel Fonseca <miguelcsf@gmail.com>
Co-authored-by: Miguel Fonseca <miguelcsf@gmail.com>
// translators: Represents the title of a user's custom template in the Site Editor, where %1$s is the singular name of a post type or taxonomy and %2$s is the name of the post or term, e.g. "Post: Hello, WordPress", "Category: shoes"
// translators: Represents the description of a user's custom template in the Site Editor, e.g. "Template for Post: Hello, WordPress"
49
+
__('Template for %1$s'),
50
+
title
51
+
),
52
+
slug: newTemplateSlug,
53
+
};
54
+
onSelect(newTemplate);
55
+
}
33
56
34
57
functionSuggestionListItem({
35
58
suggestion,
@@ -46,23 +69,9 @@ function SuggestionListItem( {
46
69
as={Button}
47
70
{ ...composite}
48
71
className={baseCssClass}
49
-
onClick={()=>{
50
-
consttitle=sprintf(
51
-
// translators: Represents the title of a user's custom template in the Site Editor, where %1$s is the singular name of a post type and %2$s is the name of the post, e.g. "Post: Hello, WordPress"
52
-
__('%1$s: %2$s'),
53
-
entityForSuggestions.labels.singular_name,
54
-
suggestion.name
55
-
);
56
-
onSelect({
57
-
title,
58
-
description: sprintf(
59
-
// translators: Represents the description of a user's custom template in the Site Editor, e.g. "Template for Post: Hello, WordPress"
0 commit comments