Clean up meta boxes via modules
This commit is contained in:
@@ -30,6 +30,7 @@ class SportsPress_Calendars {
|
||||
|
||||
// Actions
|
||||
add_action( 'init', array( $this, 'register_post_type' ) );
|
||||
add_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 10 );
|
||||
add_action( 'sportspress_include_post_type_handlers', array( $this, 'include_post_type_handler' ) );
|
||||
add_action( 'sportspress_widgets', array( $this, 'include_widgets' ) );
|
||||
|
||||
@@ -89,6 +90,15 @@ class SportsPress_Calendars {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove meta boxes.
|
||||
*/
|
||||
public function remove_meta_boxes() {
|
||||
remove_meta_box( 'sp_seasondiv', 'sp_calendar', 'side' );
|
||||
remove_meta_box( 'sp_leaguediv', 'sp_calendar', 'side' );
|
||||
remove_meta_box( 'sp_venuediv', 'sp_calendar', 'side' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Conditonally load the class and functions only needed when viewing this post type.
|
||||
*/
|
||||
|
||||
@@ -30,6 +30,7 @@ class SportsPress_League_Tables {
|
||||
|
||||
// Actions
|
||||
add_action( 'init', array( $this, 'register_post_type' ) );
|
||||
add_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 10 );
|
||||
add_action( 'sportspress_include_post_type_handlers', array( $this, 'include_post_type_handler' ) );
|
||||
add_action( 'sportspress_widgets', array( $this, 'include_widgets' ) );
|
||||
|
||||
@@ -89,6 +90,14 @@ class SportsPress_League_Tables {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove meta boxes.
|
||||
*/
|
||||
public function remove_meta_boxes() {
|
||||
remove_meta_box( 'sp_seasondiv', 'sp_table', 'side' );
|
||||
remove_meta_box( 'sp_leaguediv', 'sp_table', 'side' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Conditonally load the class and functions only needed when viewing this post type.
|
||||
*/
|
||||
|
||||
@@ -30,6 +30,7 @@ class SportsPress_Player_Lists {
|
||||
|
||||
// Actions
|
||||
add_action( 'init', array( $this, 'register_post_type' ) );
|
||||
add_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 10 );
|
||||
add_action( 'sportspress_include_post_type_handlers', array( $this, 'include_post_type_handler' ) );
|
||||
add_action( 'sportspress_widgets', array( $this, 'include_widgets' ) );
|
||||
|
||||
@@ -89,6 +90,14 @@ class SportsPress_Player_Lists {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove meta boxes.
|
||||
*/
|
||||
public function remove_meta_boxes() {
|
||||
remove_meta_box( 'sp_seasondiv', 'sp_list', 'side' );
|
||||
remove_meta_box( 'sp_leaguediv', 'sp_list', 'side' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Conditonally load the class and functions only needed when viewing this post type.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user