Make WordPress Core

Ticket #17115: disable-submit-inputs-meta-boxes.diff

File disable-submit-inputs-meta-boxes.diff, 3.4 KB (added by eddieringle, 13 years ago)

Initially disable submit inputs (meta-boxes.php)

  • wp-admin/includes/meta-boxes.php

     
    2222
    2323<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
    2424<div style="display:none;">
    25 <?php submit_button( __( 'Save' ), 'button', 'save' ); ?>
     25<?php submit_button( __( 'Save' ), 'button', 'save', true, 'disabled' ); ?>
    2626</div>
    2727
    2828<div id="minor-publishing-actions">
    2929<div id="save-action">
    3030<?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status )  { ?>
    31 <input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" tabindex="4" class="button button-highlighted" />
     31<input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" tabindex="4" class="button button-highlighted" disabled />
    3232<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
    33 <input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" tabindex="4" class="button button-highlighted" />
     33<input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" tabindex="4" class="button button-highlighted" disabled />
    3434<?php } ?>
    3535<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="draft-ajax-loading" alt="" />
    3636</div>
     
    210210        if ( $can_publish ) :
    211211                if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
    212212                <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" />
    213                 <?php submit_button( __( 'Schedule' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?>
     213                <?php submit_button( __( 'Schedule' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p', 'disabled' => 'disabled' ) ); ?>
    214214<?php   else : ?>
    215215                <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />
    216                 <?php submit_button( __( 'Publish' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?>
     216                <?php submit_button( __( 'Publish' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p', 'disabled' => 'disabled' ) ); ?>
    217217<?php   endif;
    218218        else : ?>
    219219                <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" />
    220                 <?php submit_button( __( 'Submit for Review' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?>
     220                <?php submit_button( __( 'Submit for Review' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p', 'disabled' => 'disabled' ) ); ?>
    221221<?php
    222222        endif;
    223223} else { ?>
    224224                <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" />
    225                 <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Update') ?>" />
     225                <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Update') ?>" disabled />
    226226<?php
    227227} ?>
    228228</div>