~canonical-sysadmins/wordpress/4.9.2

« back to all changes in this revision

Viewing changes to wp-includes/widgets/class-wp-widget-meta.php

  • Committer: Barry Price
  • Date: 2017-11-17 04:49:02 UTC
  • mfrom: (1.1.30 upstream)
  • Revision ID: barry.price@canonical.com-20171117044902-5frux4ycbq6g9fyf
Merge WP4.9 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
         * Sets up a new Meta widget instance.
23
23
         *
24
24
         * @since 2.8.0
25
 
         * @access public
26
25
         */
27
26
        public function __construct() {
28
27
                $widget_ops = array(
37
36
         * Outputs the content for the current Meta widget instance.
38
37
         *
39
38
         * @since 2.8.0
40
 
         * @access public
41
39
         *
42
40
         * @param array $args     Display arguments including 'before_title', 'after_title',
43
41
         *                        'before_widget', and 'after_widget'.
44
42
         * @param array $instance Settings for the current Meta widget instance.
45
43
         */
46
44
        public function widget( $args, $instance ) {
 
45
                $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Meta' );
 
46
 
47
47
                /** 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 );
 
48
                $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
49
49
 
50
50
                echo $args['before_widget'];
 
51
 
51
52
                if ( $title ) {
52
53
                        echo $args['before_title'] . $title . $args['after_title'];
53
54
                }
62
63
                         * Filters the "Powered by WordPress" text in the Meta widget.
63
64
                         *
64
65
                         * @since 3.6.0
 
66
                         * @since 4.9.0 Added the `$instance` parameter.
65
67
                         *
66
68
                         * @param string $title_text Default title text for the WordPress.org link.
 
69
                         * @param array  $instance   Array of settings for the current widget.
67
70
                         */
68
71
                        echo apply_filters( 'widget_meta_poweredby', sprintf( '<li><a href="%s" title="%s">%s</a></li>',
69
72
                                esc_url( __( 'https://wordpress.org/' ) ),
70
73
                                esc_attr__( 'Powered by WordPress, state-of-the-art semantic personal publishing platform.' ),
71
74
                                _x( 'WordPress.org', 'meta widget link text' )
72
 
                        ) );
 
75
                        ), $instance );
73
76
 
74
77
                        wp_meta();
75
78
                        ?>
76
79
                        </ul>
77
80
                        <?php
 
81
 
78
82
                echo $args['after_widget'];
79
83
        }
80
84
 
82
86
         * Handles updating settings for the current Meta widget instance.
83
87
         *
84
88
         * @since 2.8.0
85
 
         * @access public
86
89
         *
87
90
         * @param array $new_instance New settings for this instance as input by the user via
88
91
         *                            WP_Widget::form().
100
103
         * Outputs the settings form for the Meta widget.
101
104
         *
102
105
         * @since 2.8.0
103
 
         * @access public
104
106
         *
105
107
         * @param array $instance Current settings.
106
108
         */