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
{{ message }}
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
There should be another customize_loaded_components filter that runs earlier at priority 0 which amends posts to the list of components. Then the later filter can check to see of posts is in the array and then only instantiate WP_Customize_Posts if it is present.
This would allow plugins to use a more standard way to selectively disable the posts component.
The text was updated successfully, but these errors were encountered:
A new filter adds 'posts' to the array of components in the Customizer.
WP_Customize_Posts is only instantiated if 'posts' is still present.
So a filter may remove 'posts', to disable it.
@westonruter,
Could you please review this pull request when you have a chance? It sets a new filter add_posts_to_customize_loaded_components. This adds 'posts' to the array of components in the Customizer. And WP_Customize_Posts is only instantiated if 'posts' is still present. So a later filter may remove 'posts', to disable it.
$wp_customize->posts is now only set if 'posts' isn't removed with a filter.
And before, removing it caused an error.
So if #wp_customize->posts is not set, return from load_support_classes.
Remove $wp_customize param and its DocBlock line--it's not used.
And reduce argument count in add_filter to 1.
Also, add 3rd argument true to in_array for strict evaluation.
Currently there is one
customize_loaded_components
filter which handles the injection of theWP_Customize_Posts
instance intoWP_Customize_Manager
:There should be another
customize_loaded_components
filter that runs earlier at priority 0 which amendsposts
to the list of components. Then the later filter can check to see ofposts
is in the array and then only instantiateWP_Customize_Posts
if it is present.This would allow plugins to use a more standard way to selectively disable the
posts
component.The text was updated successfully, but these errors were encountered: