* @version 06/19/2014 */ if ( ! function_exists( 'add_action' ) ) { echo "Hi there! I'm just a part of plugin, not much I can do when called directly."; exit; } /** * Class Add_Quicktag_Im_Export */ class Add_Quicktag_Im_Export extends Add_Quicktag_Settings { /** * String for translation. * * @var string */ public static $textdomain; /** * String for options in table options. * * @var string */ private static $option_string; /** * Store string for plugin file. * * @var string */ private static $plugin; /** * Post types for the settings. * * @var array */ private static $post_types_for_js; /** * Handler for the action 'init'. Instantiates this class. * * @access public * @since 2.0.0 * @return \Add_Quicktag|\Add_Quicktag_Im_Export|\Add_Quicktag_Settings $instance */ public static function get_object() { static $instance; if ( null === $instance ) { $instance = new self(); } return $instance; } /** * Constructor, init on defined hooks of WP and include second class * * @access public * @since 0.0.2 * @uses register_activation_hook, register_uninstall_hook, add_action */ private function __construct() { self::$option_string = parent::get_option_string(); self::$plugin = parent::get_plugin_string(); self::$post_types_for_js = parent::get_post_types_for_js(); if ( isset( $_GET['addquicktag_download'] ) && check_admin_referer( parent::$nonce_string ) ) { $this->get_export_file(); } if ( isset( $_POST['addquicktag_import'] ) && check_admin_referer( parent::$nonce_string ) ) { $this->import_file(); } add_action( 'addquicktag_settings_page', array( $this, 'get_im_export_part' ) ); } /** * Get markup for ex- and import on settings page. * * @access public * @since 2.0.0 * @uses wp_nonce_field */ public function get_im_export_part() { ?>

self::$plugin, 'updated' => 'true', ), network_admin_url( 'settings.php' ) ) ); } else { $page = str_replace( basename( __FILE__ ), 'class-settings.php', plugin_basename( __FILE__ ) ); wp_safe_redirect( add_query_arg( array( 'page' => $page, 'updated' => 'true', ), admin_url( 'options-general.php' ) ) ); } exit; } } // end class $add_quicktag_im_export = Add_Quicktag_Im_Export::get_object();