* @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_Remove_Quicktags */ class Add_Quicktag_Remove_Quicktags extends Add_Quicktag_Settings { // default buttons from WP Core private static $core_quicktags = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,fullscreen'; /** * Handler for the action 'init'. Instantiates this class. * * @access public * @since 2.0.0 * @return \Add_Quicktag|\Add_Quicktag_Remove_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_remove_quicktag_area' ) ); } /** * Add settings area * * @param array $options */ public function get_remove_quicktag_area( $options ) { if ( ! array_key_exists( 'core_buttons', $options ) ) { $options[ 'core_buttons' ] = array(); } ?>
get_post_types_for_js() as $post_type ) { $pt_title .= '' . $post_type . '| ✔ | ||
|---|---|---|
' . $value . ' | ';
// 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[ 'core_buttons' ][ $value ][ $post_type ] )
&& 1 === (int) $options[ 'core_buttons' ][ $value ][ $post_type ] ) {
$pt_checked = ' checked="checked"';
}
$pt_checkboxes .= '' . "\n"; } echo $pt_checkboxes; echo ' | ' . "\n"; echo ' |