百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
W

wordpress

> 编程语言
开源

为您的 WordPress 站点主题和发布流添加由 Facebook 提供的社交功能。

512 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

为您的 WordPress 站点主题和发布流添加由 Facebook 提供的社交功能。

=== Facebook === Contributors: Facebook, automattic, niallkennedy, mattwkelly, rgharpuray, ngfeldman, jamesgpearce, ravi.grover, danielbachhuber, gigawats, eosgood, Otto42, colmdoyle, zazinteractive Tags: Facebook, comments, social, friends, like, like button, social plugins, facebook platform, page, posts, sidebar, plugin, open graph, publish Facebook Requires at least: 3.3 Tested up to: 3.9 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html Stable tag: 1.5.5

Add Facebook social plugins and the ability to publish new posts to a Facebook Timeline or Facebook Page. Official Facebook plugin.

== Description ==

The Facebook plugin for WordPress adds Facebook social plugins to your WordPress site. Associate your WordPress site with a free Facebook application identifier to enable advanced features such as automatically sharing new posts to an author's Facebook Timeline or your site's Facebook Page. This plugin is developed by Facebook with extra support for popular plugins and themes, custom post types, and custom post statuses.

= Features =

  • Open Graph protocol markup optimizes your content for social sharing and rich story previews on Facebook, Twitter, Google+, Mixi, and more. Display large images, link to author pages, and improve story distribution through social news feeds.
  • Facebook Insights support for Facebook accounts associated with a Facebook application. Track rich audience data powered by Facebook profiles (age, location, language) and see how your content is shared on Facebook.
  • Add Like, send, and follow buttons to every post to help your site's readers share content with friends or stay connected to future content shared by your site and its authors on Facebook.
  • Embed Facebook Posts by pasting a URL into your post composer, creating a shortcode, or calling a function from your theme.
  • Enable the Facebook Comments Box social plugin to encourage new comments from logged-in Facebook users and his or her Facebook friends. Comments associated with a post are sorted according to social signals including friend networks, most liked, or the most active discussion threads. Advanced features include moderation, blacklisted words, automatic grammar correction, and login support for AOL, Microsoft, and Yahoo! accounts.
  • Like Box displays recent activity from your Facebook Page and encourages new Like actions.
  • Recommendations Bar helps visitors discover additional content on your site by recommending posts and encouraging Like shares.
  • Recommendations Box suggests related posts in a configurable widget.
  • Configure your Facebook application for Open Graph action news publishing support for improved Facebook distribution of author Timeline stories and news-specific highlights.
  • Mention Facebook friends and Facebook pages in a custom message posted to your Timeline with your post.
  • Customize and extend the plugin through custom actions and filters.

= Shortcodes =

Add a Like Button, Send Button, Follow Button, or Embedded Posts using a shortcode inside your post or evaluated from within your theme. You may override site-level options with shortcode attributes defined on the social plugin's page.

  • [facebook_like_button]
  • [facebook_send_button]
  • [facebook_follow_button href="{$facebook_profile_url}"]
  • [facebook_embedded_post href="{$facebook_post_url}"]

= Contributing code =

The development source code for this plugin is available on Facebook's GitHub account. Pull Requests and code discussion welcome.

== Installation ==

  1. Install Facebook for WordPress either via the WordPress.org plugin directory, or by uploading the files to your server (in the /wp-content/plugins/ directory).
  2. You should be able to start using social plugins (Like Button, Send Button, etc.) right away.
  3. After activating the plugin, you will be asked to set up your Facebook application or enter existing credentials copied from the Facebook Developers site to unlock additional features such as publishing posts to an author Timeline or site Page.
  4. Optionally set up a Facebook Open Graph action with user message, mentions tagging, and explicitly shared action capabilities. See the Facebook for WordPress help page for more information.
  5. That's it. You're ready to go!

== Screenshots ==

  1. Facebook settings screen
  2. Mention Facebook friends and pages in a custom message posted to your Timeline
  3. Create a custom message published to your Facebook Timeline or Page alongside a summary of your new post
  4. The resulting post published on the author's Timeline
  5. Encourage social activity by adding Facebook social plugins before and after your posts
  6. Facebook social plugins are available as WordPress widgets
  7. Customized Like Box and Recommendations Box social plugins displayed as WordPress widgets
  8. Facebook Insights showing demographics for your domain

