Reply To: BuddyPress Permissions
@lepittenger Right, I see now. Looking at wp_insert_post(), all I can see that’s available to hook into is wp_insert_post_empty_content
Perhaps try something like this:
function lepittenger_custom_edit_page( $maybe_empty, $postarr ) {
// Your page ID here.
$page_id = 962;
// Your user ID here.
$user_id = 3;
// Get the post's info.
$post = get_post( $postarr['ID'] );
if ( ( $post->ID == $page_id ) && ( get_current_user_id() != $user_id ) )
return true;
}
add_action( 'wp_insert_post_empty_content', 'lepittenger_custom_edit_page', 10, 2 );
This is a bit cheeky because we’re tricking WP into thinking the post is empty which results in it aborting the update. But, I can’t think of a better way
Please note I haven’t tested.