* @since 01/26/2014 * @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_Code_Quicktags */ class Add_Quicktag_Code_Quicktags extends Add_Quicktag_Settings { /** * Post types for the settings * * @var */ private static $code_quicktags = array( 'enhanced_code' => 'pre', 'en_de_coding' => 'htmlentities' ); /** * Static var for textdomain * * @var string */ public static $textdomain = ''; /** * Handler for the action 'init'. Instantiates this class. * * @access public * @since 2.0.0 * @return \Add_Quicktag|\Add_Quicktag_Code_Quicktags|\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 * @return \Add_Quicktag_Code_Quicktags */ private function __construct() { self::$textdomain = parent::get_textdomain(); add_action( 'addquicktag_settings_form_page', array( $this, 'get_code_quicktag_area' ) ); } /** * Add settings area * * @param $options */ public function get_code_quicktag_area( $options ) { if ( ! isset( $options[ 'code_buttons' ] ) ) { $options[ 'code_buttons' ] = array(); } ?>

get_textdomain() ); ?>

get_post_types_for_js() as $post_type ) { $pt_title .= '' . $post_type . '' . "\n"; $pt_colgroup .= '' . "\n"; } ?> $value ) { echo '' . "\n"; echo ''; // loop about the post types, create html an values $pt_checkboxes = ''; foreach ( $this->get_post_types_for_js() as $post_type ) { $pt_checked = ''; if ( isset( $options[ 'code_buttons' ][ $value ][ $post_type ] ) && 1 == $options[ 'code_buttons' ][ $value ][ $post_type ] ) { $pt_checked = ' checked="checked"'; } $pt_checkboxes .= '' . "\n"; } echo $pt_checkboxes; echo '' . "\n"; echo '' . "\n"; $i ++; } // Convert new buttons array back into a comma-separated string //$code_qt = implode( ',', $code_buttons ); ?>