WordPress.org

Ready to get started?Download WordPress

Forums

Add an option in Pages Action drop down (5 posts)

  1. roh4iitt
    Member
    Posted 10 months ago #

    Hi Every one,

    I recently register to WordPress.org and this is my first topic. I want to add an option in the action drop down for pages and post in the WordPress admin section, so I can make the page or post publish or unpublished.
    see the screen shot: http://screencast.com/t/2U46h1jBjy

    Is there a way I can add an action function to add that option and execute it ?

  2. trishasalas
    Member
    Posted 10 months ago #

    Hi roh4iitt,

    You don't need to add anything to the menu at the top to do what you want. Tick the checkbox to the left of each page/post in the list that you want to publish or unpublish. Once you have the pages selected go to the drop down at the top and select 'Edit' and click the 'Apply Button'.

    You'll be presented with the 'Bulk Edit' screen. (see screenshot here => http://en.support.wordpress.com/posts/edit-posts-screen/#bulk-edit).

    Change the 'Status' with the appropriate drop down selector and click 'Update'. This will update the status in the database and you should be good to go.

  3. roh4iitt
    Member
    Posted 10 months ago #

    Hi trishasalas,

    Thanks for you reply. I know the way you trying to explain. But I need to do it that way, I am sure there should be a way where we can add more option in Apply drop down.

    I will look for you reply.

    Thanks

  4. Elio Rivero
    Member
    Posted 9 months ago #

    Hi, I don't know if adding an action is possible, since in WP 3.6.1 in /wp-admin/includes/class-wp-list-table.php in bulk_actions method of WP_List_Table class, there this note

    // This filter can currently only be used to remove actions.

    so apparently it's not possible and is proven by the code below:

    /**
     * Remove "Edit" option. Will not add a "Some Action" action.
     * @param $actions
     * @return mixed
     */
    function custom_tr_edit_post_bulk_actions( $actions ) {
    	// Remove Edit
    	unset( $actions['edit'] );
    	// Can't add new action
    	$actions['someaction'] = __('Some Action', 'yourlangdomain');
    	return $actions;
    }
    add_filter('bulk_actions-edit-post', 'custom_tr_edit_post_bulk_actions');

    Anyway, maybe somebody has an alternative answer but in any case, as Trisha pointed it, it's not actually necessary since you have bulk quick edit and you can set the publish status there, however, I understand that you might want to do this to make it easier for a client.
    Good luck!

  5. EPalmer12
    Member
    Posted 9 months ago #

    tag is supported in all major browsers

Reply

You must log in to post.

About this Topic

Tags