lzb_pro/plugin_url
Filters the URL the Pro editor scripts and styles are loaded from.
Lazy Blocks Pro shipped inside a theme or another plugin sits at a URL plugin_dir_url() cannot work out, because WordPress only knows about files under the plugins directory. Point this filter at the real location and the Pro editor assets resolve again.
Attributes
| Name | Type | Description |
|---|---|---|
$plugin_url | String | plugin_dir_url( __FILE__ ) of lazy-blocks-pro.php, with a trailing slash |
Lazy_Blocks_Pro_Assets::register_script() and register_style() are the only readers. Each one appends the build path and the extension, so build/component-rich-text becomes <plugin_url>build/component-rich-text.js.
Usage
function my_lzb_pro_plugin_url( $plugin_url ) {
return get_stylesheet_directory_uri() . '/vendor/lazy-blocks-pro/';
}
add_filter( 'lzb_pro/plugin_url', 'my_lzb_pro_plugin_url' );lazyblocks()->include_within( $url ) already registers this filter along with lzb/plugin_url, so a theme following Include Lazy Blocks within theme or plugin does not need to add it by hand.
A wrong URL is quiet. The scripts still register and enqueue, the browser gets a 404 for each one, and the block builder loads without the Pro panels: no Rich Text component, no conditional logic, no collections. Keep the trailing slash, because the build path is concatenated straight onto the value.
The path counterpart is lzb_pro/plugin_path.