wp/wp-content/plugins/portfolio/bws_menu/deactivation-form.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
     3  * Displays the content of the dialog box when the user clicks on the "Deactivate" link on the plugin settings page
     3  * Displays the content of the dialog box when the user clicks on the "Deactivate" link on the plugin settings page
     4  *
     4  *
     5  * @package BestWebSoft
     5  * @package BestWebSoft
     6  * @since 2.1.3
     6  * @since 2.1.3
     7  */
     7  */
       
     8 
     8 if ( ! defined( 'ABSPATH' ) ) {
     9 if ( ! defined( 'ABSPATH' ) ) {
     9 	exit;
    10 	exit;
    10 }
    11 }
    11 
    12 
    12 /**
       
    13  * Displays a confirmation and feedback dialog box when the user clicks on the "Deactivate" link on the plugins
       
    14  * page.
       
    15  *
       
    16  * @since  2.1.3
       
    17  */
       
    18 if ( ! function_exists( 'bws_add_deactivation_feedback_dialog_box' ) ) {
    13 if ( ! function_exists( 'bws_add_deactivation_feedback_dialog_box' ) ) {
       
    14 	/**
       
    15 	 * Displays a confirmation and feedback dialog box when the user clicks on the "Deactivate" link on the plugins
       
    16 	 * page.
       
    17 	 *
       
    18 	 * @since  2.1.3
       
    19 	 */
    19 	function bws_add_deactivation_feedback_dialog_box() {
    20 	function bws_add_deactivation_feedback_dialog_box() {
    20 		global $bstwbsftwppdtplgns_active_plugins;
    21 		global $bstwbsftwppdtplgns_active_plugins;
    21 		if ( empty( $bstwbsftwppdtplgns_active_plugins ) ) {
    22 		if ( empty( $bstwbsftwppdtplgns_active_plugins ) ) {
    22 			return;
    23 			return;
    23 		}
    24 		}
   343 		wp_enqueue_script( 'bws-deactivation-feedback-dialog-boxes' );
   344 		wp_enqueue_script( 'bws-deactivation-feedback-dialog-boxes' );
   344 		wp_add_inline_script( 'bws-deactivation-feedback-dialog-boxes', $script );
   345 		wp_add_inline_script( 'bws-deactivation-feedback-dialog-boxes', $script );
   345 	}
   346 	}
   346 }
   347 }
   347 
   348 
   348 /**
       
   349  * Called after the user has submitted his reason for deactivating the plugin.
       
   350  *
       
   351  * @since  2.1.3
       
   352  */
       
   353 if ( ! function_exists( 'bws_submit_uninstall_reason_action' ) ) {
   349 if ( ! function_exists( 'bws_submit_uninstall_reason_action' ) ) {
       
   350 	/**
       
   351 	 * Called after the user has submitted his reason for deactivating the plugin.
       
   352 	 *
       
   353 	 * @since  2.1.3
       
   354 	 */
   354 	function bws_submit_uninstall_reason_action() {
   355 	function bws_submit_uninstall_reason_action() {
   355 		global $bstwbsftwppdtplgns_options, $wp_version, $bstwbsftwppdtplgns_active_plugins, $current_user;
   356 		global $bstwbsftwppdtplgns_options, $wp_version, $bstwbsftwppdtplgns_active_plugins, $current_user;
   356 
   357 
   357 		if ( isset( $_REQUEST['bws_ajax_nonce'] ) ) {
   358 		if ( isset( $_REQUEST['bws_ajax_nonce'] ) ) {
   358 
   359 
   359 			wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['bws_ajax_nonce'] ) ), 'bws_ajax_nonce' );
   360 			check_ajax_referer( 'bws_ajax_nonce', sanitize_text_field( wp_unslash( $_REQUEST['bws_ajax_nonce'] ) ) );
   360 
   361 
   361 			$reason_id = isset( $_REQUEST['reason_id'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['reason_id'] ) ) : '';
   362 			$reason_id = isset( $_REQUEST['reason_id'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['reason_id'] ) ) : '';
   362 			$basename  = isset( $_REQUEST['plugin'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['plugin'] ) ) : '';
   363 			$basename  = isset( $_REQUEST['plugin'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['plugin'] ) ) : '';
   363 
   364 
   364 			if ( empty( $reason_id ) || empty( $basename ) ) {
   365 			if ( empty( $reason_id ) || empty( $basename ) ) {