From 929a4e7c016718a76c1c8fd0d350d4c1d7e87e64 Mon Sep 17 00:00:00 2001 From: MD Shuvo <66669067+shuvo7670@users.noreply.github.com> Date: Wed, 21 Feb 2024 11:36:29 +0600 Subject: [PATCH] social profile accessing issue from subscriber --- includes/Social/InstantShare.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/Social/InstantShare.php b/includes/Social/InstantShare.php index dddc89f4..4f051d13 100644 --- a/includes/Social/InstantShare.php +++ b/includes/Social/InstantShare.php @@ -268,6 +268,10 @@ public function instant_share_metabox_data_save($post_id, $post) */ public function instant_share_fetch_profile() { + if( !current_user_can('edit_post') ) { + wp_send_json_error( [ 'message' => __('You are unauthorized to access social profiles.', 'wp-scheduled-posts') ], 401 ); + wp_die(); + } $allProfile = array(); // get data from db $facebook = \WPSP\Helper::get_social_profile(WPSCP_FACEBOOK_OPTION_NAME);