diff --git a/admin/hooks/register-activation-hook.php b/admin/hooks/register-activation-hook.php index 04d3d9dd..2962bcdc 100644 --- a/admin/hooks/register-activation-hook.php +++ b/admin/hooks/register-activation-hook.php @@ -4,58 +4,102 @@ function sportspress_activation_hook() { $role = get_role( 'administrator' ); // Events - $role->add_cap( 'edit_sp_event' ); - $role->add_cap( 'edit_sp_events' ); - $role->add_cap( 'edit_others_sp_events' ); - $role->add_cap( 'delete_sp_event' ); - $role->add_cap( 'publish_sp_events' ); $role->add_cap( 'read_sp_events' ); $role->add_cap( 'read_private_sp_events' ); + $role->add_cap( 'edit_sp_event' ); + $role->add_cap( 'edit_sp_events' ); + $role->add_cap( 'edit_published_sp_events' ); + $role->add_cap( 'edit_private_sp_events' ); + $role->add_cap( 'edit_others_sp_events' ); + $role->add_cap( 'delete_sp_event' ); + $role->add_cap( 'delete_published_sp_events' ); + $role->add_cap( 'delete_private_sp_events' ); + $role->add_cap( 'delete_others_sp_events' ); + $role->add_cap( 'publish_sp_events' ); + + // Calendars + $role->add_cap( 'read_sp_calendars' ); + $role->add_cap( 'read_private_sp_calendars' ); + $role->add_cap( 'edit_sp_calendar' ); + $role->add_cap( 'edit_sp_calendars' ); + $role->add_cap( 'edit_published_sp_calendars' ); + $role->add_cap( 'edit_private_sp_calendars' ); + $role->add_cap( 'edit_others_sp_calendars' ); + $role->add_cap( 'delete_sp_calendar' ); + $role->add_cap( 'delete_published_sp_calendars' ); + $role->add_cap( 'delete_private_sp_calendars' ); + $role->add_cap( 'delete_others_sp_calendars' ); + $role->add_cap( 'publish_sp_calendars' ); // Teams - $role->add_cap( 'edit_sp_team' ); - $role->add_cap( 'edit_sp_teams' ); - $role->add_cap( 'edit_others_sp_teams' ); - $role->add_cap( 'delete_sp_team' ); - $role->add_cap( 'publish_sp_teams' ); $role->add_cap( 'read_sp_teams' ); $role->add_cap( 'read_private_sp_teams' ); + $role->add_cap( 'edit_sp_team' ); + $role->add_cap( 'edit_sp_teams' ); + $role->add_cap( 'edit_published_sp_teams' ); + $role->add_cap( 'edit_private_sp_teams' ); + $role->add_cap( 'edit_others_sp_teams' ); + $role->add_cap( 'delete_sp_team' ); + $role->add_cap( 'delete_published_sp_teams' ); + $role->add_cap( 'delete_private_sp_teams' ); + $role->add_cap( 'delete_others_sp_teams' ); + $role->add_cap( 'publish_sp_teams' ); // League Tables - $role->add_cap( 'edit_sp_table' ); - $role->add_cap( 'edit_sp_tables' ); - $role->add_cap( 'edit_others_sp_tables' ); - $role->add_cap( 'delete_sp_table' ); - $role->add_cap( 'publish_sp_tables' ); $role->add_cap( 'read_sp_tables' ); $role->add_cap( 'read_private_sp_tables' ); + $role->add_cap( 'edit_sp_table' ); + $role->add_cap( 'edit_sp_tables' ); + $role->add_cap( 'edit_published_sp_tables' ); + $role->add_cap( 'edit_private_sp_tables' ); + $role->add_cap( 'edit_others_sp_tables' ); + $role->add_cap( 'delete_sp_table' ); + $role->add_cap( 'delete_published_sp_tables' ); + $role->add_cap( 'delete_private_sp_tables' ); + $role->add_cap( 'delete_others_sp_tables' ); + $role->add_cap( 'publish_sp_tables' ); // Players - $role->add_cap( 'edit_sp_player' ); - $role->add_cap( 'edit_sp_players' ); - $role->add_cap( 'edit_others_sp_players' ); - $role->add_cap( 'delete_sp_player' ); - $role->add_cap( 'publish_sp_players' ); $role->add_cap( 'read_sp_players' ); $role->add_cap( 'read_private_sp_players' ); + $role->add_cap( 'edit_sp_player' ); + $role->add_cap( 'edit_sp_players' ); + $role->add_cap( 'edit_published_sp_players' ); + $role->add_cap( 'edit_private_sp_players' ); + $role->add_cap( 'edit_others_sp_players' ); + $role->add_cap( 'delete_sp_player' ); + $role->add_cap( 'delete_published_sp_players' ); + $role->add_cap( 'delete_private_sp_players' ); + $role->add_cap( 'delete_others_sp_players' ); + $role->add_cap( 'publish_sp_players' ); // Player Lists - $role->add_cap( 'edit_sp_list' ); - $role->add_cap( 'edit_sp_lists' ); - $role->add_cap( 'edit_others_sp_lists' ); - $role->add_cap( 'delete_sp_list' ); - $role->add_cap( 'publish_sp_lists' ); $role->add_cap( 'read_sp_lists' ); $role->add_cap( 'read_private_sp_lists' ); + $role->add_cap( 'edit_sp_list' ); + $role->add_cap( 'edit_sp_lists' ); + $role->add_cap( 'edit_published_sp_lists' ); + $role->add_cap( 'edit_private_sp_lists' ); + $role->add_cap( 'edit_others_sp_lists' ); + $role->add_cap( 'delete_sp_list' ); + $role->add_cap( 'delete_published_sp_lists' ); + $role->add_cap( 'delete_private_sp_lists' ); + $role->add_cap( 'delete_others_sp_lists' ); + $role->add_cap( 'publish_sp_lists' ); // Staff - $role->add_cap( 'edit_sp_staff' ); - $role->add_cap( 'edit_sp_staffs' ); - $role->add_cap( 'edit_others_sp_staffs' ); - $role->add_cap( 'delete_sp_staff' ); - $role->add_cap( 'publish_sp_staffs' ); $role->add_cap( 'read_sp_staffs' ); $role->add_cap( 'read_private_sp_staffs' ); + $role->add_cap( 'edit_sp_staff' ); + $role->add_cap( 'edit_sp_staffs' ); + $role->add_cap( 'edit_published_sp_staffs' ); + $role->add_cap( 'edit_private_sp_staffs' ); + $role->add_cap( 'edit_others_sp_staffs' ); + $role->add_cap( 'delete_sp_staff' ); + $role->add_cap( 'delete_published_sp_staffs' ); + $role->add_cap( 'delete_private_sp_staffs' ); + $role->add_cap( 'delete_others_sp_staffs' ); + $role->add_cap( 'publish_sp_staffs' ); // Settings $role->add_cap( 'read_sp_configs' ); diff --git a/admin/post-types/calendar.php b/admin/post-types/calendar.php index 71e7215d..95ac70d4 100644 --- a/admin/post-types/calendar.php +++ b/admin/post-types/calendar.php @@ -14,7 +14,7 @@ function sportspress_calendar_post_init() { 'rewrite' => array( 'slug' => get_option( 'sp_calendar_slug', 'calendars' ) ), 'show_in_menu' => 'edit.php?post_type=sp_event', 'show_in_admin_bar' => true, -// 'capability_type' => 'sp_calendar' + 'capability_type' => 'sp_calendar' ); register_post_type( 'sp_calendar', $args ); } diff --git a/admin/post-types/table.php b/admin/post-types/table.php index b4726767..bb2fb0d7 100644 --- a/admin/post-types/table.php +++ b/admin/post-types/table.php @@ -14,7 +14,7 @@ function sportspress_table_post_init() { 'rewrite' => array( 'slug' => get_option( 'sp_table_slug', 'tables' ) ), 'show_in_menu' => 'edit.php?post_type=sp_team', 'show_in_admin_bar' => true, -// 'capability_type' => 'sp_table' + 'capability_type' => 'sp_table' ); register_post_type( 'sp_table', $args ); } diff --git a/readme.txt b/readme.txt index d080b02a..45365206 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: themeboy Tags: sports, sports journalism, teams, team management, fixtures, results, standings, league tables, leagues, reporting, themeboy, wordpress sports, configurable Requires at least: 3.5 Tested up to: 3.8 -Stable tag: 0.1.5 +Stable tag: 0.1.6 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -11,6 +11,10 @@ SportsPress is a flexible sports management plugin that adds team management fun == Changelog == += 0.1.6 = +* Tweak - Activate per post type permissions. +* Tweak - Give admin all permissions for custom posts. + = 0.1.5 = * Tweak - Remove flag images to lighten download size. diff --git a/sportspress.php b/sportspress.php index 6562f26a..a598689d 100644 --- a/sportspress.php +++ b/sportspress.php @@ -6,7 +6,7 @@ Plugin Name: SportsPress Plugin URI: http://themeboy.com/sportspress Description: Manage your club and its players, staff, events, league tables, and player lists. -Version: 0.1.3 +Version: 0.1.6 Author: ThemeBoy Author URI: http://themeboy.com/ License: GPLv3 @@ -18,7 +18,7 @@ if ( !function_exists( 'add_action' ) ) { exit; } -define( 'SPORTSPRESS_VERSION', '0.1.3' ); +define( 'SPORTSPRESS_VERSION', '0.1.6' ); define( 'SPORTSPRESS_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); define( 'SPORTSPRESS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); define( 'SPORTSPRESS_PLUGIN_FILE', __FILE__ );