Enqueuing editor CSS
-
Hi. This is some code I got from Tom to enqueue block editor CSS in my custom plugin. However, I would like to ask for your help to shorten the URL in a way that it does not rely on the
plugin-namein the case where the plugin name is changed so it does not throw an error. I don’t know how that functions works and I saw it in the past but Google has not been fruitful. The style does not work without the full path, but I would like to truncate the part shown in the code due to the reason stated above. Thanks in advance.add_action( 'enqueue_block_editor_assets', function() { wp_enqueue_style( 'editor', '/wp-content/plugins/plugin-name/assets/css/editor-style.css', array(), '1.0'); } );
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘Enqueuing editor CSS’ is closed to new replies.
