PATH:
home
/
bnathsfovv
/
lm2017.info
/
wp-includes
<?php /** * Widget API: WP_Widget_Factory class * * @package WordPress * @subpackage Widgets * @since 4.4.0 */ /** * Singleton that registers and instantiates WP_Widget classes. * * @since 2.8.0 * @since 4.4.0 Moved to its own file from wp-includes/widgets.php */ #[AllowDynamicProperties] class WP_Widget_Factory { /** * Widgets array. * * @since 2.8.0 * @var array */ public $widgets = array(); /** * PHP5 constructor. * * @since 4.3.0 */ public function __construct() { add_action( 'widgets_init', array( $this, '_register_widgets' ), 100 ); } /** * PHP4 constructor. * * @since 2.8.0 * @deprecated 4.3.0 Use __construct() instead. * * @see WP_Widget_Factory::__construct() */ public function WP_Widget_Factory() { _deprecated_constructor( 'WP_Widget_Factory', '4.3.0' ); self::__construct(); } /** * Registers a widget subclass. * * @since 2.8.0 * @since 4.6.0 Updated the `$widget` parameter to also accept a WP_Widget instance object * instead of simply a `WP_Widget` subclass name. * * @param string|WP_Widget $widget Either the name of a `WP_Widget` subclass or an instance of a `WP_Widget` subclass. */ public function register( $widget ) { if ( $widget instanceof WP_Widget ) { $this->widgets[ spl_object_hash( $widget ) ] = $widget; } else { $this->widgets[ $widget ] = new $widget(); } } /** * Un-registers a widget subclass. * * @since 2.8.0 * @since 4.6.0 Updated the `$widget` parameter to also accept a WP_Widget instance object * instead of simply a `WP_Widget` subclass name. * * @param string|WP_Widget $widget Either the name of a `WP_Widget` subclass or an instance of a `WP_Widget` subclass. */ public function unregister( $widget ) { if ( $widget instanceof WP_Widget ) { unset( $this->widgets[ spl_object_hash( $widget ) ] ); } else { unset( $this->widgets[ $widget ] ); } } /** * Serves as a utility method for adding widgets to the registered widgets global. * * @since 2.8.0 * * @global array $wp_registered_widgets */ public function _register_widgets() { global $wp_registered_widgets; $keys = array_keys( $this->widgets ); $registered = array_keys( $wp_registered_widgets ); $registered = array_map( '_get_widget_id_base', $registered ); foreach ( $keys as $key ) { // Don't register new widget if old widget with the same id is already registered. if ( in_array( $this->widgets[ $key ]->id_base, $registered, true ) ) { unset( $this->widgets[ $key ] ); continue; } $this->widgets[ $key ]->_register(); } } /** * Returns the registered WP_Widget object for the given widget type. * * @since 5.8.0 * * @param string $id_base Widget type ID. * @return WP_Widget|null */ public function get_widget_object( $id_base ) { $key = $this->get_widget_key( $id_base ); if ( '' === $key ) { return null; } return $this->widgets[ $key ]; } /** * Returns the registered key for the given widget type. * * @since 5.8.0 * * @param string $id_base Widget type ID. * @return string */ public function get_widget_key( $id_base ) { foreach ( $this->widgets as $key => $widget_object ) { if ( $widget_object->id_base === $id_base ) { return $key; } } return ''; } }
[+]
..
[-] block-editor.php
[edit]
[+]
fonts
[-] fonts.php
[edit]
[+]
ID3
[-] error-protection.php
[edit]
[-] class-wp-theme.php
[edit]
[+]
blocks
[-] class-wp-oembed.php
[edit]
[-] class-wp-recovery-mode-email-service.php
[edit]
[-] class-wp-simplepie-file.php
[edit]
[+]
Text
[-] theme-i18n.json
[edit]
[-] session.php
[edit]
[+]
build
[-] default-constants.php
[edit]
[-] abilities-api.php
[edit]
[+]
Requests
[-] class-wp-text-diff-renderer-table.php
[edit]
[-] robots-template.php
[edit]
[-] revision.php
[edit]
[-] class-wp-list-util.php
[edit]
[+]
sodium_compat
[-] cache.php
[edit]
[+]
block-supports
[-] class-walker-page.php
[edit]
[-] embed.php
[edit]
[+]
rest-api
[+]
customize
[-] shortcodes.php
[edit]
[-] class-wp.php
[edit]
[-] meta.php
[edit]
[+]
theme-compat
[-] pluggable-deprecated.php
[edit]
[+]
php-compat
[-] class-wp-http-cookie.php
[edit]
[-] bookmark.php
[edit]
[-] class-wp-text-diff-renderer-inline.php
[edit]
[-] class-wp-block-bindings-registry.php
[edit]
[-] class-pop3.php
[edit]
[-] locale.php
[edit]
[-] class-wp-block-list.php
[edit]
[+]
IXR
[+]
images
[-] registration.php
[edit]
[+]
abilities-api
[+]
SimplePie
[-] class-wp-comment.php
[edit]
[-] user.php
[edit]
[-] class-phpass.php
[edit]
[-] class-wp-fatal-error-handler.php
[edit]
[-] general-template.php
[edit]
[+]
PHPMailer
[-] class-wp-recovery-mode-cookie-service.php
[edit]
[-] cron.php
[edit]
[+]
css
[-] connectors.php
[edit]
[-] class-wp-block-type.php
[edit]
[-] block-patterns.php
[edit]
[+]
html-api
[+]
widgets
[-] class-wp-paused-extensions-storage.php
[edit]
[-] nav-menu-template.php
[edit]
[-] class-walker-category-dropdown.php
[edit]
[-] class-json.php
[edit]
[-] template-loader.php
[edit]
[+]
style-engine
[-] post-formats.php
[edit]
[-] class-wp-connector-registry.php
[edit]
[-] post-template.php
[edit]
[-] feed-rss.php
[edit]
[+]
sitemaps
[-] class-wp-widget-factory.php
[edit]
[-] class-wp-block-pattern-categories-registry.php
[edit]
[+]
block-bindings
[-] class-wp-recovery-mode-key-service.php
[edit]
[-] class-wp-icons-registry.php
[edit]
[+]
certificates
[-] class-wp-block-editor-context.php
[edit]
[-] spl-autoload-compat.php
[edit]
[-] class-wp-matchesmapregex.php
[edit]
[-] ms-settings.php
[edit]
[-] media.php
[edit]
[-] class-wp-user-meta-session-tokens.php
[edit]
[-] class-wp-role.php
[edit]
[-] class-wp-date-query.php
[edit]
[-] class-oembed.php
[edit]
[+]
interactivity-api
[-] class-wp-http-streams.php
[edit]
[-] sitemaps.php
[edit]
[-] class-wp-block-supports.php
[edit]
[+]
assets
[-] class-wp-theme-json.php
[edit]
[-] class-wp-user.php
[edit]
[-] class-wp-session-tokens.php
[edit]
[-] default-widgets.php
[edit]
[-] class-wp-classic-to-block-menu-converter.php
[edit]
[-] cache-compat.php
[edit]
[-] class-wp-block-type-registry.php
[edit]
[-] bookmark-template.php
[edit]
[-] class-wp-plugin-dependencies.php
[edit]
[-] class-wp-token-map.php
[edit]
[-] block-bindings.php
[edit]
[+]
php-ai-client
[+]
ai-client
[-] class-wp-block-templates-registry.php
[edit]
[-] ms-default-filters.php
[edit]
[-] block-i18n.json
[edit]
[+]
block-patterns
[-] class-walker-comment.php
[edit]
[+]
js
[-] theme-previews.php
[edit]
[-] class-wp-network.php
[edit]
[-] ms-default-constants.php
[edit]
[+]
pomo
[-] class-wp-recovery-mode-link-service.php
[edit]
[-] default-filters.php
[edit]
[-] kses.php
[edit]
[-] rss.php
[edit]
[-] class-wp-block-styles-registry.php
[edit]
[-] ai-client.php
[edit]
[-] class-wp-post-type.php
[edit]
[+]
l10n
[-] ms-files.php
[edit]
[-] global-styles-and-settings.php
[edit]
[-] blocks.php
[edit]