-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes made in the Customizer are not being logged #308
Comments
I'm your man! |
😍 !!! |
@fjarrett @westonruter I'm on a good way to complete this. What do you guys think about the Context here? Is it better to use |
Yeah, what if the title for the Customizer Section was used for the context? Or maybe it would beed to be "Customizer: Section Title"? |
@powelski @westonruter Not sure we need to be creating any unique contexts for the Customizer, the contexts for each field already exist in their respective connectors (Settings, Widgets, Menus). We could just add a Then this could still be queried easily using the keyword search, without losing the appropriate connector/context assignment: |
Good idea. It is not really important that it was edited in the Customizer anyway. It's a “by the way” piece of information. |
@fjarrett @westonruter It might be a problem to know the context from option name alone. I thought there will access from Ideas? |
@powelski what are you trying to look up? I realize that you may have the same problem with customizer controls as you faced when tracking changes to options, as customizer controls are just wrappers around options. One customizer control, in fact, may have multiple settings (options) associated with it, so we wouldn't be able to use the control really to discern what the setting's label is. In terms of the customizer sections, however, this should be possible. When the |
@westonruter I'm not sure if I was clear enough. I was talking about context of the option. Like context for Site Title option is General. Those can be found in |
@westonruter Up :) |
@powelski sorry I've not been able to carve out time to check this out further yet. |
I've been diving into Customizer integration (specifically for widgets) in #391. So the reason why I believe that the cache would always get primed because |
I think this was closed accidentally. |
#391 didn't actually address the changing all settings in the customizer, just the ones for widgets. I think that comment was a carry-over from when the PR was a WIP. |
@westonruter This thread is pretty old, but it's still an issue. Would you have time to look into this? Or could you recommend a place to start? |
@lukecarbis hey, I don't have time to look into it, but I do have a recommended starting place: The <?php
add_action( 'customize_save', function ( \WP_Customize_Manager $wp_customize ) {
$actions_added = array();
foreach ( $wp_customize->settings() as $setting ) {
/** @var \WP_Customize_Setting $setting */
$id_base = strtok( $setting->id, '[' );
if ( isset( $actions_added[ $id_base ] ) ) {
continue;
}
add_action( "customize_save_{$id_base}", function( \WP_Customize_Setting $setting ) {
// @todo Now log the Stream action here.
/*
* Obtaining the name for the Stream action will be a bit tricky, and will
* not be bulletproof. Basically what you have to do is iterate over
* $wp_customize->controls() and try to find a control that is associated
* with this $setting. Then you can try to use $control->label. Beware,
* however, that a control can be associated with multiple settings.
*/
} );
$actions_added[ $id_base ] = true;
}
}, 100 ); |
After clicking Save & Publish in the Customizer no records are being logged by Stream for changes that were performed.
We'll need to improve the following connectors so that these changes are always tracked:
/cc @westonruter
The text was updated successfully, but these errors were encountered: