New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Reusable Text Blocks plugin #203
Comments
The filter is not applied for all code paths, so if it's a plain text widget, nothing is done. This really is an issue with the Resuable Text Block plugin (and can easily be fixed by adding the filter to one of their hooks in your |
@mundschenk-at: Thanks! I tried add_filter( 'text_blocks_shortcode_html', array( 'WP_Typography', 'filter' ) ); but this filter doesn't seem to be used in this use-case. |
Try writing a small wrapper function that logs the input and output to see if it gets ever called, something like this: function my_filter( $content ) {
error_log( "In: $content" );
$result = WP_Typography::filter( $content );
error_log( "Out: $result" );
return $result;
}
add_filter( 'text_blocks_shortcode_html', 'my_filter' ); |
@strarsis Have you had any luck with the proposed |
@mundschenk-at: Thanks for the code. But nothing is logged from inside the filter function. |
Then for some reason the plugin does not use that filter hook in your case. You are using a shortcode? |
@mundschenk-at: I am using it as widget ('Text Blocks Widget') in a sidebar. |
I think there is a separate hook for the widgets. @strarsis, try replacing |
@strarsis Have you tried the widgets hook? |
@mundschenk-at: Yes, it works now. 👍 // Reusable Text Blocks plugin
// Workaround for
// https://wordpress.org/support/topic/content-filter-wp-typography/
// https://github.com/mundschenk-at/wp-typography/issues/203
add_filter( 'text_blocks_widget_html', array( 'WP_Typography', 'filter' ) );
add_filter( 'text_blocks_shortcode_html', array( 'WP_Typography', 'filter' ) ); |
Issue Overview
Content inserted by Reusable Text Block plugin is not filtered by wp-typography (hyphenations missing).
Steps to Reproduce (for bugs)
Expected Behavior
Inserted Text block content is filtered and hyphenations inserted.
Current Behavior
Inserted Text block is not filtered, no hyphenations inserted.
Possible Solution
Add wp-typography as filter of Text block content to insert?
Should the author of Reusable Text Blocks use a more generic filter for the inserted Text block content?
Related Issues
https://wordpress.org/support/topic/content-filter-wp-typography/
Edit:
Apparently
the_content
filter is applied by Resuable Text Block plugin – should this suffice?:https://plugins.trac.wordpress.org/browser/reusable-text-blocks/trunk/text-blocks.php#L302
The text was updated successfully, but these errors were encountered: