WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/12/2015 04:39:39 PM (7 years ago)
Author:
wonderboymusic
Message:

There are some random add_action() and add_filter() calls littered around some files in wp-includes/. These should be moved to wp-includes/default-filters.php with the rest of the registered hooks. It seems like this was the best practice for awhile and then we randomly stopped. This file loads way before any of the includes, so the hooks will be registered for any request that loads WordPress, even SHORTINIT - a lot of the hooks registered won't run anyways (that's already the case).

See #30947.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/theme.php

    r30982 r31168  
    677677    ob_start( 'preview_theme_ob_filter' );
    678678}
    679 add_action('setup_theme', 'preview_theme');
    680679
    681680/**
     
    16641663    }
    16651664}
    1666 add_action( 'wp_loaded', '_custom_header_background_just_in_time' );
    16671665
    16681666/**
     
    18721870        remove_theme_mod( 'background_image' );
    18731871}
    1874 
    1875 add_action( 'delete_attachment', '_delete_attachment_theme_mod' );
    18761872
    18771873/**
     
    19311927    $GLOBALS['wp_customize'] = new WP_Customize_Manager;
    19321928}
    1933 add_action( 'plugins_loaded', '_wp_customize_include' );
    19341929
    19351930/**
     
    19671962    $wp_scripts->add_data( 'customize-loader', 'data', $script );
    19681963}
    1969 add_action( 'admin_enqueue_scripts', '_wp_customize_loader_settings' );
    19701964
    19711965/**
Note: See TracChangeset for help on using the changeset viewer.