likes.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. <?php
  2. /**
  3. * Module Name: Likes
  4. * Module Description: Give visitors an easy way to show they appreciate your content.
  5. * First Introduced: 2.2
  6. * Sort Order: 23
  7. * Requires Connection: Yes
  8. * Auto Activate: No
  9. * Module Tags: Social
  10. * Feature: Engagement
  11. * Additional Search Queries: like, likes, wordpress.com
  12. */
  13. Jetpack::dns_prefetch( array(
  14. '//widgets.wp.com',
  15. '//s0.wp.com',
  16. '//0.gravatar.com',
  17. '//1.gravatar.com',
  18. '//2.gravatar.com',
  19. ) );
  20. include_once dirname( __FILE__ ) . '/likes/jetpack-likes-master-iframe.php';
  21. include_once dirname( __FILE__ ) . '/likes/jetpack-likes-settings.php';
  22. class Jetpack_Likes {
  23. public static function init() {
  24. static $instance = NULL;
  25. if ( ! $instance ) {
  26. $instance = new Jetpack_Likes;
  27. }
  28. return $instance;
  29. }
  30. function __construct() {
  31. $this->in_jetpack = ( defined( 'IS_WPCOM' ) && IS_WPCOM ) ? false : true;
  32. $this->settings = new Jetpack_Likes_Settings();
  33. add_action( 'init', array( &$this, 'action_init' ) );
  34. add_action( 'admin_init', array( $this, 'admin_init' ) );
  35. if ( $this->in_jetpack ) {
  36. add_action( 'jetpack_activate_module_likes', array( $this, 'set_social_notifications_like' ) );
  37. add_action( 'jetpack_deactivate_module_likes', array( $this, 'delete_social_notifications_like' ) );
  38. Jetpack::enable_module_configurable( __FILE__ );
  39. Jetpack::module_configuration_load( __FILE__, array( $this, 'configuration_redirect' ) );
  40. add_action( 'admin_print_scripts-settings_page_sharing', array( &$this, 'load_jp_css' ) );
  41. add_filter( 'sharing_show_buttons_on_row_start', array( $this, 'configuration_target_area' ) );
  42. $active = Jetpack::get_active_modules();
  43. if ( ! in_array( 'sharedaddy', $active ) && ! in_array( 'publicize', $active ) ) {
  44. // we don't have a sharing page yet
  45. add_action( 'admin_menu', array( $this->settings, 'sharing_menu' ) );
  46. }
  47. if ( in_array( 'publicize', $active ) && ! in_array( 'sharedaddy', $active ) ) {
  48. // we have a sharing page but not the global options area
  49. add_action( 'pre_admin_screen_sharing', array( $this->settings, 'sharing_block' ), 20 );
  50. add_action( 'pre_admin_screen_sharing', array( $this->settings, 'updated_message' ), -10 );
  51. }
  52. if( ! in_array( 'sharedaddy', $active ) ) {
  53. add_action( 'admin_init', array( $this->settings, 'process_update_requests_if_sharedaddy_not_loaded' ) );
  54. add_action( 'sharing_global_options', array( $this->settings, 'admin_settings_showbuttonon_init' ), 19 );
  55. add_action( 'sharing_admin_update', array( $this->settings, 'admin_settings_showbuttonon_callback' ), 19 );
  56. add_action( 'admin_init', array( $this->settings, 'add_meta_box' ) );
  57. } else {
  58. add_filter( 'sharing_meta_box_title', array( $this->settings, 'add_likes_to_sharing_meta_box_title' ) );
  59. add_action( 'start_sharing_meta_box_content', array( $this->settings, 'meta_box_content' ) );
  60. }
  61. } else { // wpcom
  62. add_action( 'wpmu_new_blog', array( $this, 'enable_comment_likes' ), 10, 1 );
  63. add_action( 'admin_init', array( $this->settings, 'add_meta_box' ) );
  64. add_action( 'end_likes_meta_box_content', array( $this->settings, 'sharing_meta_box_content' ) );
  65. add_filter( 'likes_meta_box_title', array( $this->settings, 'add_likes_to_sharing_meta_box_title' ) );
  66. }
  67. add_action( 'admin_init', array( $this, 'admin_discussion_likes_settings_init' ) ); // Likes notifications
  68. add_action( 'admin_bar_menu', array( $this, 'admin_bar_likes' ), 60 );
  69. add_action( 'wp_enqueue_scripts', array( $this, 'load_styles_register_scripts' ) );
  70. add_action( 'save_post', array( $this->settings, 'meta_box_save' ) );
  71. add_action( 'edit_attachment', array( $this->settings, 'meta_box_save' ) );
  72. add_action( 'sharing_global_options', array( $this->settings, 'admin_settings_init' ), 20 );
  73. add_action( 'sharing_admin_update', array( $this->settings, 'admin_settings_callback' ), 20 );
  74. }
  75. /**
  76. * Set the social_notifications_like option to `on` when the Likes module is activated.
  77. *
  78. * @since 3.7.0
  79. *
  80. * @return null
  81. */
  82. function set_social_notifications_like() {
  83. update_option( 'social_notifications_like', 'on' );
  84. }
  85. /**
  86. * Delete the social_notifications_like option that was set to `on` on module activation.
  87. *
  88. * @since 3.7.0
  89. *
  90. * @return null
  91. */
  92. function delete_social_notifications_like() {
  93. delete_option( 'social_notifications_like' );
  94. }
  95. /**
  96. * Redirects to the likes section of the sharing page.
  97. */
  98. function configuration_redirect() {
  99. wp_safe_redirect( admin_url( 'options-general.php?page=sharing#likes' ) );
  100. die();
  101. }
  102. /**
  103. * Loads Jetpack's CSS on the sharing page so we can use .jetpack-targetable
  104. */
  105. function load_jp_css() {
  106. // Do we really need `admin_styles`? With the new admin UI, it's breaking some bits.
  107. // Jetpack::init()->admin_styles();
  108. }
  109. /**
  110. * Load scripts and styles for front end.
  111. * @return null
  112. */
  113. function load_styles_register_scripts() {
  114. if ( $this->in_jetpack ) {
  115. wp_enqueue_style( 'jetpack_likes', plugins_url( 'likes/style.css', __FILE__ ), array(), JETPACK__VERSION );
  116. $this->register_scripts();
  117. }
  118. }
  119. /**
  120. * Stub for is_post_likeable, since some wpcom functions call this directly on the class
  121. * Are likes enabled for this post?
  122. *
  123. * @param int $post_id
  124. * @return bool
  125. */
  126. static function is_post_likeable( $post_id = 0 ) {
  127. _deprecated_function( __METHOD__, 'jetpack-5.4', 'Jetpack_Likes_Settings()->is_post_likeable' );
  128. $settings = new Jetpack_Likes_Settings();
  129. return $settings->is_post_likeable();
  130. }
  131. /**
  132. * Stub for is_likes_visible, since some themes were calling it directly from this class
  133. *
  134. * @deprecated 5.4
  135. * @return bool
  136. */
  137. function is_likes_visible() {
  138. _deprecated_function( __METHOD__, 'jetpack-5.4', 'Jetpack_Likes_Settings()->is_likes_visible' );
  139. $settings = new Jetpack_Likes_Settings();
  140. return $settings->is_likes_visible();
  141. }
  142. /**
  143. * Adds in the jetpack-targetable class so when we visit sharing#likes our like settings get highlighted by a yellow box
  144. * @param string $html row heading for the sharedaddy "which page" setting
  145. * @return string html with the jetpack-targetable class and likes id. tbody gets closed after the like settings
  146. */
  147. function configuration_target_area( $html = '' ) {
  148. $html = "<tbody id='likes' class='jetpack-targetable'>" . $html;
  149. return $html;
  150. }
  151. /**
  152. * Options to be added to the discussion page (see also admin_settings_init, etc below for Sharing settings page)
  153. */
  154. function admin_discussion_likes_settings_init() {
  155. // Add a temporary section, until we can move the setting out of there and with the rest of the email notification settings
  156. add_settings_section( 'likes-notifications', __( 'Likes Notifications', 'jetpack' ), array( $this, 'admin_discussion_likes_settings_section' ), 'discussion' );
  157. add_settings_field( 'social-notifications', __( 'Email me whenever', 'jetpack' ), array( $this, 'admin_discussion_likes_settings_field' ), 'discussion', 'likes-notifications' );
  158. // Register the setting
  159. register_setting( 'discussion', 'social_notifications_like', array( $this, 'admin_discussion_likes_settings_validate' ) );
  160. }
  161. function admin_discussion_likes_settings_section() {
  162. // Atypical usage here. We emit jquery to move likes notification checkbox to be with the rest of the email notification settings
  163. ?>
  164. <script type="text/javascript">
  165. jQuery( function( $ ) {
  166. var table = $( '#social_notifications_like' ).parents( 'table:first' ),
  167. header = table.prevAll( 'h2:first' ),
  168. newParent = $( '#moderation_notify' ).parent( 'label' ).parent();
  169. if ( !table.length || !header.length || !newParent.length ) {
  170. return;
  171. }
  172. newParent.append( '<br/>' ).append( table.end().parent( 'label' ).siblings().andSelf() );
  173. header.remove();
  174. table.remove();
  175. } );
  176. </script>
  177. <?php
  178. }
  179. function admin_likes_get_option( $option ) {
  180. if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
  181. $option_setting = get_blog_option( get_current_blog_id(), $option, 'on' );
  182. } else {
  183. $option_setting = get_option( $option, 'on' );
  184. }
  185. return intval( 'on' == $option_setting );
  186. }
  187. function admin_discussion_likes_settings_field() {
  188. $like = $this->admin_likes_get_option( 'social_notifications_like' );
  189. ?>
  190. <label><input type="checkbox" id="social_notifications_like" name="social_notifications_like" value="1" <?php checked( $like ); ?> /> <?php esc_html_e( 'Someone likes one of my posts', 'jetpack' ); ?></label>
  191. <?php
  192. }
  193. function admin_discussion_likes_settings_validate( $input ) {
  194. // If it's not set (was unchecked during form submission) or was set to off (during option update), return 'off'.
  195. if ( !$input || 'off' == $input )
  196. return 'off';
  197. // Otherwise, return 'on'.
  198. return 'on';
  199. }
  200. function admin_init() {
  201. add_filter( 'manage_posts_columns', array( $this, 'add_like_count_column' ) );
  202. add_filter( 'manage_pages_columns', array( $this, 'add_like_count_column' ) );
  203. add_action( 'manage_posts_custom_column', array( $this, 'likes_edit_column' ), 10, 2 );
  204. add_action( 'manage_pages_custom_column', array( $this, 'likes_edit_column' ), 10, 2 );
  205. add_action( 'admin_print_styles-edit.php', array( $this, 'load_admin_css' ) );
  206. add_action( "admin_print_scripts-edit.php", array( $this, 'enqueue_admin_scripts' ) );
  207. }
  208. function action_init() {
  209. if ( is_admin() ) {
  210. return;
  211. }
  212. if ( ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) ||
  213. ( defined( 'APP_REQUEST' ) && APP_REQUEST ) ||
  214. ( defined( 'REST_API_REQUEST' ) && REST_API_REQUEST ) ||
  215. ( defined( 'COOKIE_AUTH_REQUEST' ) && COOKIE_AUTH_REQUEST ) ||
  216. ( defined( 'JABBER_SERVER' ) && JABBER_SERVER ) ) {
  217. return;
  218. }
  219. if ( Jetpack_AMP_Support::is_amp_request() ) {
  220. return;
  221. }
  222. if ( $this->in_jetpack ) {
  223. add_filter( 'the_content', array( &$this, 'post_likes' ), 30, 1 );
  224. add_filter( 'the_excerpt', array( &$this, 'post_likes' ), 30, 1 );
  225. } else {
  226. add_filter( 'post_flair', array( &$this, 'post_likes' ), 30, 1 );
  227. add_filter( 'post_flair_block_css', array( $this, 'post_flair_service_enabled_like' ) );
  228. wp_enqueue_script( 'postmessage', '/wp-content/js/postmessage.js', array( 'jquery' ), JETPACK__VERSION, false );
  229. wp_enqueue_script( 'jetpack_resize', '/wp-content/js/jquery/jquery.jetpack-resize.js', array( 'jquery' ), JETPACK__VERSION, false );
  230. wp_enqueue_script( 'jetpack_likes_queuehandler', plugins_url( 'queuehandler.js' , __FILE__ ), array( 'jquery', 'postmessage', 'jetpack_resize' ), JETPACK__VERSION, true );
  231. wp_enqueue_style( 'jetpack_likes', plugins_url( 'jetpack-likes.css', __FILE__ ), array(), JETPACK__VERSION );
  232. }
  233. }
  234. /**
  235. * Register scripts
  236. */
  237. function register_scripts() {
  238. wp_register_script(
  239. 'postmessage',
  240. Jetpack::get_file_url_for_environment( '_inc/build/postmessage.min.js', '_inc/postmessage.js' ),
  241. array( 'jquery' ),
  242. JETPACK__VERSION,
  243. false
  244. );
  245. wp_register_script(
  246. 'jetpack_resize',
  247. Jetpack::get_file_url_for_environment(
  248. '_inc/build/jquery.jetpack-resize.min.js',
  249. '_inc/jquery.jetpack-resize.js'
  250. ),
  251. array( 'jquery' ),
  252. JETPACK__VERSION,
  253. false
  254. );
  255. wp_register_script(
  256. 'jetpack_likes_queuehandler',
  257. Jetpack::get_file_url_for_environment(
  258. '_inc/build/likes/queuehandler.min.js',
  259. 'modules/likes/queuehandler.js'
  260. ),
  261. array( 'jquery', 'postmessage', 'jetpack_resize' ),
  262. JETPACK__VERSION,
  263. true
  264. );
  265. }
  266. /**
  267. * Load the CSS needed for the wp-admin area.
  268. */
  269. function load_admin_css() {
  270. ?>
  271. <style type="text/css">
  272. .vers img { display: none; }
  273. .metabox-prefs .vers img { display: inline; }
  274. .fixed .column-likes { width: 5.5em; padding: 8px 0; text-align: left; }
  275. .fixed .column-stats { width: 5em; }
  276. .fixed .column-likes .post-com-count {
  277. -webkit-box-sizing: border-box;
  278. -moz-box-sizing: border-box;
  279. box-sizing: border-box;
  280. display: inline-block;
  281. padding: 0 8px;
  282. height: 2em;
  283. margin-top: 5px;
  284. -webkit-border-radius: 5px;
  285. border-radius: 5px;
  286. background-color: #72777C;
  287. color: #FFF;
  288. font-size: 11px;
  289. line-height: 21px;
  290. }
  291. .fixed .column-likes .post-com-count::after { border: none !important; }
  292. .fixed .column-likes .post-com-count:hover { background-color: #0073AA; }
  293. .fixed .column-likes .vers:before {
  294. font: normal 20px/1 dashicons;
  295. content: '\f155';
  296. speak: none;
  297. -webkit-font-smoothing: antialiased;
  298. -moz-osx-font-smoothing: grayscale;
  299. }
  300. @media screen and (max-width: 782px) {
  301. .fixed .column-likes {
  302. display: none;
  303. }
  304. }
  305. </style>
  306. <?php
  307. }
  308. /**
  309. * Load the JS required for loading the like counts.
  310. */
  311. function enqueue_admin_scripts() {
  312. if ( empty( $_GET['post_type'] ) || 'post' == $_GET['post_type'] || 'page' == $_GET['post_type'] ) {
  313. if ( $this->in_jetpack ) {
  314. wp_enqueue_script(
  315. 'likes-post-count',
  316. Jetpack::get_file_url_for_environment(
  317. '_inc/build/likes/post-count.min.js',
  318. 'modules/likes/post-count.js'
  319. ),
  320. array( 'jquery' ),
  321. JETPACK__VERSION
  322. );
  323. wp_enqueue_script(
  324. 'likes-post-count-jetpack',
  325. Jetpack::get_file_url_for_environment(
  326. '_inc/build/likes/post-count-jetpack.min.js',
  327. 'modules/likes/post-count-jetpack.js'
  328. ),
  329. array( 'likes-post-count' ),
  330. JETPACK__VERSION
  331. );
  332. } else {
  333. wp_enqueue_script( 'jquery.wpcom-proxy-request', "/wp-content/js/jquery/jquery.wpcom-proxy-request.js", array('jquery'), NULL, true );
  334. wp_enqueue_script( 'likes-post-count', plugins_url( 'likes/post-count.js', dirname( __FILE__ ) ), array( 'jquery' ), JETPACK__VERSION );
  335. wp_enqueue_script( 'likes-post-count-wpcom', plugins_url( 'likes/post-count-wpcom.js', dirname( __FILE__ ) ), array( 'likes-post-count', 'jquery.wpcom-proxy-request' ), JETPACK__VERSION );
  336. }
  337. }
  338. }
  339. /**
  340. * Add "Likes" column data to the post edit table in wp-admin.
  341. *
  342. * @param string $column_name
  343. * @param int $post_id
  344. */
  345. function likes_edit_column( $column_name, $post_id ) {
  346. if ( 'likes' == $column_name ) {
  347. if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
  348. $blog_id = get_current_blog_id();
  349. } else {
  350. $blog_id = Jetpack_Options::get_option( 'id' );
  351. }
  352. $permalink = get_permalink( get_the_ID() ); ?>
  353. <a title="" data-post-id="<?php echo (int) $post_id; ?>" class="post-com-count post-like-count" id="post-like-count-<?php echo (int) $post_id; ?>" data-blog-id="<?php echo (int) $blog_id; ?>" href="<?php echo esc_url( $permalink ); ?>#like-<?php echo (int) $post_id; ?>">
  354. <span class="comment-count">0</span>
  355. </a>
  356. <?php
  357. }
  358. }
  359. /**
  360. * Add a "Likes" column header to the post edit table in wp-admin.
  361. *
  362. * @param array $columns
  363. * @return array
  364. */
  365. function add_like_count_column( $columns ) {
  366. $date = $columns['date'];
  367. unset( $columns['date'] );
  368. $columns['likes'] = '<span class="vers"><img title="' . esc_attr__( 'Likes', 'jetpack' ) . '" alt="' . esc_attr__( 'Likes', 'jetpack' ) . '" src="//s0.wordpress.com/i/like-grey-icon.png" /></span>';
  369. $columns['date'] = $date;
  370. return $columns;
  371. }
  372. function post_likes( $content ) {
  373. $post_id = get_the_ID();
  374. if ( ! is_numeric( $post_id ) || ! $this->settings->is_likes_visible() )
  375. return $content;
  376. if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
  377. $blog_id = get_current_blog_id();
  378. $bloginfo = get_blog_details( (int) $blog_id );
  379. $domain = $bloginfo->domain;
  380. } else {
  381. $blog_id = Jetpack_Options::get_option( 'id' );
  382. $url = home_url();
  383. $url_parts = parse_url( $url );
  384. $domain = $url_parts['host'];
  385. }
  386. // make sure to include the scripts before the iframe otherwise weird things happen
  387. add_action( 'wp_footer', 'jetpack_likes_master_iframe', 21 );
  388. /**
  389. * if the same post appears more then once on a page the page goes crazy
  390. * we need a slightly more unique id / name for the widget wrapper.
  391. */
  392. $uniqid = uniqid();
  393. $src = sprintf( 'https://widgets.wp.com/likes/#blog_id=%1$d&amp;post_id=%2$d&amp;origin=%3$s&amp;obj_id=%1$d-%2$d-%4$s', $blog_id, $post_id, $domain, $uniqid );
  394. $name = sprintf( 'like-post-frame-%1$d-%2$d-%3$s', $blog_id, $post_id, $uniqid );
  395. $wrapper = sprintf( 'like-post-wrapper-%1$d-%2$d-%3$s', $blog_id, $post_id, $uniqid );
  396. $headline = sprintf(
  397. /** This filter is already documented in modules/sharedaddy/sharing-service.php */
  398. apply_filters( 'jetpack_sharing_headline_html', '<h3 class="sd-title">%s</h3>', esc_html__( 'Like this:', 'jetpack' ), 'likes' ),
  399. esc_html__( 'Like this:', 'jetpack' )
  400. );
  401. $html = "<div class='sharedaddy sd-block sd-like jetpack-likes-widget-wrapper jetpack-likes-widget-unloaded' id='$wrapper' data-src='$src' data-name='$name'>";
  402. $html .= $headline;
  403. $html .= "<div class='likes-widget-placeholder post-likes-widget-placeholder' style='height: 55px;'><span class='button'><span>" . esc_html__( 'Like', 'jetpack' ) . '</span></span> <span class="loading">' . esc_html__( 'Loading...', 'jetpack' ) . '</span></div>';
  404. $html .= "<span class='sd-text-color'></span><a class='sd-link-color'></a>";
  405. $html .= '</div>';
  406. // Let's make sure that the script is enqueued
  407. wp_enqueue_script( 'jetpack_likes_queuehandler' );
  408. return $content . $html;
  409. }
  410. function post_flair_service_enabled_like( $classes ) {
  411. $classes[] = 'sd-like-enabled';
  412. return $classes;
  413. }
  414. function is_admin_bar_button_visible() {
  415. global $wp_admin_bar;
  416. if ( ! is_object( $wp_admin_bar ) )
  417. return false;
  418. if ( ( ! is_singular( 'post' ) && ! is_attachment() && ! is_page() ) )
  419. return false;
  420. if ( ! $this->settings->is_likes_visible() )
  421. return false;
  422. if ( ! $this->settings->is_post_likeable() )
  423. return false;
  424. /**
  425. * Filters whether the Like button is enabled in the admin bar.
  426. *
  427. * @module likes
  428. *
  429. * @since 2.2.0
  430. *
  431. * @param bool true Should the Like button be visible in the Admin bar. Default to true.
  432. */
  433. return (bool) apply_filters( 'jetpack_admin_bar_likes_enabled', true );
  434. }
  435. function admin_bar_likes() {
  436. global $wp_admin_bar;
  437. $post_id = get_the_ID();
  438. if ( ! is_numeric( $post_id ) || ! $this->is_admin_bar_button_visible() ) {
  439. return;
  440. }
  441. $protocol = 'http';
  442. if ( is_ssl() )
  443. $protocol = 'https';
  444. if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
  445. $blog_id = get_current_blog_id();
  446. $bloginfo = get_blog_details( (int) $blog_id );
  447. $domain = $bloginfo->domain;
  448. } else {
  449. $blog_id = Jetpack_Options::get_option( 'id' );
  450. $url = home_url();
  451. $url_parts = parse_url( $url );
  452. $domain = $url_parts['host'];
  453. }
  454. // make sure to include the scripts before the iframe otherwise weird things happen
  455. add_action( 'wp_footer', 'jetpack_likes_master_iframe', 21 );
  456. $src = sprintf( 'https://widgets.wp.com/likes/#blog_id=%2$d&amp;post_id=%3$d&amp;origin=%1$s://%4$s', $protocol, $blog_id, $post_id, $domain );
  457. $html = "<iframe class='admin-bar-likes-widget jetpack-likes-widget' scrolling='no' frameBorder='0' name='admin-bar-likes-widget' src='$src'></iframe>";
  458. $node = array(
  459. 'id' => 'admin-bar-likes-widget',
  460. 'meta' => array(
  461. 'html' => $html
  462. )
  463. );
  464. $wp_admin_bar->add_node( $node );
  465. }
  466. }
  467. Jetpack_Likes::init();