wp_enqueue_editor example

wp_playlist_scripts( 'audio' );
        wp_playlist_scripts( 'video' );
    }

    /** * Loads the required scripts and styles for the widget control. * * @since 4.8.0 */
    public function enqueue_admin_scripts() {
        wp_enqueue_editor();
        wp_enqueue_media();
        wp_enqueue_script( 'text-widgets' );
        wp_add_inline_script( 'text-widgets', sprintf( 'wp.textWidgets.idBases.push( %s );', wp_json_encode( $this->id_base ) ) );
        wp_add_inline_script( 'text-widgets', 'wp.textWidgets.init();', 'after' );
    }

    /** * Outputs the Text widget settings form. * * @since 2.8.0 * @since 4.8.0 Form only contains hidden inputs which are synced with JS template. * @since 4.8.1 Restored original form to be displayed when in legacy mode. * * @see WP_Widget_Text::render_control_template_scripts() * @see _WP_Editors::editor() * * @param array $instance Current settings. */


/** * Scripts */
wp_enqueue_media(
    array(
        'post' => $post->ID,
    )
);
wp_tinymce_inline_scripts();
wp_enqueue_editor();

/** * Styles */
wp_enqueue_style( 'wp-edit-post' );

/** * Fires after block assets have been enqueued for the editing interface. * * Call `add_action` on any hook before 'admin_enqueue_scripts'. * * In the function call you supply, simply use `wp_enqueue_script` and * `wp_enqueue_style` to add your functionality to the block editor. * * @since 5.0.0 */
Home | Imprint | This part of the site doesn't use cookies.