How to include 3rd-party script to pgedit.php

Hello,

I want to include custom stylesheets and scripts in the pgedit.php file.

Based on my exploration, the normal wp_enqueue doesn’t work there.
All styles and scripts loaded are from Pinegrow_Plugin_Public::get_editor_scripts() and Pinegrow_Plugin_Public::get_editor_styles().

Both functions don’t have any wp action hooks and filter hooks to interact from externally.

@suabahasa two filters will be added in the next plugin update:

$styles = apply_filters('pinegrow_editor_styles', $styles);

and

$scripts = apply_filters('pinegrow_editor_scripts', $scripts);

$styles and $scripts are arrays of relative or absolute urls.

These filters will let you load custom CSS and JS files in the Pinegrow editor. JS files can follow PG standard plugin format as described on Developers | Pinegrow Web Editor

2 Likes