Make WordPress Core

Ticket #19417: 19417.refresh.diff

File 19417.refresh.diff, 6.6 KB (added by georgestephanis, 13 years ago)
  • wp-includes/plugin.php

     
    251251 * @param string $tag The filter hook to which the function to be removed is hooked.
    252252 * @param callback $function_to_remove The name of the function which should be removed.
    253253 * @param int $priority optional. The priority of the function (default: 10).
    254  * @param int $accepted_args optional. The number of arguments the function accepts (default: 1).
    255254 * @return boolean Whether the function existed before it was removed.
    256255 */
    257 function remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args = 1) {
     256function remove_filter($tag, $function_to_remove, $priority = 10 ) {
    258257        $function_to_remove = _wp_filter_build_unique_id($tag, $function_to_remove, $priority);
    259258
    260259        $r = isset($GLOBALS['wp_filter'][$tag][$priority][$function_to_remove]);
     
    500499 * @param callback $function_to_check optional. If specified, return the priority of that function on this hook or false if not attached.
    501500 * @return int|boolean Optionally returns the priority on that hook for the specified function.
    502501 */
    503 function has_action($tag, $function_to_check = false) {
    504         return has_filter($tag, $function_to_check);
     502function has_action( $tag, $function_to_check = false ) {
     503        return has_filter( $tag, $function_to_check );
    505504}
    506505
    507506/**
     
    518517 * @param string $tag The action hook to which the function to be removed is hooked.
    519518 * @param callback $function_to_remove The name of the function which should be removed.
    520519 * @param int $priority optional The priority of the function (default: 10).
    521  * @param int $accepted_args optional. The number of arguments the function accepts (default: 1).
    522520 * @return boolean Whether the function is removed.
    523521 */
    524 function remove_action($tag, $function_to_remove, $priority = 10, $accepted_args = 1) {
    525         return remove_filter($tag, $function_to_remove, $priority, $accepted_args);
     522function remove_action( $tag, $function_to_remove, $priority = 10 ) {
     523        return remove_filter( $tag, $function_to_remove, $priority );
    526524}
    527525
    528526/**
  • wp-includes/taxonomy.php

     
    12181218        }
    12191219
    12201220        // $args can be whatever, only use the args defined in defaults to compute the key
    1221         $filter_key = ( has_filter('list_terms_exclusions') ) ? serialize($GLOBALS['wp_filter']['list_terms_exclusions']) : '';
     1221        $filter_key = false !== has_filter( 'list_terms_exclusions' ) ? serialize($GLOBALS['wp_filter']['list_terms_exclusions']) : '';
    12221222        $key = md5( serialize( compact(array_keys($defaults)) ) . serialize( $taxonomies ) . $filter_key );
    12231223        $last_changed = wp_cache_get('last_changed', 'terms');
    12241224        if ( !$last_changed ) {
  • wp-includes/functions.php

     
    984984                $feed = get_default_feed();
    985985
    986986        $hook = 'do_feed_' . $feed;
    987         if ( !has_action($hook) ) {
     987        if ( false === has_action( $hook ) ) {
    988988                $message = sprintf( __( 'ERROR: %s is not a valid feed template.' ), esc_html($feed));
    989989                wp_die( $message, '', array( 'response' => 404 ) );
    990990        }
  • wp-includes/class-wp.php

     
    405405                }
    406406
    407407                // query_string filter deprecated. Use request filter instead.
    408                 if ( has_filter('query_string') ) {  // Don't bother filtering and parsing if no plugins are hooked in.
     408                if ( false !== has_filter( 'query_string' ) ) {  // Don't bother filtering and parsing if no plugins are hooked in.
    409409                        $this->query_string = apply_filters('query_string', $this->query_string);
    410410                        parse_str($this->query_string, $this->query_vars);
    411411                }
  • wp-includes/capabilities.php

     
    11051105
    11061106                $meta_key = isset( $args[ 1 ] ) ? $args[ 1 ] : false;
    11071107
    1108                 if ( $meta_key && has_filter( "auth_post_meta_{$meta_key}" ) ) {
     1108                if ( $meta_key && false !== has_filter( "auth_post_meta_{$meta_key}" ) ) {
    11091109                        $allowed = apply_filters( "auth_post_meta_{$meta_key}", false, $meta_key, $post->ID, $user_id, $cap, $caps );
    11101110                        if ( ! $allowed )
    11111111                                $caps[] = $cap;
  • wp-admin/includes/class-wp-ms-sites-list-table.php

     
    150150                        'users'       => __( 'Users' )
    151151                );
    152152
    153                 if ( has_filter( 'wpmublogsaction' ) )
     153                if ( false !== has_filter( 'wpmublogsaction' ) )
    154154                        $sites_columns['plugins'] = __( 'Actions' );
    155155
    156156                $sites_columns = apply_filters( 'wpmu_blogs_columns', $sites_columns );
     
    317317                                        break;
    318318
    319319                                case 'plugins': ?>
    320                                         <?php if ( has_filter( 'wpmublogsaction' ) ) {
     320                                        <?php if ( false !== has_filter( 'wpmublogsaction' ) ) {
    321321                                        echo "<td valign='top' class='$column_name column-$column_name'$style>";
    322322                                                do_action( 'wpmublogsaction', $blog['blog_id'] ); ?>
    323323                                        </td>
  • wp-admin/includes/plugin.php

     
    15071507
    15081508function get_plugin_page_hook( $plugin_page, $parent_page ) {
    15091509        $hook = get_plugin_page_hookname( $plugin_page, $parent_page );
    1510         if ( has_action($hook) )
     1510        if ( false !== has_action($hook) )
    15111511                return $hook;
    15121512        else
    15131513                return null;
  • wp-admin/user-edit.php

     
    207207                <td><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="false" <?php checked('false', $profileuser->rich_editing); ?> /> <?php _e('Disable the visual editor when writing'); ?></label></td>
    208208        </tr>
    209209<?php endif; ?>
    210 <?php if ( count($_wp_admin_css_colors) > 1 && has_action('admin_color_scheme_picker') ) : ?>
     210<?php if ( ( count( $_wp_admin_css_colors ) > 1 ) && ( false !== has_action( 'admin_color_scheme_picker' ) ) ) : ?>
    211211<tr>
    212212<th scope="row"><?php _e('Admin Color Scheme')?></th>
    213213<td><?php do_action( 'admin_color_scheme_picker' ); ?></td>