Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.
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

Description

@westonruter

Currently there is one customize_loaded_components filter which handles the injection of the WP_Customize_Posts instance into WP_Customize_Manager:

add_filter( 'customize_loaded_components', array( $this, 'filter_customize_loaded_components' ), 100, 2 );

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.

Activity

modified the milestone: on Aug 6, 2016
self-assigned this
on Aug 17, 2016
added a commit that references this issue on Aug 17, 2016

kienstra commented on Aug 17, 2016

@kienstra

Pull Request

@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.

added 3 commits that reference this issue on Aug 17, 2016
added a commit that references this issue on Aug 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions