Skip to content

Commit

Permalink
only use wp_parse_url for 4.4+ awesomemotive#338
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltorbert committed Jun 19, 2016
1 parent 4adea94 commit c8bcb1c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion public/opengraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,13 @@ public static function prepare_twitter_username( $twitter_profile ) {
*/
public static function twitter_url_to_user( $twitter_profile ) {

// If they're below 4.4 (no wp_parse_url) bail. We can improve this for <4.4 later or just hold out until we drop 4.4 support.
if ( ! function_exists( 'wp_parse_url' ) ) {
return $twitter_profile;
}

//extract the twitter username from the url

$parsed_twitter_profile = wp_parse_url( $twitter_profile );

$path = $parsed_twitter_profile['path'];
Expand Down

0 comments on commit c8bcb1c

Please sign in to comment.