Update demo of adding pluggable function wrappers to add actions / hooks above functions

This commit is contained in:
Alex Wright 2018-03-29 12:39:09 -05:00
parent 554f362643
commit 3114c1bda6
1 changed files with 5 additions and 3 deletions

View File

@ -9,11 +9,12 @@
* Registers an editor stylesheet for the theme. * Registers an editor stylesheet for the theme.
*/ */
add_action( 'admin_init', 'understrap_wpdocs_theme_add_editor_styles' );
if ( ! function_exists ( 'understrap_wpdocs_theme_add_editor_styles' ) ) { if ( ! function_exists ( 'understrap_wpdocs_theme_add_editor_styles' ) ) {
function understrap_wpdocs_theme_add_editor_styles() { function understrap_wpdocs_theme_add_editor_styles() {
add_editor_style( 'css/custom-editor-style.min.css' ); add_editor_style( 'css/custom-editor-style.min.css' );
} }
add_action( 'admin_init', 'understrap_wpdocs_theme_add_editor_styles' );
} }
// Add TinyMCE style formats. // Add TinyMCE style formats.
@ -27,6 +28,9 @@ if ( ! function_exists ( 'understrap_tiny_mce_style_formats' ) ) {
} }
} }
add_filter( 'tiny_mce_before_init', 'understrap_tiny_mce_before_init' );
if ( ! function_exists ( 'understrap_tiny_mce_before_init' ) ) { if ( ! function_exists ( 'understrap_tiny_mce_before_init' ) ) {
function understrap_tiny_mce_before_init( $settings ) { function understrap_tiny_mce_before_init( $settings ) {
@ -68,5 +72,3 @@ if ( ! function_exists ( 'understrap_tiny_mce_before_init' ) ) {
return $settings; return $settings;
} }
} }
add_filter( 'tiny_mce_before_init', 'understrap_tiny_mce_before_init' );