* @since 01/26/2014 * @version 2015-12-23 */ 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' ); /** * 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 */ private function __construct() { 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 ( ! array_key_exists( 'code_buttons', $options ) ) { $options[ 'code_buttons' ] = array(); } ?>
get_post_types_for_js() as $post_type ) { $pt_title .= '' . $post_type . '| ✔ | ||
|---|---|---|
| '; // 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 === (int) $options[ 'code_buttons' ][ $value ][ $post_type ] ) { $pt_checked = ' checked="checked"'; } $pt_checkboxes .= ' | ' . "\n"; } echo $pt_checkboxes; echo ' | ' . "\n"; echo ' |