PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 14.2
Jetpack – WP Security, Backup, Speed, & Growth v14.2
16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 All 501 releases
jetpack / 3rd-party / bitly.php
bitly.php
36 lines 982 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Fixes issues with the Official Bitly for WordPress
4 * https://wordpress.org/plugins/bitly/
5 *
6 * @package automattic/jetpack
7 */
8
9 if ( isset( $GLOBALS['bitly'] ) ) {
10 if ( method_exists( $GLOBALS['bitly'], 'og_tags' ) ) {
11 remove_action( 'wp_head', array( $GLOBALS['bitly'], 'og_tags' ) );
12 }
13 add_action( 'wp_head', 'jetpack_bitly_og_tag', 100 );
14 }
15
16 /**
17 * Adds bitly OG tags.
18 */
19 function jetpack_bitly_og_tag() {
20 if ( has_filter( 'wp_head', 'jetpack_og_tags' ) === false ) {
21 // Add the bitly part again back if we don't have any jetpack_og_tags added.
22 if ( method_exists( $GLOBALS['bitly'], 'og_tags' ) ) {
23 $GLOBALS['bitly']->og_tags();
24 }
25 } elseif (
26 isset( $GLOBALS['posts'] )
27 && $GLOBALS['posts'][0]->ID > 0
28 && method_exists( $GLOBALS['bitly'], 'get_bitly_link_for_post_id' )
29 ) {
30 printf(
31 "<meta property=\"bitly:url\" content=\"%s\" /> \n",
32 esc_attr( $GLOBALS['bitly']->get_bitly_link_for_post_id( $GLOBALS['posts'][0]->ID ) )
33 );
34 }
35 }
36