is_enabled( self::TAB_SLUG ) ) { return; } /** Render title. */ $this->render_title( self::TAB_SLUG ); /** Render fields. */ $this->do_settings_base( self::TAB_SLUG ); } /** * Generate Uninstall Tab. * * @access public **/ public function add_settings() { /** Custom Uninstall Tab. */ $this->add_settings_base( self::TAB_SLUG ); $group = 'AdUnlocker' . self::TAB_SLUG . 'OptionsGroup'; $section = 'pp_AdUnlocker_' . self::TAB_SLUG . '_page_status_section'; /** Delete plugin. */ add_settings_field( 'delete_plugin', esc_html__( 'Removal settings:', 'AdUnlocker' ), [$this, 'render_delete_plugin'], $group, $section ); } /** * Render "Delete Plugin" field. * * @since 1.0.0 * @access public * * @return void **/ public function render_delete_plugin() { /** Get uninstall settings. */ $uninstall_settings = get_option( 'pp_AdUnlocker_uninstall_settings' ); /** Set Default value 'plugin'. */ if ( ! isset( $uninstall_settings[ 'delete_plugin' ] ) ) { $uninstall_settings = [ 'delete_plugin' => 'plugin' ]; } $options = Plugin::get_tabs()['uninstall']['fields']['delete_plugin']['options']; /** Prepare description. */ $helper_text = esc_html__( 'Choose which data to delete upon using the "Delete" action in the "Plugins" admin page.', 'AdUnlocker' ); /** Render select. */ UI::get_instance()->render_select( $options, $uninstall_settings[ 'delete_plugin' ], // Selected option. esc_html__( 'Delete plugin', 'AdUnlocker' ), $helper_text, [ 'name' => 'pp_AdUnlocker_uninstall_settings[delete_plugin]' ] ); } /** * Main TabUninstall Instance. * Insures that only one instance of TabUninstall exists in memory at any one time. * * @static * @return TabUninstall **/ public static function get_instance() { if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) { self::$instance = new self; } return self::$instance; } }