#41786 closed enhancement (wontfix)
Action introduction before button to save customizer settings data.
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.4 |
Component: | Customize | Keywords: | |
Focuses: | ui, administration | Cc: |
Description
In a project I am working on, we need to add an icon indication before the "Save & Publish" customizer button.
This patch introduces an Action before the button.
Attachments (1)
Change History (8)
#2
@
8 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
@Collizo4sky hi, for this you'll want to use JavaScript to add the desired element to the Customizer. You may refer to the Customize Snapshots plugin for an example. You can see that this addButtons
function gets called in a wp.customize.bind( 'ready, ... )
event callback.
#3
@
8 years ago
@westonruter But there is no harm in adding an action there. What can possibly go wrong?
#4
@
8 years ago
Actions and filters should only be added where required, when there is no alternative solution or established practice in place. Otherwise, it just adds bloat to WordPress.
#5
@
8 years ago
@westonruter Not everyone is that great with JavaScript. Adding an action will make our life easier compared to going the javascript route. WordPress has lot's of actions and filters already, I don't see adding just one more reducing the bloat-ness of WordPress.
Kindly please reconsider your stance on this. I am sure a lot of persons who need to add something before the button will prefer this over the JS solution you linked to above.
#6
@
8 years ago
@Collizo4sky Here is a simple standalone example for what you can do without adding a new action:
<?php add_action( 'customize_controls_print_footer_scripts', function() { ?> <script> jQuery( function( $ ) { $( '#customize-header-actions' ).prepend( $( '<span>Hello!</span>' ) ); } ); </script> <?php } );
Can you please commit this @westonruter 🙏