List of Hooks in WordPress Core JavaScript

As promised quite a while ago (better late than never), here is a list of all trigger style hooks in WordPress core JavaScript.

These demonstrate a wide variety of approaches to adding hook in JavaScript. A few of these may not really fit well into the list but I include them in for completeness.

  • [autosave.dev.js:325] jQuery(document).triggerHandler(‘wpcountwords’, [ post_data[“content”] ]);
  • [controls.js:731] triggerCallback: function(cbName, arg) {
  • [customize-base.dev.js:296] this.trigger( ‘add’, value );
  • [customize-base.dev.js:321] this.trigger( ‘remove’, value );
  • [customize-base.dev.js:377] this.parent.trigger( ‘change’, this );
  • [customize-base.dev.js:547] this.trigger( message.id, message.data );
  • [customize-controls.dev.js:714] api.trigger( ‘save’, request );
  • [customize-controls.dev.js:739] api.trigger( ‘saved’ );
  • [customize-controls.dev.js:811] api.trigger( ‘activated’ );
  • [customize-controls.dev.js:952] api.trigger( ‘ready’ );
  • [customize-loader.dev.js:42] this.window.triggerHandler( ‘hashchange’ );
  • [customize-loader.dev.js:114] this.trigger( ‘open’ );
  • [customize-loader.dev.js:126] this.trigger( ‘close’ );
  • [customize-preview.dev.js:75] preview.trigger( ‘settings’, api.settings.values );
  • [customize-preview.dev.js:88] preview.trigger( event, args );
  • [editor.dev.js:220] jQuery(‘body’).trigger(‘beforePreWpautop’, [o]);
  • [editor.dev.js:223] jQuery(‘body’).trigger(‘afterPreWpautop’, [o]);
  • [editor.dev.js:233] jQuery(‘body’).trigger(‘beforeWpautop’, [o]);
  • [editor.dev.js:236] jQuery(‘body’).trigger(‘afterWpautop’, [o]);
  • [post.dev.js:622] $(document).triggerHandler(‘wpcountwords’, [ co.val() ]);
  • [post.dev.js:631] $(document).triggerHandler(‘wpcountwords’, [ co.val() ]);
  • [thickbox.js:165] if ( ! jQuery(document).triggerHandler( ‘wp_CloseOnEscape’, [{ event: e, what: ‘thickbox’, cb: tb_remove }] ) )
  • [thickbox.js:256] if ( ! jQuery(document).triggerHandler( ‘wp_CloseOnEscape’, [{ event: e, what: ‘thickbox’, cb: tb_remove }] ) )
  • [thickbox.js:278] jQuery(“#TB_window”).fadeOut(“fast”,function(){jQuery(‘#TB_window,#TB_overlay,#TB_HideSelect’).trigger(“tb_unload”).unbind().remove();});
  • [wp-fullscreen.dev.js:245] $(document).triggerHandler(‘wpcountwords’, [ content ]);
  • [wp-fullscreen.dev.js:563] if ( ! jQuery(document).triggerHandler( ‘wp_CloseOnEscape’, [data] ) )
  • [wp-fullscreen.dev.js:589] $(document).triggerHandler(‘wpcountwords’, [ txtarea.val() ]);
  • [wp-lists.dev.js:132] $(list).trigger( ‘wpListAddEnd’, [ s, list.wpList ] );
  • [wp-lists.dev.js:187] $(list).trigger( ‘wpListDelEnd’, [ s, list.wpList ] );
  • [wp-lists.dev.js:191] $(list).trigger( ‘wpListDelEnd’, [ s, list.wpList ] );
  • [wp-lists.dev.js:271] $(list).trigger( ‘wpListDimEnd’, [ s, list.wpList ] );
  • [wp-lists.dev.js:275] $(list).trigger( ‘wpListDimEnd’, [ s, list.wpList ] );
  • [wplink.dev.js:348] if ( ! $(document).triggerHandler( ‘wp_CloseOnEscape’, [{ event: event, what: ‘wplink’, cb: wpLink.close }] ) )
  • [wplink.dev.js:466] this.element.trigger(‘river-select’, [ li, event, this ]);

One response to “List of Hooks in WordPress Core JavaScript

  1. Pingback: Things learned from Wordcamp 2012 | Inderpreet Singh

Leave a Reply

Your email address will not be published. Required fields are marked *