summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury German <blueknight@gentoo.org>2019-05-22 00:42:33 -0400
committerYury German <blueknight@gentoo.org>2019-05-22 00:42:33 -0400
commite89abce1b01dda89efdf230101d1aa3c877b3b6c (patch)
treecfb27a564c1f4cfff30d18dbf591efd48283b154 /plugins/jetpack/functions.compat.php
parentAdding Twentyninetten (diff)
downloadblogs-gentoo-e89abce1b01dda89efdf230101d1aa3c877b3b6c.tar.gz
blogs-gentoo-e89abce1b01dda89efdf230101d1aa3c877b3b6c.tar.bz2
blogs-gentoo-e89abce1b01dda89efdf230101d1aa3c877b3b6c.zip
Updating of Plugins and Themes
List of Plugins updates -- akismet.4.1.2 google-authenticator.0.52 jetpack.7.3.1 List of Themes Updates -- mantra.3.2.0 twentyfifteen.2.5 twentyfourteen.2.7 Signed-off-by: Yury German <blueknight@gentoo.org>
Diffstat (limited to 'plugins/jetpack/functions.compat.php')
-rw-r--r--plugins/jetpack/functions.compat.php90
1 files changed, 0 insertions, 90 deletions
diff --git a/plugins/jetpack/functions.compat.php b/plugins/jetpack/functions.compat.php
deleted file mode 100644
index bc7e6fbd..00000000
--- a/plugins/jetpack/functions.compat.php
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-
-/**
-* Required for class.media-extractor.php to match expected function naming convention.
-*
-* @param $url Can be just the $url or the whole $atts array
-* @return bool|mixed The Youtube video ID via jetpack_get_youtube_id
-*/
-
-function jetpack_shortcode_get_youtube_id( $url ) {
- return jetpack_get_youtube_id( $url );
-}
-
-/**
-* @param $url Can be just the $url or the whole $atts array
-* @return bool|mixed The Youtube video ID
-*/
-function jetpack_get_youtube_id( $url ) {
- // Do we have an $atts array? Get first att
- if ( is_array( $url ) ) {
- $url = reset( $url );
- }
-
- $url = youtube_sanitize_url( $url );
- $url = parse_url( $url );
- $id = false;
-
- if ( ! isset( $url['query'] ) )
- return false;
-
- parse_str( $url['query'], $qargs );
-
- if ( ! isset( $qargs['v'] ) && ! isset( $qargs['list'] ) )
- return false;
-
- if ( isset( $qargs['list'] ) )
- $id = preg_replace( '|[^_a-z0-9-]|i', '', $qargs['list'] );
-
- if ( empty( $id ) )
- $id = preg_replace( '|[^_a-z0-9-]|i', '', $qargs['v'] );
-
- return $id;
-}
-
-if ( !function_exists( 'youtube_sanitize_url' ) ) :
-/**
-* Normalizes a YouTube URL to include a v= parameter and a query string free of encoded ampersands.
-*
-* @param string $url
-* @return string The normalized URL
-*/
-function youtube_sanitize_url( $url ) {
- $url = trim( $url, ' "' );
- $url = trim( $url );
- $url = str_replace( array( 'youtu.be/', '/v/', '#!v=', '&amp;', '&#038;', 'playlist' ), array( 'youtu.be/?v=', '/?v=', '?v=', '&', '&', 'videoseries' ), $url );
-
- // Replace any extra question marks with ampersands - the result of a URL like "http://www.youtube.com/v/9FhMMmqzbD8?fs=1&hl=en_US" being passed in.
- $query_string_start = strpos( $url, "?" );
-
- if ( false !== $query_string_start ) {
- $url = substr( $url, 0, $query_string_start + 1 ) . str_replace( "?", "&", substr( $url, $query_string_start + 1 ) );
- }
-
- return $url;
-}
-endif;
-
-/**
- * Merge in three string helper functions from WPCOM.
- *
- * @see WPCOM/wp-content/mu-plugins/string-helpers.php
- */
-if ( ! function_exists( 'wp_startswith' ) ) :
- function wp_startswith( $haystack, $needle ) {
- return 0 === strpos( $haystack, $needle );
- }
-endif;
-
-
-if ( ! function_exists( 'wp_endswith' ) ) :
- function wp_endswith( $haystack, $needle ) {
- return $needle === substr( $haystack, -strlen( $needle ));
- }
-endif;
-
-if ( ! function_exists( 'wp_in' ) ) :
- function wp_in( $needle, $haystack ) {
- return false !== strpos( $haystack, $needle );
- }
-endif;