WordPress.org

Make WordPress Core

Ticket #4206: 4206.diff

File 4206.diff, 883 bytes (added by johnbillion, 7 years ago)

Confirmation message when hitting the Publish button on a Private post (props andy)

  • wp-admin/edit-form-advanced.php

     
    172172if ('publish' != $post->post_status || 0 == $post_ID) { 
    173173?> 
    174174<?php if ( current_user_can('publish_posts') ) : ?> 
    175         <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />  
     175        <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" <?php if ('private' == $post->post_status) { ?>onclick="return confirm('<?php echo js_escape(__("This post is set to Private. Are you sure you want to publish this post for the world to see? (If not, try the Save button.)\n\n'OK' to continue, 'Cancel' to stop.")); ?>')" <?php } ?>/>  
    176176<?php endif; ?> 
    177177<?php 
    178178}