#38013 closed feature request (fixed)
Static Front Page section/controls should be contextual and allow assignment to page stubs
Reported by: | westonruter | Owned by: | westonruter |
---|---|---|---|
Milestone: | 4.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Customize | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
With the introduction of the ability to add new page stubs via Nav Menu Items (#34923) this also brings focus to the Static Front Page. If there are no created published pages, the registration of this section and its controls is skipped entirely (checking get_pages()
). However, since a page (stub) can actually be created inside the customizer, it would stand to reason that this newly created page should also be able to be assigned as the static front page or page for posts.
There are a few part to this:
- Register
static_front_page
section and controls regardless if there are published pages, and addactive_callbacks
that return true if0 !== count( get_pages( 'number' => 1 ) )
- Sync the page stubs created via nav menus into the
dropdown-pages
controls forpage_on_front
andpage_for_posts
. - And then lastly there is providing a seamless way to actually edit the content of these pages that get assigned to the homepage or the page for posts. See #38002 (Customize: provide a path to editing posts created in nav menus)
Related: #16379 (Better UI for doing "Page on Front")
Attachments (7)
Change History (21)
#2
@
8 years ago
Polyfill added to the Customize Posts plugin in https://github.com/xwp/wp-customize-posts/pull/254/files
#3
@
8 years ago
- Keywords needs-patch added
- Milestone changed from Future Release to 4.7
We should tackle this in 4.7 to build on the ability to make page stubs with menus. Ideally, we'd be able to use the same functions and primarily focus work here on integrating it with this particular UI. This is also important for Twenty Seventeen.
It sounds like we can take 38013.0.diff and add an additional control to add a new page (perhaps matching the UI from menus with a visible input + button, with the button adding to the select element and hiding the input).
This ticket was mentioned in Slack in #core-customize by celloexpressions. View the logs.
8 years ago
This ticket was mentioned in Slack in #core by celloexpressions. View the logs.
8 years ago
#6
@
8 years ago
- Keywords has-patch added; needs-patch removed
In 38013.1.diff:
- Activate Static Front Page controls when a new page stub is created.
- Ensure that
dropdown-pages
control gets aselect
even if there are no pages created. - Add newly-created page stubs to
dropdown-pages
controls. - Remove
active_callback
from section to inherit contextual active state from controls.
#7
@
8 years ago
In 38013.2.diff, switch to letting static_front_page
section be contextual rather than the controls. This makes sense because if there aren't any pages then the “Static Front Page” section shouldn't be there. It also improves compatibility with when the page_on_front
and page_for_posts
controls get proper active_callback
s themselves. See #29948.
#8
@
8 years ago
As also noted on #38002, here's a Customize Posts integration with the dropdown-pages
control:
Notice the edit and create buttons.
Pull request that includes this code: https://github.com/xwp/wp-customize-posts/pull/272
This ticket was mentioned in Slack in #core-customize by celloexpressions. View the logs.
8 years ago
#10
@
8 years ago
- Keywords commit added
- Owner set to westonruter
- Status changed from new to reviewing
38013.4.diff looks ready to commit for adding page stubs to these selects and making them contextual to having pages.
I think we should also look at the ability to add new auto-draft pages here in this ticket, or a new one for 4.7. We should try to keep that separate from the Select2 work for now if possible. It sounds like #16379 is not a good place to pursue that work.
38013.0.diff implements the contextual (active callback) part, mostly.
The second part (syncing the created pages to the
page_for_posts
andpage_for_posts
controls) is facilitated by the control in the Customize Object Selector feature plugin:Note that the Object Selector Control also integrates with Customize Posts in that it will display a “Add New” button which will cause a new page to be created and allow you to edit its fields right in the customizer. Collapsing the section for the newly-created page brings you back then to the static front page control with the newly-created page then selected.
So too, the Customize Posts will provide a way to edit page stubs created in the customizer. (See wp-customize-posts#253).