Skip to content

Commit

Permalink
Consistency: replace $this with static::class when calling static met…
Browse files Browse the repository at this point in the history
…hods.
  • Loading branch information
Atanas Vasilev committed Jul 19, 2024
1 parent 5839f74 commit 637d700
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/Container/Nav_Menu_Item_Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct( $id, $title, $type, $condition_collection, $conditi
}

// Register the custom edit walker only once
$callable = array( $this, 'edit_walker' );
$callable = array( static::class, 'edit_walker' );
if ( ! has_filter( 'wp_edit_nav_menu_walker', $callable ) ) {
add_filter( 'wp_edit_nav_menu_walker', $callable, 10, 2 );
}
Expand Down
4 changes: 2 additions & 2 deletions core/Field/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ public function get_type() {
public function activate() {
$this->admin_init();

add_action( 'admin_print_footer_scripts', array( $this, 'admin_hook_scripts' ), 5 );
add_action( 'admin_print_footer_scripts', array( $this, 'admin_hook_styles' ), 5 );
add_action( 'admin_print_footer_scripts', array( static::class, 'admin_hook_scripts' ), 5 );
add_action( 'admin_print_footer_scripts', array( static::class, 'admin_hook_styles' ), 5 );
static::activate_field_type( get_class( $this ) );

do_action( 'carbon_fields_field_activated', $this );
Expand Down

0 comments on commit 637d700

Please sign in to comment.