PATH:
home
/
lab2454c
/
sothebankuab.com
/
wp-content
/
plugins
/
jetpack
/
modules
/
shortcodes
<?php /** * Kickstarter shortcode * * Usage: * [kickstarter url="https://www.kickstarter.com/projects/peaktoplateau/yak-wool-baselayers-from-tibet-to-the-world" width="480" height=""] * * @package automattic/jetpack */ add_shortcode( 'kickstarter', 'jetpack_kickstarter_shortcode' ); add_filter( 'pre_kses', 'jetpack_kickstarter_embed_to_shortcode' ); /** * Parse shortcode arguments and render its output. * * @since 4.5.0 * * @param array $atts Shortcode parameters. * * @return string */ function jetpack_kickstarter_shortcode( $atts ) { if ( empty( $atts['url'] ) ) { return ''; } $url = esc_url_raw( $atts['url'] ); if ( ! preg_match( '#^(www\.)?kickstarter\.com$#i', wp_parse_url( $url, PHP_URL_HOST ) ) ) { return '<!-- Invalid Kickstarter URL -->'; } global $wp_embed; return $wp_embed->shortcode( $atts, $url ); } /** * Converts Kickstarter iframe embeds to a shortcode. * * EG: <iframe width="480" height="360" src="http://www.kickstarter.com/projects/deweymac/dewey-mac-kid-detective-book-make-diy-and-stem-spy/widget/video.html" frameborder="0" scrolling="no"> </iframe> * * @since 4.5.0 * * @param string $content Entry content that possibly includes a Kickstarter embed. * * @return string */ function jetpack_kickstarter_embed_to_shortcode( $content ) { if ( ! is_string( $content ) || false === stripos( $content, 'www.kickstarter.com/projects' ) ) { return $content; } $regexp = '!<iframe((?:\s+\w+=[\'"][^\'"]*[\'"])*)\s+src=[\'"](http://www\.kickstarter\.com/projects/[^/]+/[^/]+)/[^\'"]+[\'"]((?:\s+\w+=[\'"][^\'"]*[\'"])*)>[\s]*</iframe>!i'; $regexp_ent = str_replace( '&#0*58;', '&#0*58;|�*58;', htmlspecialchars( $regexp, ENT_NOQUOTES ) ); // phpcs:ignore foreach ( array( 'regexp', 'regexp_ent' ) as $reg ) { if ( ! preg_match_all( $$reg, $content, $matches, PREG_SET_ORDER ) ) { continue; } foreach ( $matches as $match ) { $url = esc_url( $match[2] ); $params = $match[1] . $match[3]; if ( 'regexp_ent' === $reg ) { $params = html_entity_decode( $params ); } $params = wp_kses_hair( $params, array( 'http' ) ); $width = isset( $params['width'] ) ? (int) $params['width']['value'] : 0; $shortcode = '[kickstarter url=' . $url . ( ( ! empty( $width ) ) ? " width=$width" : '' ) . ']'; $content = str_replace( $match[0], $shortcode, $content ); } } return $content; }
[-] class.filter-embedded-html-objects.php
[edit]
[-] vimeo.php
[edit]
[-] inline-pdfs.php
[edit]
[+]
js
[-] vine.php
[edit]
[-] getty.php
[edit]
[-] twitter-timeline.php
[edit]
[-] codepen.php
[edit]
[-] upcoming-events.php
[edit]
[-] archiveorg-book.php
[edit]
[-] archiveorg.php
[edit]
[-] tweet.php
[edit]
[-] videopress.php
[edit]
[+]
..
[-] youtube.php
[edit]
[-] dailymotion.php
[edit]
[-] mixcloud.php
[edit]
[-] untappd-menu.php
[edit]
[-] crowdsignal.php
[edit]
[+]
img
[-] cartodb.php
[edit]
[-] presentations.php
[edit]
[-] others.php
[edit]
[-] recipe.php
[edit]
[-] unavailable.php
[edit]
[-] flickr.php
[edit]
[-] vr.php
[edit]
[-] gist.php
[edit]
[-] twitchtv.php
[edit]
[-] pinterest.php
[edit]
[-] quiz.php
[edit]
[+]
css
[-] bandcamp.php
[edit]
[-] wufoo.php
[edit]
[-] hulu.php
[edit]
[-] ustream.php
[edit]
[-] slideshare.php
[edit]
[-] kickstarter.php
[edit]
[-] soundcloud.php
[edit]
[-] sitemap.php
[edit]
[-] scribd.php
[edit]
[-] googleapps.php
[edit]
[-] houzz.php
[edit]
[-] facebook.php
[edit]
[+]
images
[-] instagram.php
[edit]
[-] mailchimp.php
[edit]
[-] archives.php
[edit]
[-] spotify.php
[edit]
[-] googleplus.php
[edit]
[-] googlemaps.php
[edit]
[-] slideshow.php
[edit]
[-] ted.php
[edit]
[-] wordads.php
[edit]
[-] gravatar.php
[edit]
[-] brightcove.php
[edit]
[-] flatio.php
[edit]
[-] medium.php
[edit]