Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Pierre Brouyaux

Inline Editing and Heartbeat

Hello,

I observed that Inline Editing is still available even when the WordPress Heartbeat indicates that the post is being edited by another user.

I think this is a problem. My solution is to fix this with a few lines of CSS :

tr.wp-locked td.acp-ie-editable div.acp-ie-controls {
    display: none !important;
}

What do you think?

Thank you

2 years, 3 months ago
Pierre Brouyaux

The CSS solution is not complete because it depends on the timing (if user B loaded the post editing after user A loaded the post list, user A will see the Inline Editing options for a while).

That’s why I add:

<?php

add_filter( 'acp/editing/save_value', 'acp_editing_save_value', 10, 3 );

function acp_editing_save_value( $value, AC\Column $column, $id ) {

	// Checks if the post is not being edited by another user
	if( false === wp_check_post_lock( $id ) ) {
		return $value;
	}
	else {
		wp_die( 'Post locked' );
	}

}

What do you think?

Thank you

2 years, 3 months ago
Stefan van den Dungen Gronovius
Developer

Thanks for your feedback and the addressed solution for this matter. I totally agree that we should disable inline editing for locked items. Your input is very useful for creating a more integrated solution in our plugin. I’ve added it to our feature request and since I believe this is an easy issue to fix, I expect that this will be in one of the upcoming releases.

2 years, 3 months ago

You must be logged in to reply to this topic.