* @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() { ?>