I am debugging my theme using Debug Bar plugin, which is showing me this error (among a few others):
Notice:
add_custom_image_header
is deprecated since version 3.4! Useadd_theme_support( 'custom-header', $args )
instead.
Okay, clearly, it says I need to use this instead of this. The question is, add_custom_image_header
has three parameters, namely:
- $header_callback
- $admin_header_callback
- $admin_image_div_callback
How do I represent them in add_theme_support
function? Like this?
$aahan_custom_header_args = array(
'wp-head-callback' => '',
'admin-head-callback' => '',
'admin-preview-callback' => '',
);
add_theme_support( 'custom-header', $aahan_custom_header_args );
Also, are wp-head-callback
, admin-head-callback
, and admin-preview-callback
, the exact replacements for $header_callback
, $admin_header_callback
, and $admin_image_div_callback
respectively?
Please read Updating Custom Backgrounds and Custom Headers for WordPress 3.4.
Custom Headers
Old method:
New method:
Again: that was easy, wasn’t it?
Just to clarify, here are the old-constant/new-array-key equivalents:
All of the same callbacks are supported, exactly as before.
For reference, here is the complete defaults array: