WordPress.org

Make WordPress Core

Changeset 27910


Ignore:
Timestamp:
04/02/2014 06:30:06 PM (6 years ago)
Author:
ocean90
Message:

Widget Customizer: Remove leading underscores from public methods.

Fix also an incorrect hook name in stop_capturing_option_updates().

props DrewAPicture.
see #27534.

File:
1 edited

Legend:

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

    r27907 r27910  
    13691369        $this->_is_capturing_option_updates = true;
    13701370
    1371         add_filter( 'pre_update_option', array( $this, '_capture_filter_pre_update_option' ), 10, 3 );
     1371        add_filter( 'pre_update_option', array( $this, 'capture_filter_pre_update_option' ), 10, 3 );
    13721372    }
    13731373
     
    13831383     * @return mixed
    13841384     */
    1385     public function _capture_filter_pre_update_option( $new_value, $option_name, $old_value ) {
     1385    public function capture_filter_pre_update_option( $new_value, $option_name, $old_value ) {
    13861386        if ( $this->is_option_capture_ignored( $option_name ) ) {
    13871387            return;
     
    13891389
    13901390        if ( ! isset( $this->_captured_options[$option_name] ) ) {
    1391             add_filter( "pre_option_{$option_name}", array( $this, '_capture_filter_pre_get_option' ) );
     1391            add_filter( "pre_option_{$option_name}", array( $this, 'capture_filter_pre_get_option' ) );
    13921392        }
    13931393
     
    14061406     * @return mixed
    14071407     */
    1408     public function _capture_filter_pre_get_option( $value ) {
     1408    public function capture_filter_pre_get_option( $value ) {
    14091409        $option_name = preg_replace( '/^pre_option_/', '', current_filter() );
    14101410
     
    14281428        }
    14291429
    1430         remove_filter( '_capture_filter_pre_update_option', array( $this, '_capture_filter_pre_update_option' ), 10, 3 );
     1430        remove_filter( 'pre_update_option', array( $this, 'capture_filter_pre_update_option' ), 10, 3 );
     1431
    14311432        foreach ( array_keys( $this->_captured_options ) as $option_name ) {
    1432             remove_filter( "pre_option_{$option_name}", array( $this, '_capture_filter_pre_get_option' ) );
     1433            remove_filter( "pre_option_{$option_name}", array( $this, 'capture_filter_pre_get_option' ) );
    14331434        }
    14341435
Note: See TracChangeset for help on using the changeset viewer.