@@ -6,16 +6,16 @@ class Core extends Plugin {
66 function __construct () {
77
88 // Example - Add page, post type and parent classes to <body> tag for selector targeting
9- add_filter ( 'body_class ' , array ( & $ this , 'add_body_classes ' ) );
9+ add_filter ( 'body_class ' , array ( $ this , 'add_body_classes ' ) );
1010
1111 // Example - Remove Emoji code from header
12- if ( $ this ->get_carbon_plugin_option ( 'remove_header_emojicons ' ) ) {
13- if ( ! $ this -> is_ajax () ) add_filter ( 'init ' , array ( & $ this , 'disable_wp_emojicons ' ) );
12+ if ( ! $ this -> is_ajax () && $ this ->get_carbon_plugin_option ( 'remove_header_emojicons ' ) ) {
13+ add_filter ( 'init ' , array ( $ this , 'disable_wp_emojicons ' ) );
1414 }
1515
1616 // Multisite Example - Change WP Admin footer text
1717 if ( is_multisite () && trim ( $ this ->get_carbon_network_option ( 'network_site_footer ' ) ) ) {
18- add_filter ( 'admin_footer_text ' , array ( & $ this , 'set_admin_footer_text ' ) );
18+ add_filter ( 'admin_footer_text ' , array ( $ this , 'set_admin_footer_text ' ) );
1919 }
2020
2121 /**
@@ -27,8 +27,8 @@ function __construct() {
2727 */
2828 if ( current_user_can ( 'manage_options ' ) && $ this ->get_carbon_plugin_option ( 'admin_bar_add_clear_cache ' ) ) {
2929 add_action ( 'admin_bar_menu ' , array ( $ this , 'admin_bar_add_clear_cache ' ), 900 );
30- //add_action( 'wp_ajax_nopriv_clear_object_cache_ajax', array( self::$cache , 'flush ' ) );
31- add_action ( 'wp_ajax_clear_object_cache_ajax ' , array ( self :: $ cache , 'flush ' ) );
30+ //add_action( 'wp_ajax_nopriv_clear_object_cache_ajax', array( $this , 'clear_object_cache_ajax ' ) );
31+ add_action ( 'wp_ajax_clear_object_cache_ajax ' , array ( $ this , 'clear_object_cache_ajax ' ) );
3232 }
3333
3434 }
@@ -111,11 +111,11 @@ public function admin_bar_add_clear_cache( $wp_admin_bar ) {
111111 */
112112 public function clear_object_cache_ajax () {
113113
114- $ result = ['success ' => true ];
114+ $ result = [ 'success ' => true ];
115115
116116 try {
117117 self ::$ cache ->flush ();
118- } catch (Exception $ e ) {
118+ } catch ( Exception $ e ) {
119119 $ result = [ 'success ' => false , 'message ' => $ e ->getMessage () ];
120120 }
121121
0 commit comments