Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

user-roles

A different role for each site in a multisite

It all depends on what exactly you are doing. Method one One site will be the first to register users on. If you are allowing users to register themselves without any plugins this will need to the the main site (e.g. blog 1) for the Network (Multisite) installation. Then you can add the user role … Read more

Categories multisite Tags capabilities, multisite, user-registration, user-roles, users

Show user details only

This question is not appropriate for this website but you could maybe look for a WordPress plugin that could help you achieve that.

Categories users Tags user-roles, users

Why user profile update creates Additional Capabilities

Finally found an issue. Something in WP saved role but could not compared correctly and couldn’t find correct capabilities. This code worked as it should (note the case): $role = get_role(‘new_role’); if(!$role){ add_role( ‘new_role’, ‘New Role’, array( ‘new_cap’ => true ) ); }

Categories plugins Tags capabilities, plugins, user-roles

Why does user_can return false for a capability during plugin deactivation?

This was a very simple mistake in my deactivation script. The function to remove my custom role was being called before the function to remove the user. This is the part that led to confusion: When a role is removed, it becomes unavailable, but user’s assigned to that role will still retain the role in … Read more

Categories user-roles Tags capabilities, user-meta, user-roles

Set User Role based on age result from Facebook Log-In – WordPress

This assumes that what you said about only needing to check for the minimum value is true. These conditional statements work for this array. Facebook’s Min Age Array will be either 13, 18 or 21. $age_range = array( 13, 18, 21); // I don’t know what actual data you have here. if( min( $age_range ) … Read more

Categories user-roles Tags signup, user-roles

How to retrieve user data based on role using SQL?

Add following in WHERE condition of your SQL query. WHERE t1.meta_key = “<?php echo $wpdb->prefix; ?>capabilities” AND ( t1.meta_value LIKE ‘%ROLE_YOU_WANT_TO_FILTER%’) Let me know if it works for you or not.

Categories Database Tags database, phpmyadmin, sql, user-roles

Custom User Role: Can Edit Own Page, Cannot Create New

I’m not sure you are using the most correct way to restrict so maybe someone else can chime in but this if statement is grabbing the first role in the array which may be dealer or maybe another role if ( ‘dealer’ === $role_name ) { Try instead if ($current_user->has_cap (‘dealer’)) { the has_cap function … Read more

Categories users Tags members, user-access, user-roles, users

How can I remove “Add new” button on custom post type

How can I remove “Add new” button on custom post type

Categories custom-post-types Tags capabilities, custom-post-types, user-access, user-roles

Restrict content piece by role – Protection message in content?

Shortcode API supports arbitrary attributes, so you could easily implement it with one like: [RESTRICTROLE message=”Really nothing here”]some word for subscriber[/RESTRICTROLE]

Categories user-roles Tags conditional-content, user-roles

Groups roles & capabilities

Groups roles & capabilities

Categories users Tags capabilities, user-roles, users
Older posts
Newer posts
← Previous Page1 … Page27 Page28 Page29 … Page144 Next →
+ More

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
Next Page »
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress