Opened 7 years ago
Closed 5 years ago
#44172 closed defect (bug) (worksforme)
TinyMCE style_formats broken for `a` tags
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.9.6 |
Component: | TinyMCE | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description
It seems that the link inserter breaks the TinyMCE style formats.
P-tag is working, the link-tag not.
<?php // Custom styles add_filter( 'mce_buttons_2', function( $buttons ){ array_unshift( $buttons, 'styleselect' ); return $buttons; } ); add_filter( 'tiny_mce_before_init', function($init_array){ $style_formats = [ // These are the custom styles [ 'title' => 'Button', 'inline' => 'a', 'classes' => 'btn', ], [ 'title' => 'P', 'block' => 'p', 'classes' => 'largerp', ], ]; // Insert the array, JSON ENCODED, into 'style_formats' $init_array['style_formats'] = json_encode( $style_formats ); return $init_array; } );
Change History (3)
#3
@
5 years ago
- Keywords reporter-feedback added
- Milestone Awaiting Review deleted
- Resolution set to worksforme
- Status changed from new to closed
I am also seeing the behavior that @azaozz describes above. I am going to close this out due to lack of reporter feedback. @Horttcore if you are still able to reproduce, please reopen with more details.
Note: See
TracTickets for help on using
tickets.
Some more details would be helpful.
Trying to reproduce, TinyMCE inserts an
<a>
tag with nohref
when using "Button" from the Formats drop-down. That seems to be the expected behaviour.