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 was archived by the owner on Dec 16, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 16, 2022. It is now read-only.
Allow customize_loaded_components filter to remove posts component #132
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.
@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.
Currently there is one
customize_loaded_componentsfilter which handles the injection of theWP_Customize_Postsinstance intoWP_Customize_Manager:There should be another
customize_loaded_componentsfilter that runs earlier at priority 0 which amendspoststo the list of components. Then the later filter can check to see ofpostsis in the array and then only instantiateWP_Customize_Postsif it is present.This would allow plugins to use a more standard way to selectively disable the
postscomponent.