ap_ajax_tinymce_assets()
Description #
Include tinymce assets.
Source #
File: includes/functions.php
function ap_ajax_tinymce_assets() {
if ( ! class_exists( '_WP_Editors' ) ) {
require ABSPATH . WPINC . '/class-wp-editor.php';
}
\_WP_Editors::enqueue_scripts();
// Enqueue wp-tinymce when Jetpack photon-cdn module is enabled,
// since while user are trying to add an answer to the question,
// creates JS console error and hence, the editor does not work.
if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'photon-cdn' ) ) {
wp_enqueue_script( 'wp-tinymce' );
}
ob_start();
print_footer_scripts();
$scripts = ob_get_clean();
echo str_replace( 'jquery-core,', '', $scripts ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
\_WP_Editors::editor_js();
}
Expand full source code Collapse full source code View on GitHub: includes/functions.php:2313
Add your comment