Make WordPress Core

Changeset 30774


Ignore:
Timestamp:
12/07/2014 08:07:05 PM (11 years ago)
Author:
DrewAPicture
Message:

Introduce documentation for three methods in WP_Widget_Factory: register(), unregister(), _register_widgets().

See #30315.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets.php

    r30773 r30774  
    549549    }
    550550
    551     public function register($widget_class) {
     551    /**
     552     * Register a widget subclass.
     553     *
     554     * @since 2.8.0
     555     * @access public
     556     *
     557     * @param string $widget_class The name of a {@see WP_Widget} subclass.
     558     */
     559    public function register( $widget_class ) {
    552560        $this->widgets[$widget_class] = new $widget_class();
    553561    }
    554562
    555     public function unregister($widget_class) {
     563    /**
     564     * Un-register a widget subclass.
     565     *
     566     * @since 2.8.0
     567     * @access public
     568     *
     569     * @param string $widget_class The name of a {@see WP_Widget} subclass.
     570     */
     571    public function unregister( $widget_class ) {
    556572        if ( isset($this->widgets[$widget_class]) )
    557573            unset($this->widgets[$widget_class]);
    558574    }
    559575
     576    /**
     577     * Utility method for adding widgets to the registered widgets global.
     578     *
     579     * @since 2.8.0
     580     * @access public
     581     */
    560582    public function _register_widgets() {
    561583        global $wp_registered_widgets;
Note: See TracChangeset for help on using the changeset viewer.