File tree 2 files changed +31
-1
lines changed
2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 6
6
*/
7
7
8
8
require_once ( 'buddypress.php ' );
9
- require_once ( 'wpml.php ' );
9
+ require_once ( 'wpml.php ' );
10
+ require_once ( 'bitly.php ' );
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * Fixes issues with the Official Bitly for WordPress
5
+ * http://wordpress.org/plugins/bitly/
6
+ */
7
+ if ( class_exists ( 'Bitly ' ) ) {
8
+
9
+ if ( isset ( $ GLOBALS ['bitly ' ] ) ) {
10
+ remove_action ( 'wp_head ' , array ( $ GLOBALS ['bitly ' ], 'og_tags ' ) );
11
+ add_action ( 'wp_head ' , 'jetpack_bitly_og_tag ' , 100 );
12
+ }
13
+
14
+ }
15
+
16
+ /**
17
+ * jetpack_bitly_og_tag
18
+ *
19
+ * @return null
20
+ */
21
+ function jetpack_bitly_og_tag () {
22
+ if ( has_filter ( 'wp_head ' , 'jetpack_og_tags ' ) === false ) {
23
+ // Add the bitly part again back if we don't have any jetpack_og_tags added
24
+ $ GLOBALS ['bitly ' ]->og_tags ();
25
+ } elseif ( isset ( $ GLOBALS ['posts ' ] ) && $ GLOBALS ['posts ' ][0 ]->ID > 0 ) {
26
+ printf ( "<meta property= \"bitly:url \" content= \"%s \" /> \n" , esc_attr ( $ GLOBALS ['bitly ' ]->get_bitly_link_for_post_id ( $ GLOBALS ['posts ' ][0 ]->ID ) ) );
27
+ }
28
+
29
+ }
You can’t perform that action at this time.
0 commit comments