From 01f98caeeb2006492007572fc29d3c2364c65569 Mon Sep 17 00:00:00 2001
From: Kirtan Gajjar <8456197+kirtangajjar@users.noreply.github.com>
Date: Fri, 12 Jul 2024 08:36:24 +0530
Subject: [PATCH] Fix ltrim deprecation warning in 8.1
---
includes/classes/PullListTable.php | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/includes/classes/PullListTable.php b/includes/classes/PullListTable.php
index 531d6f408..784dc9cac 100644
--- a/includes/classes/PullListTable.php
+++ b/includes/classes/PullListTable.php
@@ -367,9 +367,12 @@ public function column_name( $item ) {
if ( ! empty( $new_post ) ) {
$actions = [
- 'edit' => '' . esc_html__( 'Edit', 'distributor' ) . '',
'view' => '' . esc_html__( 'View', 'distributor' ) . '',
];
+
+ if ( current_user_can( 'edit_post', $new_post_id ) ) {
+ $actions['edit'] = '' . esc_html__( 'Edit', 'distributor' ) . '';
+ }
}
}