0

We're using Facebook Comments for the comment functionality on our WordPress blog. I thought it'd be nice to embed the page with Facebook Moderation tools on the WP Dashboard. That way, we can immediately see who commented on what when we log in.

I've looked for the functionality to embed an html page in a dashboard widget but I haven't managed to find something. Does anybody know if this is possible?

1
  • Pretty sure you can just add an iframe to a dashboard widget, or are you talking about the Facebook api?
    – Wyck
    Commented Apr 10, 2011 at 15:26

1 Answer 1

0
function facebook_setup_function() {
    add_meta_box( 'facebook_widget', 'Facebook Moderation Tools', 'facebook_widget_function', 'dashboard', 'normal', 'low' );
}
function facebook_widget_function() {
    include ('facebook.php');
}

add_action( 'wp_dashboard_setup', 'facebook_setup_function' );

add the above to your functions file and replace the include url with the php file you wish to include into your dashboard.

Setting it up ;

Use the facebook.php and add an iframe to it, or ajax call to load the facebook tools, then simply just echo that file into your dashboard page :)

4
  • Thanks you! This works great to embed html pages in the dashboard. Only problem is that it seems that Facebook won't allow to access their moderation tools via an iframe. :S Nothing to be done about that for now. Lets hope they'll allow it in the future.
    – Squrler
    Commented Apr 10, 2011 at 23:29
  • that is bizzare, but i guess they need account authorization and so on, so maybe facebook doesn't like the cross domain integration (good to know) thanks matey and i'm glad it worked for you
    – Xavier
    Commented Apr 11, 2011 at 17:13
  • thanks Xavier! Been looking all over to add a widget properly to my dashboard. Your function has been an excellent start for me to make my own widget, cheers!
    – user2015
    Commented May 2, 2011 at 2:48
  • @Piet Your most welcome Piet i am glad to of been some assistance to you :)
    – Xavier
    Commented May 2, 2011 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.