Opened 8 years ago
Closed 7 years ago
#44172 closed defect (bug) (worksforme)
TinyMCE style_formats broken for `a` tags
| Reported by: | Horttcore | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | TinyMCE | Version: | 4.9.6 |
| Severity: | normal | Keywords: | reporter-feedback |
| Cc: | Focuses: |
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
@
7 years ago
- Keywords reporter-feedback added
- Milestone Awaiting Review
- Resolution → worksforme
- Status new → 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Some more details would be helpful.
Trying to reproduce, TinyMCE inserts an
<a>tag with nohrefwhen using "Button" from the Formats drop-down. That seems to be the expected behaviour.