• I have created an admin section where the user can add their Facebook app id & app secret, and I am tryign to pull it into a page that is in the plugins section of WordPress.

    I have been playing around with the code for a couple of days, and I can’t figure out how to bring in those two sections into my page.

    This is part of the page with the code working, having the two sections hard-coded:

    $app_id = "195034203865645";
    $app_secret = "fc7c40fc1fd5f87f6ba7df1ab4105645";
    
    $facebook = new Facebook(array(
            'appId' => $app_id,
            'secret' => $app_secret,
            'cookie' => true
    ));

    However I just want to get the info from the db into the file.

    The two sections have the following names:

    fbappid
    fbappsecret

    I have tried various things, among them:

    $app_id = get_option('fbappid');
    $app_secret = get_option('fbappsecret');
    
    $facebook = new Facebook(array(
            'appId' => $app_id,
            'secret' => $app_secret,
            'cookie' => true
    ));

    I also tried to just name the two sections in the db:

    appId
    secret

The topic ‘pulling info from the database into a php file in the plugins folder’ is closed to new replies.