Support » Plugins » [Plugin: LinkedIn SC] Not setting DB prefix correctly in User Profile page

  • 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!

  • The topic ‘[Plugin: LinkedIn SC] Not setting DB prefix correctly in User Profile page’ is closed to new replies.