array( 'https://graph.facebook.com/v8.0/oembed_post', true ), '#https?://www\.facebook\.com/.*/activity/.*#i' => array( 'https://graph.facebook.com/v8.0/oembed_post', true ), '#https?://www\.facebook\.com/.*/photos/.*#i' => array( 'https://graph.facebook.com/v8.0/oembed_post', true ), '#https?://www\.facebook\.com/photo(s/|\.php).*#i' => array( 'https://graph.facebook.com/v8.0/oembed_post', true ), '#https?://www\.facebook\.com/permalink\.php.*#i' => array( 'https://graph.facebook.com/v8.0/oembed_post', true ), '#https?://www\.facebook\.com/media/.*#i' => array( 'https://graph.facebook.com/v8.0/oembed_post', true ), '#https?://www\.facebook\.com/questions/.*#i' => array( 'https://graph.facebook.com/v8.0/oembed_post', true ), '#https?://www\.facebook\.com/notes/.*#i' => array( 'https://graph.facebook.com/v8.0/oembed_post', true ), '#https?://www\.facebook\.com/.*/videos/.*#i' => array( 'https://graph.facebook.com/v8.0/oembed_video', true ), '#https?://www\.facebook\.com/video\.php.*#i' => array( 'https://graph.facebook.com/v8.0/oembed_video', true ), '#https?://www\.facebook\.com/watch/?\?v=\d+#i' => array( 'https://graph.facebook.com/v8.0/oembed_video', true ), // Instagram. '#https?://(www\.)?instagr(\.am|am\.com)/(p|tv)/.*#i' => array( 'https://graph.facebook.com/v8.0/instagram_oembed', true ), '#https?://(www\.)?instagr(\.am|am\.com)/p/.*#i' => array( 'https://graph.facebook.com/v8.0/instagram_oembed', true ), ); $providers = array_merge( $providers, $extra_providers ); return $providers; } /** * Convert Facebook URLs to include a token * * @param string $provider_url Provider URL. * * @return string */ function bimber_oembed_append_facebook_token( $provider_url ) { if ( 0 !== strpos( $provider_url, 'https://graph.facebook.com/v8.0/' ) ) { return $provider_url; } $app_id = bimber_get_facebook_app_id(); $app_secret = bimber_get_facebook_app_secret(); if ( empty( $app_id ) || empty( $app_secret ) ) { return $provider_url; } $access_token = $app_id . '|' . $app_secret; return sprintf( '%s&access_token=%s', $provider_url, urlencode( $access_token ) ); } /** * Wrap embeds in fluid wrapper * * @param string $html oembed HTML markup. * @param string $url Embed URL. * @param array $attr Attributes. * * @return string */ function bimber_fluid_wrapper_embed_oembed_html( $html, $url, $attr ) { $apply = apply_filters( 'bimber_apply_fluid_wrapper_for_oembed', false, $url ); preg_match_all( '/
/', $html, $matches ); if ( ! $apply || count( $matches[0] ) > 0 ) { return $html; } return bimber_fluid_wrapper( array( 'width' => esc_attr( $attr['width'] ), 'height' => esc_attr( $attr['height'] ), ), $html ); } /** * Keep element ratio while scaling. * * @param array $atts Attributes. * @param string $content Content. * * @return string */ function bimber_fluid_wrapper( $atts, $content ) { /* We need a static counter to trace a shortcode without the id attribute */ static $counter = 0; $counter ++; $vars = shortcode_atts( array( 'id' => '', 'class' => '', 'width' => '', 'height' => '', ), $atts, 'bimber_fluid_wrapper' ); $id = $vars['id']; $class = $vars['class']; $width = $vars['width']; $height = $vars['height']; $content = preg_replace( '#^<\/p>|

$#', '', $content ); // Compose final HTML id attribute. $final_id = strlen( $id ) ? $id : 'g1-fluid-wrapper-counter-' . $counter; // Compose final HTML class attribute. $final_class = array( 'g1-fluid-wrapper', ); $final_class = array_merge( $final_class, explode( ' ', $class ) ); // Get width and height values. $width = absint( $width ); $height = absint( $height ); if ( ! $width ) { $re = '/width=[\'"]?(\d+)[\'"]?/'; $width = preg_match( $re, $content, $match ); $width = $width ? absint( $match[1] ) : 0; } if ( ! $height ) { $re = '/height=[\'"]?(\d+)[\'"]?/'; $height = preg_match( $re, $content, $match ); $height = $height ? absint( $match[1] ) : 0; } $height = ( 9999 === $height ) ? round( $width * 9 / 16 ) : $height; // Compose output. $out = '

%content%
'; $out = str_replace( array( '%id%', '%class%', '%outer_style%', '%fluid_width%', '%fluid_height%', '%inner_style%', '%content%', ), array( esc_attr( $final_id ), implode( ' ', array_map( 'sanitize_html_class', $final_class ) ), ( $width && $height ? 'style="width:' . absint( $width ) . 'px;"' : '' ), $width, $height, ( $width && $height ? 'style="padding-bottom:' . ( absint( $height ) / absint( $width ) ) * Первые в кино — Неизданная книга

ПОСЛЕДНИЕ ПУБЛИКАЦИИ

(с) “Первые в кино” 2011-2023. При перепечатывании ссылка на cinemafirst.ru обязательна
Back to Top
Close Add post

Add to Collection

No Collections

Here you'll find all collections you've created before.