Skip to content

Commit

Permalink
Fixed undefined index for page
Browse files Browse the repository at this point in the history
  • Loading branch information
zekinah committed Sep 20, 2020
1 parent 4d615e7 commit 417ab59
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions admin/class-pandemic-covid19-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ public function __construct( $plugin_name, $version ) {
public function enqueue_styles() {

wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/pandemic-covid19-admin.css', array(), $this->version, 'all' );
if ($_GET['page'] == $this->plugin_name) {
/* Bootstrap 4 CSS */
wp_enqueue_style('zone-pcovid-bootstrap-css', plugin_dir_url(__FILE__) . 'css/bootstrap/bootstrap.min.css', array(), $this->version);
if(isset($_GET['page'])) {
if ($_GET['page'] == $this->plugin_name) {
/* Bootstrap 4 CSS */
wp_enqueue_style('zone-pcovid-bootstrap-css', plugin_dir_url(__FILE__) . 'css/bootstrap/bootstrap.min.css', array(), $this->version);
}
}
wp_enqueue_style('zone-pcovid-datatable-css', plugin_dir_url(__FILE__) . 'css/datatable/jquery.dataTables.css', array(), $this->version);
}
Expand All @@ -86,9 +88,11 @@ public function enqueue_scripts() {
wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/pandemic-covid19-admin.js', array( 'jquery' ), $this->version, false );
wp_enqueue_script( $this->plugin_name.'-ajax', plugin_dir_url( __FILE__ ) . 'js/pandemic-covid19-admin-ajax.js', array( 'jquery' ), $this->version, false );
wp_enqueue_script('jquery');
if ($_GET['page'] == $this->plugin_name) {
/* Bootstrap 4 JS */
wp_enqueue_script('zone-pcovid-bootstrap-js', plugin_dir_url(__FILE__) . 'js/bootstrap/bootstrap.min.js', array('jquery'), $this->version);
if(isset($_GET['page'])) {
if ($_GET['page'] == $this->plugin_name) {
/* Bootstrap 4 JS */
wp_enqueue_script('zone-pcovid-bootstrap-js', plugin_dir_url(__FILE__) . 'js/bootstrap/bootstrap.min.js', array('jquery'), $this->version);
}
}
wp_enqueue_script('zone-pcovid-datatable-js', plugin_dir_url(__FILE__) . 'js/datatable/jquery.dataTables.js', array('jquery'), $this->version);
wp_localize_script($this->plugin_name.'-ajax', 'pandemicAjax', array('ajax_url' => admin_url('admin-ajax.php'),'ajax_nonce'=>wp_create_nonce('zn-ajax-nonce')));
Expand Down

0 comments on commit 417ab59

Please sign in to comment.