From b7ffec08f87387033cde2e32d9138cf7d93b927d Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sun, 17 Oct 2010 07:12:34 +0000 Subject: [PATCH] Allow disabling of custom header uploads via remove_theme_support. props jorbin, fixes #14837. git-svn-id: https://develop.svn.wordpress.org/trunk@15828 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/custom-header.php | 13 ++++++++++++- wp-includes/theme.php | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 1738101f73..659512df1e 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -456,7 +456,7 @@ class Custom_Image_Header { - + @@ -473,6 +473,7 @@ class Custom_Image_Header { + @@ -483,7 +484,11 @@ class Custom_Image_Header { +

+ +

+ show_default_header_selector(); ?> @@ -570,6 +575,9 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> */ function step_2() { check_admin_referer('custom-header-upload', '_wpnonce-custom-header-upload'); + if ( ! current_theme_supports( 'custom-header-uploads' ) ) + wp_die( 'Cheatin’ uh?' ); + $overrides = array('test_form' => false); $file = wp_handle_upload($_FILES['import'], $overrides); @@ -650,6 +658,9 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> */ function step_3() { check_admin_referer('custom-header-crop-image'); + if ( ! current_theme_supports( 'custom-header-uploads' ) ) + wp_die( 'Cheatin’ uh?' ); + if ( $_POST['oitar'] > 1 ) { $_POST['x1'] = $_POST['x1'] * $_POST['oitar']; $_POST['y1'] = $_POST['y1'] * $_POST['oitar']; diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 0064b4d5a6..a17a83b08f 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1467,6 +1467,7 @@ function add_custom_image_header($header_callback, $admin_header_callback, $admi add_action('wp_head', $header_callback); add_theme_support( 'custom-header' ); + add_theme_support( 'custom-header-uploads' ); if ( ! is_admin() ) return;