Clean up meta boxes via modules

This commit is contained in:
Brian Miyaji
2015-01-28 15:32:45 +11:00
parent 2146e83468
commit a2aa6470fb
4 changed files with 109 additions and 70 deletions

View File

@@ -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.
*/

View File

@@ -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.
*/

View File

@@ -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.
*/