== Custom actions & filters ==

= Actions =

  • facebook_settings_before_header_$hook_suffix - add content to a settings page before the main page header section
  • facebook_settings_after_header_$hook_suffix - add content to a settings page after the main page header section
  • facebook_settings_footer_$hook_suffix - add content to a settings page below the wrapper div
  • facebook_comment_form_before - comment form pluggable action replacing the WordPress comment_form() equivalent action comment_form_before
  • facebook_comment_form_after - comment form pluggable action replacing the WordPress comment_form() equivalent action comment_form_after

= Filters =

  • facebook_features - limit the plugin features available on your site
  • facebook_jssdk_init_options - customize arguments sent to the FB.init function of the Facebook JavaScript SDK
  • facebook_jssdk_init_extras - add extra JavaScript to the fbAsyncInit JavaScript function called after the Facebook JavaScript SDK is loaded
  • facebook_content_filter_priority - choose the priority of Facebook social plugin filters attached to the_content filter. Affects where Facebook content is output on your page relative to other plugins attached to the_content
  • fb_locale - directly define your site locale based on the list of Facebook locale mappings
  • facebook_excerpt_length - choose a custom length, in words, of a post excerpt generated for use in the Open Graph protocol description. default: 55
  • facebook_excerpt_more - string appearing at the end of a truncated excerpt string. default: "…"
  • fb_rel_canonical - customize the canonical URL used by Facebook for a post. Affects Open Graph protocol URL definitions, URL references sent in Open Graph actions, and more. default: result of get_permalink()
  • facebook_comment_schema_org - override output of search engine friendly comments content using Schema.org microdata markup
  • facebook_comments_number_more - override the default "% Comments" text used to generate a client-side comments number. similar to WordPress' comments_number more parameter
  • facebook_og_type - set an Open Graph object type for a specific post early in the Open Graph process. Affects Open Graph protocol properties built with the page and later passed to fb_meta_tags. Affects Open Graph action publishing: only an article may be published to a Facebook Timeline using the news.publishes action
  • fb_meta_tags - Customize Open Graph protocol markup before it is output to the page
  • facebook_ogp_prefixed - true to always use prefixed properties (og:title) or false to use full IRI properties (http://ogp.me/ns#title)
  • facebook_rdfa_mappings - array of RDFa references with desired prefix. Used to remap Open Graph protocol properties from a full IRI to a prefix
  • facebook_wp_comments_title - set a custom title for the Facebook comments template
  • facebook_wp_list_comments - customize the arguments sent to wp_list_comments for display of WordPress comments inside the Facebook comments template
  • facebook_comments_wrapper - override the display of Facebook comments fetched from Facebook servers for display on the page. default: noscript. set to an empty string to prevent fetch and inclusion
  • fb_get_user_meta - fetch a user meta value by attaching to this filter, bypassing the WordPress user meta API
  • fb_update_user_meta - update a user meta value by attaching to this filter, bypassing the WordPress user meta API
  • fb_delete_user_meta - delete a user meta value by attaching to this filter, bypassing the WordPress user meta API

== Frequently Asked Questions ==

= How do I sign up for a Facebook application ID for my website? =

You may create a new Facebook application or edit your existing Facebook application through the Facebook Developers application interface. You may first need to signup for a Facebook Developer account.

= I am unable to save my Facebook application ID and secret =

Some webmasters have reported issues saving Facebook application ID and secret information in the Facebook settings page. These inputted values are verified with Facebook servers before saving, requiring an HTTPS request to Facebook servers. Some sites experiencing issues have identified their server's bundled SSL certificates as an issue; returning false for the https_ssl_verify filter used by the WordPress HTTP class may help fix server-to-server communication issues if updating your cURL or other libraries is not an option.

= How do I change the image that appears for my posts shared on Facebook? =

The plugin generates Open Graph protocol markup for your site's webpages including a explicitly-specified images generated from the post thumbnail, attached images, or gallery shortcode. Your plugin or theme may define additional images through the fb_meta_tags filter. If an image or images already exists your additional image may be used as an alternate for stories shared through a pasted link. Unattended story summaries such as a Like Button click use the first defined image. [support sticky](http://wordpress.org/support/topic/customize-open-graph-protocol-for-your-site-o

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHP

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言