Allow disabling of custom header uploads via remove_theme_support. props jorbin, fixes #14837.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ddae2a0b15
commit
d91842f870
|
@ -456,7 +456,7 @@ class Custom_Image_Header {
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php if ( current_theme_supports( 'custom-header-uploads' ) ) : ?>
|
||||||
<tr valign="top">
|
<tr valign="top">
|
||||||
<th scope="row"><?php _e( 'Upload Image' ); ?></th>
|
<th scope="row"><?php _e( 'Upload Image' ); ?></th>
|
||||||
<td>
|
<td>
|
||||||
|
@ -473,6 +473,7 @@ class Custom_Image_Header {
|
||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@ -483,7 +484,11 @@ class Custom_Image_Header {
|
||||||
<tr valign="top">
|
<tr valign="top">
|
||||||
<th scope="row"><?php _e( 'Default Images' ); ?></th>
|
<th scope="row"><?php _e( 'Default Images' ); ?></th>
|
||||||
<td>
|
<td>
|
||||||
|
<?php if ( current_theme_supports( 'custom-header-uploads' ) ) : ?>
|
||||||
<p><?php _e( 'If you don‘t want to upload your own image, you can use one of these cool headers.' ) ?></p>
|
<p><?php _e( 'If you don‘t want to upload your own image, you can use one of these cool headers.' ) ?></p>
|
||||||
|
<?php else: ?>
|
||||||
|
<p><?php _e( 'You can use one of these cool headers.' ) ?>
|
||||||
|
<?php endif; ?>
|
||||||
<?php
|
<?php
|
||||||
$this->show_default_header_selector();
|
$this->show_default_header_selector();
|
||||||
?>
|
?>
|
||||||
|
@ -570,6 +575,9 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
|
||||||
*/
|
*/
|
||||||
function step_2() {
|
function step_2() {
|
||||||
check_admin_referer('custom-header-upload', '_wpnonce-custom-header-upload');
|
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);
|
$overrides = array('test_form' => false);
|
||||||
$file = wp_handle_upload($_FILES['import'], $overrides);
|
$file = wp_handle_upload($_FILES['import'], $overrides);
|
||||||
|
|
||||||
|
@ -650,6 +658,9 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
|
||||||
*/
|
*/
|
||||||
function step_3() {
|
function step_3() {
|
||||||
check_admin_referer('custom-header-crop-image');
|
check_admin_referer('custom-header-crop-image');
|
||||||
|
if ( ! current_theme_supports( 'custom-header-uploads' ) )
|
||||||
|
wp_die( 'Cheatin’ uh?' );
|
||||||
|
|
||||||
if ( $_POST['oitar'] > 1 ) {
|
if ( $_POST['oitar'] > 1 ) {
|
||||||
$_POST['x1'] = $_POST['x1'] * $_POST['oitar'];
|
$_POST['x1'] = $_POST['x1'] * $_POST['oitar'];
|
||||||
$_POST['y1'] = $_POST['y1'] * $_POST['oitar'];
|
$_POST['y1'] = $_POST['y1'] * $_POST['oitar'];
|
||||||
|
|
|
@ -1467,6 +1467,7 @@ function add_custom_image_header($header_callback, $admin_header_callback, $admi
|
||||||
add_action('wp_head', $header_callback);
|
add_action('wp_head', $header_callback);
|
||||||
|
|
||||||
add_theme_support( 'custom-header' );
|
add_theme_support( 'custom-header' );
|
||||||
|
add_theme_support( 'custom-header-uploads' );
|
||||||
|
|
||||||
if ( ! is_admin() )
|
if ( ! is_admin() )
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue