• Resolved sessponthu

    (@sessponthu)


    Hi,
    I am currently trying to implement a function in the plugin I’m developing to list all possible user roles on the page.

    I have found this regarding the topic, however when I try to do

    function debug_function() {	
    	global $ultimatemember;
    	$roles = $ultimatemember->query->get_roles();
    	error_log(print_r($roles, TRUE));
    }

    I get the error:
    Uncaught Error: Call to a member function get_roles() on null in wp-content/themes/hello-elementor/functions.php:202

    Can you please help me with this? Thanks in advance

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Listing all possible user roles’ is closed to new replies.