Hi there, I’m trying to load my theme style in the TINYMCE ACF provide but with no luck.
This is my actual code :
add_filter('tiny_mce_before_init', function ($mce_init) {
// $content_css = get_stylesheet_directory_uri() .'/css/editor.css';
$content_css = asset('editor.css')->relativePath(get_theme_file_path());
// 404 : https://xxx.test/wp-admin/public/editor.css?wp-mce-49110-20201110
$content_css = asset('editor.css');
// 404 : https://xxx.test/wp-content/themes/xxx/public/editor.css?wp-mce-49110-20201110
$content_css = \Roots\asset('editor.css');
// 404 : https://xxx.test/wp-content/themes/xxx/public/styles/editor.css?wp-mce-49110-20201110
//Grab existing stylesheets and then add our new $content_css
if (isset($mce_init[ 'content_css' ])) {
$content_css_new = $mce_init[ 'content_css' ].','.$content_css;
}
$mce_init[ 'content_css' ] = $content_css_new;
return $mce_init;
});
How do i get the url of my assets ?