plugin_name = $plugin_name; $this->tab = sanitize_text_field(filter_input( INPUT_GET, 'tab')); $this->active_tab = $this->tab != "" ? $this->tab : 'default'; if($this->this_tab == $this->active_tab){ add_action($this->plugin_name.'_tab_content', array($this,'tab_content')); } add_action($this->plugin_name.'_tab', array($this,'tab'),1); $action = sanitize_text_field(filter_input(INPUT_GET, 'action')); if($action == 'efrs_delete'){ $this->post_id = sanitize_text_field(filter_input(INPUT_GET, 'id')); add_action('init',array($this,'deletePost' )); } } function tab(){ ?> tab_name); ?> listShippingMethod(); } function listShippingMethod(){ include plugin_dir_path( __FILE__ ) . 'partials/listShippingMethod.php'; } function deletePost(){ $nonce = sanitize_text_field(filter_input(INPUT_GET, 'nonce')); if(!wp_verify_nonce($nonce,'pisol-efrs-action-delete-'.$this->post_id)){ wp_die('Security check failed'); } if(!current_user_can( 'manage_options' )) { wp_safe_redirect( esc_url( admin_url( '/admin.php?page=pisol-efrs-notification' ) ) ); exit(); } wp_delete_post($this->post_id); wp_safe_redirect( esc_url( admin_url( '/admin.php?page=pisol-efrs-notification' ) ) ); exit(); } } new Class_Pi_Efrs_List($this->plugin_name);