Distributor: Row action for pulling single post

Created on 3 Oct 2019  路  2Comments  路  Source: 10up/distributor

Is your enhancement related to a problem? Please describe.

It would be nice to have a way to pull a single post without using bulk actions on the pull posts list table.

Describe the solution you'd like

This could be fixed by adding another link "Pull" to the current row actions "View" and "Skip", see image:
Screenshot 2019-10-03 at 14 04 50

It seems in the code that this is already half done, since the function process_actions contains a switch statement for the 'syndicate' as well as the 'bulk-syndicate' action. I tested this by just adding the following code to line 325 in the PullListTable class, and that seems to work though I haven't tested it thoroughly yet. Happy to make a PR if y'all think it's a good idea.

'pull' => sprintf( '<a href="%s">%s</a>', esc_url( wp_nonce_url( admin_url( 'admin.php?page=pull&action=syndicate&_wp_http_referer=' . rawurlencode( $_SERVER['REQUEST_URI'] ) . '&post=' . $item->ID . '&connection_type=' . $connection_type . '&connection_id=' . $connection_id . '&pull_post_type=' . $item->post_type ), 'bulk-distributor_page_pull' ) ), esc_html__( 'Pull', 'distributor' ) ),

enhancement help wanted

Most helpful comment

thanks @jeffpaul. I've added a PR for this. #508

All 2 comments

@lakrisgubben interesting idea, thanks for the feedback! I'm marking this as help wanted and for a future release, so if someone's able to work up a PR on this I'd gladly pull it into review for any upcoming planned releases.

thanks @jeffpaul. I've added a PR for this. #508

Was this page helpful?
0 / 5 - 0 ratings