Plugin Directory

Changeset 1756180


Ignore:
Timestamp:
10/31/2017 04:48:52 PM (8 years ago)
Author:
skostadinov
Message:

Add check for the scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • posts-date-reschedule/trunk/posts-date-reschedule.php

    r1749878 r1756180  
    44 * Plugin URI:     https://skostadinov.eu/posts-date-reschedule/
    55 * Description:    Basic extension with which you can set bulk, new dates for your posts.
    6  * Version:        1.0.1
     6 * Version:        1.0.2
    77 * Author:         Stoyan Kostadinov
    88 * Author URI:     http://skostadinov.eu
     
    3838
    3939    public function register_styles_scripts(){
    40         //Styles
    41         wp_enqueue_style( 'pdr-styles', PDR_URI . '/assets/styles/main.css', '', '1.0.1', null );
     40        if ( isset( $_GET['page'] ) && $_GET['page'] == 'posts-date-reschedule-settings' ){
     41            //Styles
     42            wp_enqueue_style( 'pdr-styles', PDR_URI . '/assets/styles/main.css', '', '1.0.1', null );
    4243
    43         //Scrpts
    44         wp_register_script( 'pdr-scripts', PDR_URI . '/assets/scripts/main.js', 'jquery', '1.0.1', false );
     44            //Scrpts
     45            wp_register_script( 'pdr-scripts', PDR_URI . '/assets/scripts/main.js', 'jquery', '1.0.1', false );
    4546
    46         $translation_array = array(
    47             'developed' => __( 'Developed by:', 'pdr' ),
    48         );
     47            $translation_array = array(
     48                'developed' => __( 'Developed by:', 'pdr' ),
     49            );
    4950
    50         wp_localize_script( 'pdr-scripts', 'translate', $translation_array );
    51         wp_enqueue_script( 'pdr-scripts' );
     51            wp_localize_script( 'pdr-scripts', 'translate', $translation_array );
     52            wp_enqueue_script( 'pdr-scripts' );
     53        }
    5254    }
    5355
Note: See TracChangeset for help on using the changeset viewer.