latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

WordPress 3.4: "get_user_field" not found

Home Forums Community Forum WordPress 3.4: "get_user_field" not found

This topic contains 2 replies, has 2 voices. Last updated by  Eduan 4 years, 5 months ago.

Topic Author Topic
Posted: Saturday Jun 16th, 2012 at 5:09 am #16657
Dave Power
Username: davewp196

I’ve just upgraded to WordPress 3.4 and now find that s2member API functions are no longer defined.

function My_Named_Interests(){
/*
 
    // Check that the user is logged in and a full member
    if (is_user_not_logged_in()){
        return "You are not authorised to access Member's Area for managing Named Interests";
    }
    
    if (get_user_field("s2member_access_level")<1){
        return "Managing Named Interests is a feature only available to paid-up members";
    }

	....  Rest of function cut

}

What files to I need now need to explicit call to ensure the s2member functions are defined?

The PHP function My_Named_Interests is being called via my “shortcode” function.

The code use to work under wordpress 3.3

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Monday Jul 23rd, 2012 at 11:17 am #19994
Dave Power
Username: davewp196

Resolved – problem was that S2member was not activated.

Posted: Tuesday Jul 24th, 2012 at 9:21 am #20076
Eduan
Username: Eduan
Moderator

Glad you solved your problem Dave. :)

Although, I was gonna tell you the way to do it, just in case:

add_action('wp_loaded', 'My_Named_Interests', 1)

I believe that should make sure all plugins are loaded before the code executes (in case it’s an mu-plugin).

Hope this helps. :)

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

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.