I have a plugin with a line calling wp_capabilities. This works with the default prefix. If someone changes the prefix to something else (bluehost scripts do this), how do I fix this code? Can you also explain why?
I can hard code it for the individual site but how do I make it 'universal'?
Change:
$current_user->data->wp_capabilities[$role_name];
To:
$current_user->data->wp_xyz_capabilities[$role_name];
I understand (and use) {$wpdb->prefix} in an SQL statement works fine.
I've looked at $table_prefix as well as $wpdb->prefix but the combinations I've tried in PHPStorm state expecting semicolons or red lines appear stating there is a problem.
Thank you for your time and explanation.