Add filters to taxonomies and native editor to post types

This commit is contained in:
Brian Miyaji
2016-04-11 00:04:24 +10:00
parent 1a24e9fce3
commit 5be69ecb24
12 changed files with 17 additions and 227 deletions

View File

@@ -144,12 +144,6 @@ class SP_Admin_Meta_Boxes {
'context' => 'normal',
'priority' => 'high',
),
'editor' => array(
'title' => __( 'Article', 'sportspress' ),
'output' => 'SP_Meta_Box_Event_Editor::output',
'context' => 'normal',
'priority' => 'low',
),
),
'sp_team' => array(
'details' => array(
@@ -159,12 +153,6 @@ class SP_Admin_Meta_Boxes {
'context' => 'side',
'priority' => 'default',
),
'editor' => array(
'title' => __( 'Profile', 'sportspress' ),
'output' => 'SP_Meta_Box_Team_Editor::output',
'context' => 'normal',
'priority' => 'low',
),
'staff' => array(
'title' => __( 'Staff', 'sportspress' ),
'save' => 'SP_Meta_Box_Team_Staff::save',
@@ -208,12 +196,6 @@ class SP_Admin_Meta_Boxes {
'context' => 'normal',
'priority' => 'high',
),
'editor' => array(
'title' => __( 'Profile', 'sportspress' ),
'output' => 'SP_Meta_Box_Player_Editor::output',
'context' => 'normal',
'priority' => 'low',
),
),
'sp_staff' => array(
'shortcode' => array(
@@ -229,12 +211,6 @@ class SP_Admin_Meta_Boxes {
'context' => 'side',
'priority' => 'default',
),
'editor' => array(
'title' => __( 'Profile', 'sportspress' ),
'output' => 'SP_Meta_Box_Staff_Editor::output',
'context' => 'normal',
'priority' => 'low',
),
),
);

View File

@@ -1,24 +0,0 @@
<?php
/**
* Calendar Editor
*
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 0.8
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* SP_Meta_Box_Calendar_Editor
*/
class SP_Meta_Box_Calendar_Editor {
/**
* Output the metabox
*/
public static function output( $post ) {
wp_editor( $post->post_content, 'content' );
}
}

View File

@@ -1,24 +0,0 @@
<?php
/**
* Event Editor
*
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 0.8
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* SP_Meta_Box_Event_Editor
*/
class SP_Meta_Box_Event_Editor {
/**
* Output the metabox
*/
public static function output( $post ) {
wp_editor( $post->post_content, 'content' );
}
}

View File

@@ -1,24 +0,0 @@
<?php
/**
* List Editor
*
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 0.8
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* SP_Meta_Box_List_Editor
*/
class SP_Meta_Box_List_Editor {
/**
* Output the metabox
*/
public static function output( $post ) {
wp_editor( $post->post_content, 'content' );
}
}

View File

@@ -1,24 +0,0 @@
<?php
/**
* Player Editor
*
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 0.8
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* SP_Meta_Box_Player_Editor
*/
class SP_Meta_Box_Player_Editor {
/**
* Output the metabox
*/
public static function output( $post ) {
wp_editor( $post->post_content, 'content' );
}
}

View File

@@ -1,24 +0,0 @@
<?php
/**
* Staff Editor
*
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 0.8
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* SP_Meta_Box_Staff_Editor
*/
class SP_Meta_Box_Staff_Editor {
/**
* Output the metabox
*/
public static function output( $post ) {
wp_editor( $post->post_content, 'content' );
}
}

View File

@@ -1,24 +0,0 @@
<?php
/**
* Table Editor
*
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 0.8
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* SP_Meta_Box_Table_Editor
*/
class SP_Meta_Box_Table_Editor {
/**
* Output the metabox
*/
public static function output( $post ) {
wp_editor( $post->post_content, 'content' );
}
}

View File

@@ -1,24 +0,0 @@
<?php
/**
* Team Editor
*
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 0.8
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* SP_Meta_Box_Team_Editor
*/
class SP_Meta_Box_Team_Editor {
/**
* Output the metabox
*/
public static function output( $post ) {
wp_editor( $post->post_content, 'content' );
}
}

View File

@@ -47,7 +47,7 @@ class SP_Post_types {
'search_items' => __( 'Search', 'sportspress' ),
'not_found' => __( 'No results found.', 'sportspress' ),
);
$args = array(
$args = apply_filters( 'sportspress_register_taxonomy_league', array(
'label' => __( 'Competitions', 'sportspress' ),
'labels' => $labels,
'public' => true,
@@ -55,7 +55,7 @@ class SP_Post_types {
'show_tagcloud' => false,
'hierarchical' => true,
'rewrite' => array( 'slug' => get_option( 'sportspress_league_slug', 'league' ) ),
);
) );
$object_types = apply_filters( 'sportspress_league_object_types', array( 'sp_event', 'sp_calendar', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) );
register_taxonomy( 'sp_league', $object_types, $args );
foreach ( $object_types as $object_type ):
@@ -78,7 +78,7 @@ class SP_Post_types {
'search_items' => __( 'Search', 'sportspress' ),
'not_found' => __( 'No results found.', 'sportspress' ),
);
$args = array(
$args = apply_filters( 'sportspress_register_taxonomy_season', array(
'label' => __( 'Seasons', 'sportspress' ),
'labels' => $labels,
'public' => true,
@@ -86,7 +86,7 @@ class SP_Post_types {
'show_tagcloud' => false,
'hierarchical' => true,
'rewrite' => array( 'slug' => get_option( 'sportspress_season_slug', 'season' ) ),
);
) );
$object_types = apply_filters( 'sportspress_season_object_types', array( 'sp_event', 'sp_calendar', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) );
register_taxonomy( 'sp_season', $object_types, $args );
foreach ( $object_types as $object_type ):
@@ -109,7 +109,7 @@ class SP_Post_types {
'search_items' => __( 'Search', 'sportspress' ),
'not_found' => __( 'No results found.', 'sportspress' ),
);
$args = array(
$args = apply_filters( 'sportspress_register_taxonomy_venue', array(
'label' => __( 'Venues', 'sportspress' ),
'labels' => $labels,
'public' => true,
@@ -117,7 +117,7 @@ class SP_Post_types {
'show_tagcloud' => false,
'hierarchical' => true,
'rewrite' => array( 'slug' => get_option( 'sportspress_venue_slug', 'venue' ) ),
);
) );
$object_types = apply_filters( 'sportspress_event_object_types', array( 'sp_event', 'sp_calendar', 'sp_team' ) );
register_taxonomy( 'sp_venue', $object_types, $args );
foreach ( $object_types as $object_type ):
@@ -140,7 +140,7 @@ class SP_Post_types {
'search_items' => __( 'Search', 'sportspress' ),
'not_found' => __( 'No results found.', 'sportspress' ),
);
$args = array(
$args = apply_filters( 'sportspress_register_taxonomy_position', array(
'label' => __( 'Positions', 'sportspress' ),
'labels' => $labels,
'public' => true,
@@ -148,7 +148,7 @@ class SP_Post_types {
'show_tagcloud' => false,
'hierarchical' => true,
'rewrite' => array( 'slug' => get_option( 'sportspress_position_slug', 'position' ) ),
);
) );
$object_types = apply_filters( 'sportspress_position_object_types', array( 'sp_player', 'sp_list' ) );
register_taxonomy( 'sp_position', $object_types, $args );
foreach ( $object_types as $object_type ):
@@ -171,7 +171,7 @@ class SP_Post_types {
'search_items' => __( 'Search', 'sportspress' ),
'not_found' => __( 'No results found.', 'sportspress' ),
);
$args = array(
$args = apply_filters( 'sportspress_register_taxonomy_role', array(
'label' => __( 'Jobs', 'sportspress' ),
'labels' => $labels,
'public' => true,
@@ -179,7 +179,7 @@ class SP_Post_types {
'show_tagcloud' => false,
'hierarchical' => true,
'rewrite' => array( 'slug' => get_option( 'sportspress_role_slug', 'role' ) ),
);
) );
$object_types = apply_filters( 'sportspress_role_object_types', array( 'sp_staff' ) );
register_taxonomy( 'sp_role', $object_types, $args );
foreach ( $object_types as $object_type ):
@@ -398,7 +398,7 @@ class SP_Post_types {
'exclude_from_search' => false,
'hierarchical' => false,
'rewrite' => array( 'slug' => get_option( 'sportspress_event_slug', 'event' ) ),
'supports' => array( 'title', 'author', 'thumbnail', 'excerpt' ),
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt' ),
'has_archive' => false,
'show_in_nav_menus' => true,
'menu_icon' => 'dashicons-calendar',
@@ -432,7 +432,7 @@ class SP_Post_types {
'exclude_from_search' => false,
'hierarchical' => true,
'rewrite' => array( 'slug' => get_option( 'sportspress_team_slug', 'team' ) ),
'supports' => array( 'title', 'author', 'thumbnail', 'page-attributes', 'excerpt' ),
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes', 'excerpt' ),
'has_archive' => false,
'show_in_nav_menus' => true,
'menu_icon' => 'dashicons-shield-alt',
@@ -462,7 +462,7 @@ class SP_Post_types {
'exclude_from_search' => false,
'hierarchical' => false,
'rewrite' => array( 'slug' => get_option( 'sportspress_player_slug', 'player' ) ),
'supports' => array( 'title', 'author', 'thumbnail', 'excerpt', 'page-attributes' ),
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'page-attributes' ),
'has_archive' => false,
'show_in_nav_menus' => true,
'menu_icon' => 'dashicons-groups',
@@ -492,7 +492,7 @@ class SP_Post_types {
'exclude_from_search' => false,
'hierarchical' => false,
'rewrite' => array( 'slug' => get_option( 'sportspress_staff_slug', 'staff' ) ),
'supports' => array( 'title', 'author', 'thumbnail', 'excerpt' ),
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt' ),
'has_archive' => false,
'show_in_nav_menus' => true,
'menu_icon' => 'dashicons-businessman',

View File

@@ -82,7 +82,7 @@ class SportsPress_Calendars {
'exclude_from_search' => false,
'hierarchical' => false,
'rewrite' => array( 'slug' => get_option( 'sportspress_calendar_slug', 'calendar' ) ),
'supports' => array( 'title', 'author', 'thumbnail' ),
'supports' => array( 'title', 'editor', 'author', 'thumbnail' ),
'has_archive' => false,
'show_in_nav_menus' => true,
'show_in_menu' => 'edit.php?post_type=sp_event',
@@ -159,12 +159,6 @@ class SportsPress_Calendars {
'context' => 'normal',
'priority' => 'high',
),
'editor' => array(
'title' => __( 'Description', 'sportspress' ),
'output' => 'SP_Meta_Box_Calendar_Editor::output',
'context' => 'normal',
'priority' => 'low',
),
);
return $meta_boxes;
}

View File

@@ -82,7 +82,7 @@ class SportsPress_League_Tables {
'exclude_from_search' => false,
'hierarchical' => false,
'rewrite' => array( 'slug' => get_option( 'sportspress_table_slug', 'table' ) ),
'supports' => array( 'title', 'page-attributes', 'thumbnail' ),
'supports' => array( 'title', 'editor', 'page-attributes', 'thumbnail' ),
'has_archive' => false,
'show_in_nav_menus' => true,
'show_in_menu' => 'edit.php?post_type=sp_team',
@@ -159,12 +159,6 @@ class SportsPress_League_Tables {
'context' => 'normal',
'priority' => 'high',
),
'editor' => array(
'title' => __( 'Description', 'sportspress' ),
'output' => 'SP_Meta_Box_Table_Editor::output',
'context' => 'normal',
'priority' => 'low',
),
);
return $meta_boxes;
}

View File

@@ -81,7 +81,7 @@ class SportsPress_Player_Lists {
'exclude_from_search' => false,
'hierarchical' => false,
'rewrite' => array( 'slug' => get_option( 'sportspress_list_slug', 'list' ) ),
'supports' => array( 'title', 'page-attributes', 'author', 'thumbnail' ),
'supports' => array( 'title', 'editor', 'page-attributes', 'author', 'thumbnail' ),
'has_archive' => false,
'show_in_nav_menus' => true,
'show_in_menu' => 'edit.php?post_type=sp_player',
@@ -165,12 +165,6 @@ class SportsPress_Player_Lists {
'context' => 'normal',
'priority' => 'high',
),
'editor' => array(
'title' => __( 'Description', 'sportspress' ),
'output' => 'SP_Meta_Box_List_Editor::output',
'context' => 'normal',
'priority' => 'low',
),
);
return $meta_boxes;
}