debug-bar
4 years ago
3rd-party.php
1 year ago
amp.php
3 years ago
atomic.php
2 years ago
bbpress.php
3 years ago
beaverbuilder.php
1 year ago
bitly.php
3 years ago
buddypress.php
5 years ago
class-domain-mapping.php
2 years ago
class-jetpack-bbpress-rest-api.php
2 years ago
class.jetpack-amp-support.php
2 years ago
creative-mail.php
2 years ago
debug-bar.php
5 years ago
jetpack-backup.php
2 years ago
jetpack-boost.php
2 years ago
qtranslate-x.php
2 years ago
vaultpress.php
2 years ago
web-stories.php
5 years ago
woocommerce-services.php
2 years ago
woocommerce.php
2 years ago
wpcom-reader.php
2 years ago
wpml.php
5 years ago
bitly.php
36 lines
| 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 |