Parsed: 126916

<?php

/**
 * Core Widgets API
 *
 * This API is used for creating dynamic sidebar without hardcoding functionality into
 * themes
 *
 * Includes both internal WordPress routines and theme-use routines.
 *
 * This functionality was found in a plugin before the WordPress 2.2 release, which
 * included it in the core from that point on.
 *
 * @link https://wordpress.org/support/article/wordpress-widgets/
 * @link https://developer.wordpress.org/themes/functionality/widgets/
 *
 * @package WordPress
 * @subpackage Widgets
 * @since 2.2.0
 */

//
// Global Variables.
//


/** @ignore */
global $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates;


/**
 * Stores the sidebars, since many themes can have more than one.
 *
 * @global array $wp_registered_sidebars Registered sidebars.
 * @since 2.2.0
 */
$wp_registered_sidebars = array();


/**
 * Stores the registered widgets.
 *
 * @global array $wp_registered_widgets
 * @since 2.2.0
 */
$wp_registered_widgets = array();


/**
 * Stores the registered widget controls (options).
 *
 * @global array $wp_registered_widget_controls
 * @since 2.2.0
 */
$wp_registered_widget_controls = array();

/**
 * @global array $wp_registered_widget_updates
 */
$wp_registered_widget_updates = array();


/**
 * Private
 *
 * @global array $_wp_sidebars_widgets
 */
$_wp_sidebars_widgets = array();


/**
 * Private
 *
 * @global array $_wp_deprecated_widgets_callbacks
 */
$GLOBALS['_wp_deprecated_widgets_callbacks'] = array(
  'wp_widget_pages',
  'wp_widget_pages_control',
  'wp_widget_calendar',
  'wp_widget_calendar_control',
  'wp_widget_archives',
  'wp_widget_archives_control',
  'wp_widget_links',
  'wp_widget_meta',
  'wp_widget_meta_control',
  'wp_widget_search',
  'wp_widget_recent_entries',
  'wp_widget_recent_entries_control',
  'wp_widget_tag_cloud',
  'wp_widget_tag_cloud_control',
  'wp_widget_categories',
  'wp_widget_categories_control',
  'wp_widget_text',
  'wp_widget_text_control',
  'wp_widget_rss',
  'wp_widget_rss_control',
  'wp_widget_recent_comments',
  'wp_widget_recent_comments_control',
);

//
// Template tags & API functions.
//

/* function register_widget() – Register a widget */

/* function unregister_widget() – Unregisters a widget. */

/* function register_sidebars() – Creates multiple sidebars. */

/* function register_sidebar() – Builds the definition for a single sidebar and returns the ID. */

/* function unregister_sidebar() – Removes a sidebar from the list. */

/* function is_registered_sidebar() – Checks if a sidebar is registered. */

/* function wp_register_sidebar_widget() – Register an instance of a widget. */

/* function wp_widget_description() – Retrieve description for widget. */

/* function wp_sidebar_description() – Retrieve description for a sidebar. */

/* function wp_unregister_sidebar_widget() – Remove widget from sidebar. */

/* function wp_register_widget_control() – Registers widget control callback for customizing options. */

/* function _register_widget_update_callback() – Registers the update callback for a widget. */


/* function _register_widget_form_callback() – Registers the form callback for a widget. */

/* function wp_unregister_widget_control() – Remove control callback for widget. */

/* function dynamic_sidebar() – Display dynamic sidebar. */

/* function is_active_widget() – Determines whether a given widget is displayed on the front end. */

/* function is_dynamic_sidebar() – Determines whether the dynamic sidebar is enabled and used by the theme. */

/* function is_active_sidebar() – Determines whether a sidebar is in use. */

//
// Internal Functions.
//

/* function wp_get_sidebars_widgets() – Retrieve full list of sidebars and their widget instance IDs. */

/* function wp_get_sidebar() – Retrieves the registered sidebar with the given ID. */

/* function wp_set_sidebars_widgets() – Set the sidebar widget option to update sidebars. */

/* function wp_get_widget_defaults() – Retrieve default registered sidebars list. */

/* function wp_convert_widget_settings() – Converts the widget settings from single to multi-widget format. */

/* function the_widget() – Output an arbitrary widget as a template tag. */

/* function _get_widget_id_base() – Retrieves the widget ID base value. */

/* function _wp_sidebars_changed() – Handle sidebars config after theme change */

/* function retrieve_widgets() – Validates and remaps any "orphaned" widgets to wp_inactive_widgets sidebar,
and saves the widget settings. This has to run at least on each theme change. */

/* function wp_map_sidebars_widgets() – Compares a list of sidebars with their widgets against a whitelist. */

/* function _wp_remove_unregistered_widgets() – Compares a list of sidebars with their widgets against an allowed list. */

/* function wp_widget_rss_output() – Display the RSS entries in a list. */

/* function wp_widget_rss_form() – Display RSS widget options form. */

/* function wp_widget_rss_process() – Process RSS feed widget data and optionally retrieve feed items. */

/* function wp_widgets_init() – Registers all of the default WordPress widgets on startup. */

/* function wp_setup_widgets_block_editor() – Enables the widgets block editor. This is hooked into ‘after_setup_theme’ so
that the block editor is enabled by default but can be disabled by themes. */

/* function wp_use_widgets_block_editor() – Whether or not to use the block editor to manage widgets. Defaults to true
unless a theme has removed support for widgets-block-editor or a plugin has
filtered the return value of this function. */

/* function wp_parse_widget_id() – Converts a widget ID into its id_base and number components. */

/* function wp_find_widgets_sidebar() – Finds the sidebar that a given widget belongs to. */

/* function wp_assign_widget_to_sidebar() – Assigns a widget to the given sidebar. */

/* function wp_render_widget() – Calls the render callback of a widget and returns the output. */

/* function wp_render_widget_control() – Calls the control callback of a widget and returns the output. */

/* function wp_check_widget_editor_deps() – Displays a _doing_it_wrong() message for conflicting widget editor scripts. */