WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: LinkedIn SC] Not setting DB prefix correctly in User Profile page (1 post)

  1. ScottJWalter
    Member
    Posted 2 years ago #

    Ran across a quick patch for LinkedIn SC, as some hosting providers allow you to create database prefixes other than the default "wp_". The problem occurs in the linkedin-sc.php file of the plugin, at line 282 (inside the linkedin_sc_user_interface function):

    $capabilities = $user->wp_capabilities;

    This only works if you haven't changed the default prefix. While this doesn't seem to affect the plugin on public pages, on your user profile page, you'll see a PHP error about an error with the foreach statement 2 lines down from this.

    To fix the problem, add the following inside the same function:

    1. Change line 282 of the file from what you see above to:

    $capabilities = $user->{$wpdb->prefix . 'capabilities'};

    2. Add a global reference to $wpdb at the top of the function:

    function linkedin_sc_user_profile($user) {
    global $wpdb;

    Enjoy!

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by ScottJWalter
  • This topic is not a support question
  • WordPress version: 3.2.1

Tags