WordPress.org

Ready to get started?Download WordPress

Forums

Publish Confirmation (3 posts)

  1. chiragpinjar
    Member
    Posted 5 years ago #

    Hi,

    As soon as the publish button is clicked, the post gets published. As Save & Publish are one beside the other, sometimes inadvertently the publish button may be clicked (I did this once for a premier website & all the hell broke loose) Is there a way to have one more step before publishing like "Are you sure, you want to publish?" (Certainly this will give breather space)

    Any help will be greatly appreciated

    Regards,
    Chirag

  2. Lingonberg
    Member
    Posted 5 years ago #

    Hi there,
    you could use a simple plugin like this one:

    <?php
    /*
    Plugin Name: Confirm publish
    */
    $c_message = 'Are you sure you want to publish?'; // your confirm message
    function confirm_publish(){
    	global $c_message;
    	echo '
    <script type="text/javascript"><!--
    var publish = document.getElementById("publish");
    if (publish !== null) publish.onclick = function(){
    	return confirm("'.$c_message.'");
    };
    // --></script>';
    }
    
    add_action('admin_footer', 'confirm_publish');
    ?>

    Save the code in a file named confirm-publish.php and put the file in wp-content/plugins. Activate it through the admin panel and you're done :).

    /Lingonberg

  3. iM1
    Member
    Posted 5 years ago #

    Is there a way when pressing publish I can make it goto a page where it display what the author just posted? so they can review it, and have two buttons with "Go back" and "Yes, Publish it"?

    I want to add a script to the publish process which reads if there is any external links, it will then visit those links to see if they work. If they dont its gonna force the user to go back to the previous page, if its ok then it will go ahead and publish it and return to the edit page like it usually does.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags