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
    Apr 10 '11 at 15:26
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
    Apr 10 '11 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
    Apr 11 '11 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
    May 2 '11 at 2:48
  • @Piet Your most welcome Piet i am glad to of been some assistance to you :)
    – Xavier
    May 2 '11 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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