Admin dashboard widget, namespace EOS, remove unused widgets
This commit is contained in:
@@ -9,8 +9,9 @@ function sportspress_admin_enqueue_scripts( $hook ) {
|
||||
wp_enqueue_style( 'sportspress-admin', SPORTSPRESS_PLUGIN_URL . 'assets/css/admin.css', array(), time() );
|
||||
|
||||
wp_enqueue_script( 'jquery' );
|
||||
wp_enqueue_script( 'chosen', SPORTSPRESS_PLUGIN_URL .'assets/js/chosen.jquery.min.js', array( 'jquery' ), '1.1.0', true );
|
||||
wp_enqueue_script( 'caret', SPORTSPRESS_PLUGIN_URL .'assets/js/jquery.caret.min.js', array( 'jquery' ), '1.02', true );
|
||||
wp_enqueue_script( 'jquery-chosen', SPORTSPRESS_PLUGIN_URL .'assets/js/chosen.jquery.min.js', array( 'jquery' ), '1.1.0', true );
|
||||
wp_enqueue_script( 'jquery-caret', SPORTSPRESS_PLUGIN_URL .'assets/js/jquery.caret.min.js', array( 'jquery' ), '1.02', true );
|
||||
wp_enqueue_script( 'jquery-countdown', SPORTSPRESS_PLUGIN_URL .'assets/js/jquery.countdown.min.js', array( 'jquery' ), '2.0.2', true );
|
||||
|
||||
if ( $hook == 'edit-tags.php' && isset( $_GET['taxonomy'] ) && $_GET['taxonomy'] == 'sp_venue' ):
|
||||
wp_enqueue_script( 'google-maps', 'http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places' );
|
||||
@@ -21,6 +22,6 @@ function sportspress_admin_enqueue_scripts( $hook ) {
|
||||
wp_enqueue_script( 'sportspress-admin', SPORTSPRESS_PLUGIN_URL .'assets/js/admin.js', array( 'jquery' ), time(), true );
|
||||
|
||||
// Localize scripts.
|
||||
wp_localize_script( 'sportspress-admin', 'localized_strings', array( 'remove_text' => __( '— Remove —', 'sportspress' ) ) );
|
||||
wp_localize_script( 'sportspress-admin', 'localized_strings', array( 'remove_text' => __( '— Remove —', 'sportspress' ), 'days' => __( 'days', 'sportspress' ), 'hrs' => __( 'hrs', 'sportspress' ), 'mins' => __( 'mins', 'sportspress' ), 'secs' => __( 'secs', 'sportspress' ) ) );
|
||||
}
|
||||
add_action( 'admin_enqueue_scripts', 'sportspress_admin_enqueue_scripts' );
|
||||
|
||||
@@ -35,5 +35,7 @@ function sportspress_admin_init() {
|
||||
$administrator->add_cap( $cap . '_' . $post_type . 's' );
|
||||
endforeach;
|
||||
endforeach;
|
||||
|
||||
$administrator->add_cap( 'view_sportspress_reports' );
|
||||
}
|
||||
add_action( 'admin_init', 'sportspress_admin_init' );
|
||||
|
||||
7
admin/hooks/current-screen.php
Normal file
7
admin/hooks/current-screen.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
function sportspress_current_screen() {
|
||||
$screen = get_current_screen();
|
||||
if ( $screen->id == 'dashboard' )
|
||||
include_once( dirname( SPORTSPRESS_PLUGIN_FILE ) . '/admin/tools/dashboard.php' );
|
||||
}
|
||||
add_action( 'current_screen', 'sportspress_current_screen' );
|
||||
@@ -74,6 +74,8 @@ function sportspress_activation_hook() {
|
||||
'delete_sp_tables' => true,
|
||||
'delete_private_sp_tables' => true,
|
||||
'delete_published_sp_tables' => true,
|
||||
|
||||
'view_sportspress_reports' => true,
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user