WP_Backstage
in package
WP Backstage
Tags
Table of Contents
- $kses_label : array<string|int, mixed>
- KSES Label
- $kses_p : array<string|int, mixed>
- KSES P
- $errors : array<string|int, mixed>
- Errors
- $plugin_dependencies : array<string|int, mixed>
- Plugin Dependencies
- __construct() : void
- Construct
- ajax_render_media() : void
- Ajax Render Media
- enqueue_admin_scripts() : void
- Enqueue Admin Scripts
- has_errors() : bool
- Has Errors
- init() : void
- Init
- inline_address_script() : void
- Inline Address Script
- inline_code_editor_script() : void
- Inline Code Editor Script
- inline_code_editor_style() : void
- Inline Code Editor Style
- inline_color_picker_script() : void
- Inline Colorpicker Script
- inline_customizer_style() : void
- Inline customizer Style
- inline_date_picker_script() : void
- Inline Date picker Script
- inline_editor_script() : void
- Inline Editor Script
- inline_editor_style() : void
- Inline Editor Style
- inline_global_script() : void
- Inline Global Script
- inline_global_style() : void
- Inline Global Style
- inline_media_mixin_overrides_script() : void
- Inline Media Mixin Overrides Script
- inline_media_uploader_script() : void
- Inline Media Uploader Script
- inline_media_uploader_style() : void
- Inline Media Uploader Style
- inline_nav_menu_item_customizer_script() : void
- Inline Nav Menu Item Customizer Script
- inline_nav_menu_item_script() : void
- Inline Nav Menu Item Script
- inline_options_script() : void
- Inline Options Script
- inline_post_type_script() : void
- Inline Post Type Script
- inline_rest_api_preview_code_editor_script() : void
- Inline REST API Preview Code Editor Script
- inline_taxonomy_script() : void
- Inline Taxonomy Script
- inline_thumbnail_column_style() : void
- Inline Thumbnail Column Style
- inline_user_script() : void
- Inline User Script
- inline_widget_script() : void
- Inline Widget Script
- print_errors() : void
- Print Errors
- render_media_item() : void
- Render Media Item
- is_plugin_active() : bool
- Is Plugin Active
- set_errors() : void
- Set Errors
Properties
$kses_label
KSES Label
public
static array<string|int, mixed>
$kses_label
= array('span' => array('id' => array(), 'class' => array(), 'style' => array()), 'em' => array('id' => array(), 'class' => array(), 'style' => array()), 'strong' => array('id' => array(), 'class' => array(), 'style' => array()), 'code' => array('id' => array(), 'class' => array(), 'style' => array()), 'i' => array('id' => array(), 'class' => array(), 'style' => array()), 'br' => array('id' => array(), 'class' => array(), 'style' => array()))
KSES configuration for label tags.
Tags
$kses_p
KSES P
public
static array<string|int, mixed>
$kses_p
= array('span' => array('id' => array(), 'class' => array(), 'style' => array()), 'a' => array('id' => array(), 'class' => array(), 'style' => array(), 'href' => array(), 'title' => array(), 'target' => array(), 'rel' => array()), 'em' => array('id' => array(), 'class' => array(), 'style' => array()), 'strong' => array('id' => array(), 'class' => array(), 'style' => array()), 'code' => array('id' => array(), 'class' => array(), 'style' => array()), 'i' => array('id' => array(), 'class' => array(), 'style' => array()), 'br' => array('id' => array(), 'class' => array(), 'style' => array()))
KSES configuration for paragraph tags.
Tags
$errors
Errors
protected
array<string|int, mixed>
$errors
= array()
The array of all errors on the instance.
Tags
$plugin_dependencies
Plugin Dependencies
protected
array<string|int, mixed>
$plugin_dependencies
= array()
Example:
array(
'key' => 'classic-editor/classic-editor.php', // The key will be passed to is_plugin_active()
to check.
'name' => _x( 'Classic Editor', 'plugin dependency - classic editor', 'wp_backstage' ),
'url' => 'https://wordpress.org/plugins/classic-editor/',
)
The array of all errors on the instance.
Tags
Methods
__construct()
Construct
public
__construct() : void
Tags
Return values
void —ajax_render_media()
Ajax Render Media
public
ajax_render_media() : void
This method is responsible for providing the ajax response for the media uploader preview.
Tags
Return values
void —enqueue_admin_scripts()
Enqueue Admin Scripts
public
enqueue_admin_scripts() : void
Conditionally enqueue required scripts and styles. This handles enqueues for the media uploader, WP editor, and color picker. This is also responsible for loading up jQuery UI Core and required jQuery UI widgets like the date picker and sortable. Finally, this will initialize all code editor instances.
Tags
Return values
void —has_errors()
Has Errors
public
has_errors() : bool
A utility method to easily check if the instance has errors or not.
Tags
Return values
bool —Whether the instance has errors or not.
init()
Init
public
init() : void
Hook all methods to WordPress.
Tags
Return values
void —inline_address_script()
Inline Address Script
public
inline_address_script() : void
Inlines the address script.
Tags
Return values
void —inline_code_editor_script()
Inline Code Editor Script
public
inline_code_editor_script() : void
Inlines the code editor script. All of the initializer functions fire at window load, to ensure that all CodeMirror instances have finished initializing first.
Tags
Return values
void —inline_code_editor_style()
Inline Code Editor Style
public
inline_code_editor_style() : void
Inlines the code editor field style.
Tags
Return values
void —inline_color_picker_script()
Inline Colorpicker Script
public
inline_color_picker_script() : void
Inlines the color picker script.
Tags
Return values
void —inline_customizer_style()
Inline customizer Style
public
inline_customizer_style() : void
Inlines the customizer style.
Tags
Return values
void —inline_date_picker_script()
Inline Date picker Script
public
inline_date_picker_script() : void
Inlines the date picker script.
Tags
Return values
void —inline_editor_script()
Inline Editor Script
public
inline_editor_script() : void
Inlines the editor script.
Tags
Return values
void —inline_editor_style()
Inline Editor Style
public
inline_editor_style() : void
Inlines the editor field style.
Tags
Return values
void —inline_global_script()
Inline Global Script
public
inline_global_script() : void
Inlines the script that initializes the global wpBackstage
JavaScript object.
Tags
Return values
void —inline_global_style()
Inline Global Style
public
inline_global_style() : void
Tags
Return values
void —inline_media_mixin_overrides_script()
Inline Media Mixin Overrides Script
public
inline_media_mixin_overrides_script() : void
This method is responsible for outputting a script that makes a small override to the native
WordPress wp.media.mixin.removeAllPlayers()
mixin. By default, WordPress kills all media
elements when one is rendered in the WordPress media modal, with no way to ignore that behavior.
The side effect of this is that media elements in the WP Admin are killed when selecting an audio
or video attachment in the media uploader. Because WP Backstage uses WordPress media elements on
audio and video previews in the media uploader fields, it is necessary to provide a way to ignore
these in this function. This function was copied from /wp-includes/js/media-audiovideo.js
, and
adds a simple check for a wp-mediaelement-keep
class to ignore removal.
Tags
Return values
void —inline_media_uploader_script()
Inline Media Uploader Script
public
inline_media_uploader_script() : void
Inlines the media uploader script.
Tags
Return values
void —inline_media_uploader_style()
Inline Media Uploader Style
public
inline_media_uploader_style() : void
Inlines the media uploader field style.
Tags
Return values
void —inline_nav_menu_item_customizer_script()
Inline Nav Menu Item Customizer Script
public
inline_nav_menu_item_customizer_script() : void
Tags
Return values
void —inline_nav_menu_item_script()
Inline Nav Menu Item Script
public
inline_nav_menu_item_script() : void
Tags
Return values
void —inline_options_script()
Inline Options Script
public
inline_options_script() : void
Tags
Return values
void —inline_post_type_script()
Inline Post Type Script
public
inline_post_type_script() : void
Tags
Return values
void —inline_rest_api_preview_code_editor_script()
Inline REST API Preview Code Editor Script
public
inline_rest_api_preview_code_editor_script() : void
This method inlines the CodeMirror settings for the RESP API preview, so that it is available when the REST API preview script needs it.
Tags
Return values
void —inline_taxonomy_script()
Inline Taxonomy Script
public
inline_taxonomy_script() : void
Tags
Return values
void —inline_thumbnail_column_style()
Inline Thumbnail Column Style
public
inline_thumbnail_column_style() : void
Tags
Return values
void —inline_user_script()
Inline User Script
public
inline_user_script() : void
Tags
Return values
void —inline_widget_script()
Inline Widget Script
public
inline_widget_script() : void
Tags
Return values
void —print_errors()
Print Errors
public
print_errors() : void
Tags
Return values
void —render_media_item()
Render Media Item
public
render_media_item(int $attachment_id[, bool $is_multiple = false ]) : void
This method is responsible for rendering a single media item for use in the media uploader field. Taking into account whether the media uploader is rendering multiple items or not, and then taking into account the mime type of the attachment, render a media element. If
Parameters
- $attachment_id : int
-
The ID of the attachment to render.
- $is_multiple : bool = false
-
Whether the media uploader allows multiple attachments or not.
Tags
Return values
void —is_plugin_active()
Is Plugin Active
protected
is_plugin_active(string $plugin) : bool
The native is_plugin_active() function in WordPress does not exist
at the time this class is constructed. This function checks against
the active_plugins
option in the database.
Parameters
- $plugin : string
-
The plugin file name as
classic-editor/classic-editor.php
.
Tags
Return values
bool —set_errors()
Set Errors
protected
set_errors() : void