[Plugin: Facebook] [bug] Problems when publishing to a page
-
I was trying to publish a post to a facebook page. But it was not publishing the content correctly.
Problems:
The post link was ok, title is being “Auto Draft” and description is blank.Cause:
infb-social-publisher.php,fb_post_to_fb_pagefunction is sending the status to facebook. But it has some problems. It’s usingget_permalink(),get_the_excerpt(), but it’s not getting theglobal $postvariable to setup those data and it was causing the problem.Fix:
global $post; $post = get_post( $post_id ); setup_postdata( $post );We are adding the global $post object and setting the $post variable so that
get_permalink(),get_the_excerpt()functions can work without any problem.
The topic ‘[Plugin: Facebook] [bug] Problems when publishing to a page’ is closed to new replies.