Initial commit for adding relative_date_range option to shortcodes

This commit is contained in:
savvasha
2017-12-17 20:41:28 +02:00
parent 5705d35e5b
commit 40c2aaba05
2 changed files with 84 additions and 14 deletions

View File

@@ -70,7 +70,7 @@ class SP_Admin_Assets {
/**
* Enqueue scripts
*/
public function admin_scripts() {
public function admin_scripts($hook) {
global $wp_query, $post;
$screen = get_current_screen();
@@ -101,7 +101,8 @@ class SP_Admin_Assets {
wp_register_script( 'sportspress-admin-quickeditor', SP()->plugin_url() . '/assets/js/admin/quickeditor.js', array( 'jquery' ), SP_VERSION, true );
// SportsPress admin pages
if ( in_array( $screen->id, sp_get_screen_ids() ) || strpos( $screen->id, 'sportspress-config' )) {
if ( in_array( $screen->id, sp_get_screen_ids() ) || strpos( $screen->id, 'sportspress-config' ) || in_array($hook, array('post.php', 'post-new.php') ) ) {
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'chosen' );
wp_enqueue_script( 'jquery-ui-core' );