WordPress.org

Make WordPress Core

Ticket #39909: 39909.patch

File 39909.patch, 9.9 KB (added by bor0, 3 years ago)
  • wp-includes/widgets/class-wp-nav-menu-widget.php

     
    4141         * @param array $instance Settings for the current Custom Menu widget instance.
    4242         */
    4343        public function widget( $args, $instance ) {
     44                if ( empty( $instance['title'] ) ) {
     45                        $instance['title'] = $this->name;
     46                }
     47
    4448                // Get menu
    4549                $nav_menu = ! empty( $instance['nav_menu'] ) ? wp_get_nav_menu_object( $instance['nav_menu'] ) : false;
    4650
     
    4852                        return;
    4953
    5054                /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
    51                 $instance['title'] = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
     55                $instance['title'] = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    5256
    5357                echo $args['before_widget'];
    5458
  • wp-includes/widgets/class-wp-widget-archives.php

     
    4242         * @param array $instance Settings for the current Archives widget instance.
    4343         */
    4444        public function widget( $args, $instance ) {
     45                if ( empty( $instance['title'] ) ) {
     46                        $instance['title'] = $this->name;
     47                }
     48
    4549                $c = ! empty( $instance['count'] ) ? '1' : '0';
    4650                $d = ! empty( $instance['dropdown'] ) ? '1' : '0';
    4751
    4852                /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
    49                 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Archives' ) : $instance['title'], $instance, $this->id_base );
     53                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    5054
    5155                echo $args['before_widget'];
    5256                if ( $title ) {
  • wp-includes/widgets/class-wp-widget-calendar.php

     
    5252         * @param array $instance The settings for the particular instance of the widget.
    5353         */
    5454        public function widget( $args, $instance ) {
     55                if ( empty( $instance['title'] ) ) {
     56                        $instance['title'] = $this->name;
     57                }
     58
    5559                /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
    56                 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
     60                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    5761
    5862                echo $args['before_widget'];
    5963                if ( $title ) {
  • wp-includes/widgets/class-wp-widget-categories.php

     
    4242         * @param array $instance Settings for the current Categories widget instance.
    4343         */
    4444        public function widget( $args, $instance ) {
     45                if ( empty( $instance['title'] ) ) {
     46                        $instance['title'] = $this->name;
     47                }
     48
    4549                static $first_dropdown = true;
    4650
    4751                /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
    48                 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Categories' ) : $instance['title'], $instance, $this->id_base );
     52                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    4953
    5054                $c = ! empty( $instance['count'] ) ? '1' : '0';
    5155                $h = ! empty( $instance['hierarchical'] ) ? '1' : '0';
  • wp-includes/widgets/class-wp-widget-meta.php

     
    4444         * @param array $instance Settings for the current Meta widget instance.
    4545         */
    4646        public function widget( $args, $instance ) {
     47                if ( empty( $instance['title'] ) ) {
     48                        $instance['title'] = $this->name;
     49                }
     50
    4751                /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
    48                 $title = apply_filters( 'widget_title', empty($instance['title']) ? __( 'Meta' ) : $instance['title'], $instance, $this->id_base );
     52                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    4953
    5054                echo $args['before_widget'];
    5155                if ( $title ) {
  • wp-includes/widgets/class-wp-widget-pages.php

     
    4242         * @param array $instance Settings for the current Pages widget instance.
    4343         */
    4444        public function widget( $args, $instance ) {
     45                if ( empty( $instance['title'] ) ) {
     46                        $instance['title'] = $this->name;
     47                }
    4548
    4649                /**
    4750                 * Filters the widget title.
     
    5255                 * @param array  $instance An array of the widget's settings.
    5356                 * @param mixed  $id_base  The widget ID.
    5457                 */
    55                 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Pages' ) : $instance['title'], $instance, $this->id_base );
     58                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    5659
    5760                $sortby = empty( $instance['sortby'] ) ? 'menu_order' : $instance['sortby'];
    5861                $exclude = empty( $instance['exclude'] ) ? '' : $instance['exclude'];
  • wp-includes/widgets/class-wp-widget-recent-comments.php

     
    7070         * @param array $instance Settings for the current Recent Comments widget instance.
    7171         */
    7272        public function widget( $args, $instance ) {
     73                if ( empty( $instance['title'] ) ) {
     74                        $instance['title'] = $this->name;
     75                }
     76
    7377                if ( ! isset( $args['widget_id'] ) )
    7478                        $args['widget_id'] = $this->id;
    7579
    7680                $output = '';
    7781
    78                 $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Comments' );
    79 
    8082                /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
    81                 $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
     83                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    8284
    8385                $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5;
    8486                if ( ! $number )
  • wp-includes/widgets/class-wp-widget-recent-posts.php

     
    4343         * @param array $instance Settings for the current Recent Posts widget instance.
    4444         */
    4545        public function widget( $args, $instance ) {
     46                if ( empty( $instance['title'] ) ) {
     47                        $instance['title'] = $this->name;
     48                }
     49
    4650                if ( ! isset( $args['widget_id'] ) ) {
    4751                        $args['widget_id'] = $this->id;
    4852                }
    4953
    50                 $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Posts' );
    51 
    5254                /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
    53                 $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
     55                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    5456
    5557                $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5;
    5658                if ( ! $number )
  • wp-includes/widgets/class-wp-widget-rss.php

     
    4545                if ( isset($instance['error']) && $instance['error'] )
    4646                        return;
    4747
     48                if ( empty( $instance['title'] ) ) {
     49                        $instance['title'] = $this->name;
     50                }
     51
    4852                $url = ! empty( $instance['url'] ) ? $instance['url'] : '';
    4953                while ( stristr($url, 'http') != $url )
    5054                        $url = substr($url, 1);
  • wp-includes/widgets/class-wp-widget-search.php

     
    4242         * @param array $instance Settings for the current Search widget instance.
    4343         */
    4444        public function widget( $args, $instance ) {
     45                if ( empty( $instance['title'] ) ) {
     46                        $instance['title'] = $this->name;
     47                }
     48
    4549                /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
    46                 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
     50                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    4751
    4852                echo $args['before_widget'];
    4953                if ( $title ) {
  • wp-includes/widgets/class-wp-widget-text.php

     
    4343         * @param array $instance Settings for the current Text widget instance.
    4444         */
    4545        public function widget( $args, $instance ) {
     46                if ( empty( $instance['title'] ) ) {
     47                        $instance['title'] = $this->name;
     48                }
    4649
    4750                /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
    48                 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
     51                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    4952
    5053                $widget_text = ! empty( $instance['text'] ) ? $instance['text'] : '';
    5154