stargayte
Forum Replies Created
-
Forum: Plugins
In reply to: [W3 Total Cache] Media screen/print is not respected when Minify is turned onHi thank you for your answer.
This happens with the CSS minify yes.
I was using the default one, but I tried all of them:
– Minify (Default)
– CSS tidy
– YUI CompressorAll my CSS are minified together, but are included as a stylesheet with media=”all” even if they have been registered as screen.
wp_enqueue_style( 'mystyle', get_template_directory_uri() . '/mystyle.css', array(), $version_number, 'screen' );
Forum: Plugins
In reply to: [WPFront Notification Bar] Polylang supportIt took me a while, but I finally found the bug in the plugin.
It seems that WPFront Notification Bar is using the function get_option too early, it should wait for the plugins to be loaded before executing this function. The documentation explaining this here:
https://polylang.pro/dont-take-any-action-before-plugins_loaded-is-fired/So I changed the wpfront-notification-bar.php file with :
if(class_exists('\WPFront\Notification_Bar\WPFront_Notification_Bar') || class_exists('WPFront_Notification_Bar')) { return; } use WPFront\Notification_Bar\WPFront_Notification_Bar; function wpfront_notification_bar_init() { require_once("classes/class-wpfront-notification-bar.php"); WPFront_Notification_Bar::Instance()->init(plugin_basename(__FILE__)); } add_action('plugins_loaded', 'wpfront_notification_bar_init');
And the translation is working like a charm now.
It would be great to fix this, the fix is pretty easy just wrapping the execution of the plugin with the hook “plugins_loaded”.Forum: Plugins
In reply to: [ACF Nav Menu Field] I have an error message with already installed ACFSame issue here, I checked the code there is some references to
class_exists(‘acf’) when the ACF core is doing this class_exists(‘ACF’)But changing it doesn’t resolve the issue
Forum: Alpha/Beta/RC
In reply to: WP 5.9 RC3: Block patterns library issuesSo add_editor_style seems to work indeed using this:
function mytheme_editor_styles() { add_theme_support( 'editor-styles' ); add_editor_style(get_template_directory_uri() . '/css/theme.css'); } add_action( 'after_setup_theme', 'mytheme_editor_styles' );
But how do you add Javascript to the iframe now? It doesn’t seem that there is a
add_editor_script
and when I read WordPress code/documentation, it says to use enqueue_block_editor_assets… So this is very confusing that this hook is not working anymore.Forum: Alpha/Beta/RC
In reply to: WP 5.9 RC3: Block patterns library issuesHello,
I got the exact same issue. The update to wordpress 5.9 just broke the patterns preview feature. First I figured out that my styling added by enqueue_block_editor_assets was creating empty previews because of that rule:
iframe { max-width: 100% }
But now it looks like raw HTML rendering without any styling. It was working fine on WordPress 5.8 but for some reasons the styling is not applying inside the preview anymore.
1. You’re correct. The editor styles loaded via enqueue_block_editor_assets won’t work in future WP version. It’s recommended to use add_editor_style for block editor styles as well.
When I read the documentation of
add_editor_style
, it says that it is adding styles to TinyMCE. It doesn’t make any sense, the styles of the blocks should not be loaded into TinyMCE. Am I missing something?