Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

WP fb page tab - Pass app_data back to tab after auth redirect WordPress



I need some help please with my facebook tab. Which is wordpress driven.

In my header.php I have created my app instance, see below...

<em>if you see any problems with this, I would be grateful for any tips</em>

[[LINK href=""]][[/LINK]]

So my problem is, if the user is not already authenticated, I lose my app_data variable when the auth redirect takes place.

Can anyone help me pass the app_data through the authentication redirect.

I managed to come up with this below, which is very dirty.

if ( $obj['app_data'] ) {
$appdataVar = '&app_data='.$obj['app_data'];

// Authentication
$auth_url = "" . $app_id . "&redirect_uri=" . urlencode($canvas_page.$appdataVar);

It worked, but it leaves undefined variables if no app_data was there in the first place?

Best answer will get the prize. Thanks.


Answers (1)


Arnav Joy answers:

i think you should try this


if ( $obj['app_data'] ) {

$appdataVar = '&app_data='.$obj['app_data'];


else if($_GET['appdataVar'])
$appdataVar = $_GET['appdataVar'];

// Authentication

$auth_url = "" . $app_id . "&redirect_uri=" . urlencode($canvas_page).'&appdataVar='.$appdataVar;

Josh Cranwell comments:


I still 3 got undefined variable notices.

Josh Cranwell comments:

I mean...

I still get 3 undefined variable notices in my debug.

Sent you link on skype.