Make WordPress Core


Ignore:
Timestamp:
10/18/2021 05:51:17 PM (4 years ago)
Author:
hellofromTonya
Message:

Coding Standards: Add public visibility to methods in src directory.

This commit adds the public visibility keyword to each method which did not have an explicit visibility keyword.

Why public?

With no visibility previously declared, these methods are implicitly public and available for use. Changing them to anything else would be a backwards-compatibility break.

Props costdev, jrf.
See #54177.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyeleven/inc/widgets.php

    r47808 r51919  
    1818     * @since Twenty Eleven 2.2
    1919     */
    20     function __construct() {
     20    public function __construct() {
    2121        parent::__construct(
    2222            'widget_twentyeleven_ephemera',
     
    4141     * @deprecated Twenty Eleven 2.2
    4242     */
    43     function Twenty_Eleven_Ephemera_Widget() {
     43    public function Twenty_Eleven_Ephemera_Widget() {
    4444        self::__construct();
    4545    }
     
    5353     * @param array $instance An array of settings for this widget instance.
    5454     */
    55     function widget( $args, $instance ) {
     55    public function widget( $args, $instance ) {
    5656        $cache = wp_cache_get( 'widget_twentyeleven_ephemera', 'widget' );
    5757
     
    159159     * @since Twenty Eleven 1.0
    160160     */
    161     function update( $new_instance, $old_instance ) {
     161    public function update( $new_instance, $old_instance ) {
    162162        $instance           = $old_instance;
    163163        $instance['title']  = strip_tags( $new_instance['title'] );
     
    178178     * @since Twenty Eleven 1.0
    179179     */
    180     function flush_widget_cache() {
     180    public function flush_widget_cache() {
    181181        wp_cache_delete( 'widget_twentyeleven_ephemera', 'widget' );
    182182    }
     
    189189     * @since Twenty Eleven 1.0
    190190     */
    191     function form( $instance ) {
     191    public function form( $instance ) {
    192192        $title  = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
    193193        $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 10;
Note: See TracChangeset for help on using the changeset viewer.