Edit File by line
/home/zeestwma/richards.../wp-inclu...
File: embed.php
absint( $width ),
[500] Fix | Delete
absint( $height ),
[501] Fix | Delete
esc_attr(
[502] Fix | Delete
sprintf(
[503] Fix | Delete
/* translators: 1: Post title, 2: Site title. */
[504] Fix | Delete
__( '“%1$s” — %2$s' ),
[505] Fix | Delete
get_the_title( $post ),
[506] Fix | Delete
get_bloginfo( 'name' )
[507] Fix | Delete
)
[508] Fix | Delete
),
[509] Fix | Delete
esc_attr( $secret )
[510] Fix | Delete
);
[511] Fix | Delete
[512] Fix | Delete
/*
[513] Fix | Delete
* Note that the script must be placed after the <blockquote> and <iframe> due to a regexp parsing issue in
[514] Fix | Delete
* `wp_filter_oembed_result()`. Because of the regex pattern starts with `|(<blockquote>.*?</blockquote>)?.*|`
[515] Fix | Delete
* wherein the <blockquote> is marked as being optional, if it is not at the beginning of the string then the group
[516] Fix | Delete
* will fail to match and everything will be matched by `.*` and not included in the group. This regex issue goes
[517] Fix | Delete
* back to WordPress 4.4, so in order to not break older installs this script must come at the end.
[518] Fix | Delete
*/
[519] Fix | Delete
$output .= wp_get_inline_script_tag(
[520] Fix | Delete
file_get_contents( ABSPATH . WPINC . '/js/wp-embed' . wp_scripts_get_suffix() . '.js' )
[521] Fix | Delete
);
[522] Fix | Delete
[523] Fix | Delete
/**
[524] Fix | Delete
* Filters the embed HTML output for a given post.
[525] Fix | Delete
*
[526] Fix | Delete
* @since 4.4.0
[527] Fix | Delete
*
[528] Fix | Delete
* @param string $output The default iframe tag to display embedded content.
[529] Fix | Delete
* @param WP_Post $post Current post object.
[530] Fix | Delete
* @param int $width Width of the response.
[531] Fix | Delete
* @param int $height Height of the response.
[532] Fix | Delete
*/
[533] Fix | Delete
return apply_filters( 'embed_html', $output, $post, $width, $height );
[534] Fix | Delete
}
[535] Fix | Delete
[536] Fix | Delete
/**
[537] Fix | Delete
* Retrieves the oEmbed response data for a given post.
[538] Fix | Delete
*
[539] Fix | Delete
* @since 4.4.0
[540] Fix | Delete
* @since 6.8.0 Output was adjusted to only embed if the post type supports it.
[541] Fix | Delete
*
[542] Fix | Delete
* @param WP_Post|int $post Post ID or post object.
[543] Fix | Delete
* @param int $width The requested width.
[544] Fix | Delete
* @return array|false Response data on success, false if post doesn't exist,
[545] Fix | Delete
* is not publicly viewable or post type is not embeddable.
[546] Fix | Delete
*/
[547] Fix | Delete
function get_oembed_response_data( $post, $width ) {
[548] Fix | Delete
$post = get_post( $post );
[549] Fix | Delete
$width = absint( $width );
[550] Fix | Delete
[551] Fix | Delete
if ( ! $post ) {
[552] Fix | Delete
return false;
[553] Fix | Delete
}
[554] Fix | Delete
[555] Fix | Delete
if ( ! is_post_publicly_viewable( $post ) ) {
[556] Fix | Delete
return false;
[557] Fix | Delete
}
[558] Fix | Delete
[559] Fix | Delete
if ( ! is_post_embeddable( $post ) ) {
[560] Fix | Delete
return false;
[561] Fix | Delete
}
[562] Fix | Delete
[563] Fix | Delete
/**
[564] Fix | Delete
* Filters the allowed minimum and maximum widths for the oEmbed response.
[565] Fix | Delete
*
[566] Fix | Delete
* @since 4.4.0
[567] Fix | Delete
*
[568] Fix | Delete
* @param array $min_max_width {
[569] Fix | Delete
* Minimum and maximum widths for the oEmbed response.
[570] Fix | Delete
*
[571] Fix | Delete
* @type int $min Minimum width. Default 200.
[572] Fix | Delete
* @type int $max Maximum width. Default 600.
[573] Fix | Delete
* }
[574] Fix | Delete
*/
[575] Fix | Delete
$min_max_width = apply_filters(
[576] Fix | Delete
'oembed_min_max_width',
[577] Fix | Delete
array(
[578] Fix | Delete
'min' => 200,
[579] Fix | Delete
'max' => 600,
[580] Fix | Delete
)
[581] Fix | Delete
);
[582] Fix | Delete
[583] Fix | Delete
$width = min( max( $min_max_width['min'], $width ), $min_max_width['max'] );
[584] Fix | Delete
$height = max( (int) ceil( $width / 16 * 9 ), 200 );
[585] Fix | Delete
[586] Fix | Delete
$data = array(
[587] Fix | Delete
'version' => '1.0',
[588] Fix | Delete
'provider_name' => get_bloginfo( 'name' ),
[589] Fix | Delete
'provider_url' => get_home_url(),
[590] Fix | Delete
'author_name' => get_bloginfo( 'name' ),
[591] Fix | Delete
'author_url' => get_home_url(),
[592] Fix | Delete
'title' => get_the_title( $post ),
[593] Fix | Delete
'type' => 'link',
[594] Fix | Delete
);
[595] Fix | Delete
[596] Fix | Delete
$author = get_userdata( $post->post_author );
[597] Fix | Delete
[598] Fix | Delete
if ( $author ) {
[599] Fix | Delete
$data['author_name'] = $author->display_name;
[600] Fix | Delete
$data['author_url'] = get_author_posts_url( $author->ID );
[601] Fix | Delete
}
[602] Fix | Delete
[603] Fix | Delete
/**
[604] Fix | Delete
* Filters the oEmbed response data.
[605] Fix | Delete
*
[606] Fix | Delete
* @since 4.4.0
[607] Fix | Delete
*
[608] Fix | Delete
* @param array $data The response data.
[609] Fix | Delete
* @param WP_Post $post The post object.
[610] Fix | Delete
* @param int $width The requested width.
[611] Fix | Delete
* @param int $height The calculated height.
[612] Fix | Delete
*/
[613] Fix | Delete
return apply_filters( 'oembed_response_data', $data, $post, $width, $height );
[614] Fix | Delete
}
[615] Fix | Delete
[616] Fix | Delete
[617] Fix | Delete
/**
[618] Fix | Delete
* Retrieves the oEmbed response data for a given URL.
[619] Fix | Delete
*
[620] Fix | Delete
* @since 5.0.0
[621] Fix | Delete
*
[622] Fix | Delete
* @param string $url The URL that should be inspected for discovery `<link>` tags.
[623] Fix | Delete
* @param array $args oEmbed remote get arguments.
[624] Fix | Delete
* @return object|false oEmbed response data if the URL does belong to the current site. False otherwise.
[625] Fix | Delete
*/
[626] Fix | Delete
function get_oembed_response_data_for_url( $url, $args ) {
[627] Fix | Delete
$switched_blog = false;
[628] Fix | Delete
[629] Fix | Delete
if ( is_multisite() ) {
[630] Fix | Delete
$url_parts = wp_parse_args(
[631] Fix | Delete
wp_parse_url( $url ),
[632] Fix | Delete
array(
[633] Fix | Delete
'host' => '',
[634] Fix | Delete
'port' => null,
[635] Fix | Delete
'path' => '/',
[636] Fix | Delete
)
[637] Fix | Delete
);
[638] Fix | Delete
[639] Fix | Delete
$qv = array(
[640] Fix | Delete
'domain' => $url_parts['host'] . ( $url_parts['port'] ? ':' . $url_parts['port'] : '' ),
[641] Fix | Delete
'path' => '/',
[642] Fix | Delete
'update_site_meta_cache' => false,
[643] Fix | Delete
);
[644] Fix | Delete
[645] Fix | Delete
// In case of subdirectory configs, set the path.
[646] Fix | Delete
if ( ! is_subdomain_install() ) {
[647] Fix | Delete
$path = explode( '/', ltrim( $url_parts['path'], '/' ) );
[648] Fix | Delete
$path = reset( $path );
[649] Fix | Delete
[650] Fix | Delete
if ( $path ) {
[651] Fix | Delete
$qv['path'] = get_network()->path . $path . '/';
[652] Fix | Delete
}
[653] Fix | Delete
}
[654] Fix | Delete
[655] Fix | Delete
$sites = get_sites( $qv );
[656] Fix | Delete
$site = reset( $sites );
[657] Fix | Delete
[658] Fix | Delete
// Do not allow embeds for deleted/archived/spam sites.
[659] Fix | Delete
if ( ! empty( $site->deleted ) || ! empty( $site->spam ) || ! empty( $site->archived ) ) {
[660] Fix | Delete
return false;
[661] Fix | Delete
}
[662] Fix | Delete
[663] Fix | Delete
if ( $site && get_current_blog_id() !== (int) $site->blog_id ) {
[664] Fix | Delete
switch_to_blog( $site->blog_id );
[665] Fix | Delete
$switched_blog = true;
[666] Fix | Delete
}
[667] Fix | Delete
}
[668] Fix | Delete
[669] Fix | Delete
$post_id = url_to_postid( $url );
[670] Fix | Delete
[671] Fix | Delete
/** This filter is documented in wp-includes/class-wp-oembed-controller.php */
[672] Fix | Delete
$post_id = apply_filters( 'oembed_request_post_id', $post_id, $url );
[673] Fix | Delete
[674] Fix | Delete
if ( ! $post_id ) {
[675] Fix | Delete
if ( $switched_blog ) {
[676] Fix | Delete
restore_current_blog();
[677] Fix | Delete
}
[678] Fix | Delete
[679] Fix | Delete
return false;
[680] Fix | Delete
}
[681] Fix | Delete
[682] Fix | Delete
$width = isset( $args['width'] ) ? $args['width'] : 0;
[683] Fix | Delete
[684] Fix | Delete
$data = get_oembed_response_data( $post_id, $width );
[685] Fix | Delete
[686] Fix | Delete
if ( $switched_blog ) {
[687] Fix | Delete
restore_current_blog();
[688] Fix | Delete
}
[689] Fix | Delete
[690] Fix | Delete
return $data ? (object) $data : false;
[691] Fix | Delete
}
[692] Fix | Delete
[693] Fix | Delete
[694] Fix | Delete
/**
[695] Fix | Delete
* Filters the oEmbed response data to return an iframe embed code.
[696] Fix | Delete
*
[697] Fix | Delete
* @since 4.4.0
[698] Fix | Delete
*
[699] Fix | Delete
* @param array $data The response data.
[700] Fix | Delete
* @param WP_Post $post The post object.
[701] Fix | Delete
* @param int $width The requested width.
[702] Fix | Delete
* @param int $height The calculated height.
[703] Fix | Delete
* @return array The modified response data.
[704] Fix | Delete
*/
[705] Fix | Delete
function get_oembed_response_data_rich( $data, $post, $width, $height ) {
[706] Fix | Delete
$data['width'] = absint( $width );
[707] Fix | Delete
$data['height'] = absint( $height );
[708] Fix | Delete
$data['type'] = 'rich';
[709] Fix | Delete
$data['html'] = get_post_embed_html( $width, $height, $post );
[710] Fix | Delete
[711] Fix | Delete
// Add post thumbnail to response if available.
[712] Fix | Delete
$thumbnail_id = false;
[713] Fix | Delete
[714] Fix | Delete
if ( has_post_thumbnail( $post->ID ) ) {
[715] Fix | Delete
$thumbnail_id = get_post_thumbnail_id( $post->ID );
[716] Fix | Delete
}
[717] Fix | Delete
[718] Fix | Delete
if ( 'attachment' === get_post_type( $post ) ) {
[719] Fix | Delete
if ( wp_attachment_is_image( $post ) ) {
[720] Fix | Delete
$thumbnail_id = $post->ID;
[721] Fix | Delete
} elseif ( wp_attachment_is( 'video', $post ) ) {
[722] Fix | Delete
$thumbnail_id = get_post_thumbnail_id( $post );
[723] Fix | Delete
$data['type'] = 'video';
[724] Fix | Delete
}
[725] Fix | Delete
}
[726] Fix | Delete
[727] Fix | Delete
if ( $thumbnail_id ) {
[728] Fix | Delete
list( $thumbnail_url, $thumbnail_width, $thumbnail_height ) = wp_get_attachment_image_src( $thumbnail_id, array( $width, 0 ) );
[729] Fix | Delete
$data['thumbnail_url'] = $thumbnail_url;
[730] Fix | Delete
$data['thumbnail_width'] = $thumbnail_width;
[731] Fix | Delete
$data['thumbnail_height'] = $thumbnail_height;
[732] Fix | Delete
}
[733] Fix | Delete
[734] Fix | Delete
return $data;
[735] Fix | Delete
}
[736] Fix | Delete
[737] Fix | Delete
/**
[738] Fix | Delete
* Ensures that the specified format is either 'json' or 'xml'.
[739] Fix | Delete
*
[740] Fix | Delete
* @since 4.4.0
[741] Fix | Delete
*
[742] Fix | Delete
* @param string $format The oEmbed response format. Accepts 'json' or 'xml'.
[743] Fix | Delete
* @return string The format, either 'xml' or 'json'. Default 'json'.
[744] Fix | Delete
*/
[745] Fix | Delete
function wp_oembed_ensure_format( $format ) {
[746] Fix | Delete
if ( ! in_array( $format, array( 'json', 'xml' ), true ) ) {
[747] Fix | Delete
return 'json';
[748] Fix | Delete
}
[749] Fix | Delete
[750] Fix | Delete
return $format;
[751] Fix | Delete
}
[752] Fix | Delete
[753] Fix | Delete
/**
[754] Fix | Delete
* Hooks into the REST API output to print XML instead of JSON.
[755] Fix | Delete
*
[756] Fix | Delete
* This is only done for the oEmbed API endpoint,
[757] Fix | Delete
* which supports both formats.
[758] Fix | Delete
*
[759] Fix | Delete
* @access private
[760] Fix | Delete
* @since 4.4.0
[761] Fix | Delete
*
[762] Fix | Delete
* @param bool $served Whether the request has already been served.
[763] Fix | Delete
* @param WP_HTTP_Response $result Result to send to the client. Usually a `WP_REST_Response`.
[764] Fix | Delete
* @param WP_REST_Request $request Request used to generate the response.
[765] Fix | Delete
* @param WP_REST_Server $server Server instance.
[766] Fix | Delete
* @return true
[767] Fix | Delete
*/
[768] Fix | Delete
function _oembed_rest_pre_serve_request( $served, $result, $request, $server ) {
[769] Fix | Delete
$params = $request->get_params();
[770] Fix | Delete
[771] Fix | Delete
if ( '/oembed/1.0/embed' !== $request->get_route() || 'GET' !== $request->get_method() ) {
[772] Fix | Delete
return $served;
[773] Fix | Delete
}
[774] Fix | Delete
[775] Fix | Delete
if ( ! isset( $params['format'] ) || 'xml' !== $params['format'] ) {
[776] Fix | Delete
return $served;
[777] Fix | Delete
}
[778] Fix | Delete
[779] Fix | Delete
// Embed links inside the request.
[780] Fix | Delete
$data = $server->response_to_data( $result, false );
[781] Fix | Delete
[782] Fix | Delete
if ( ! class_exists( 'SimpleXMLElement' ) ) {
[783] Fix | Delete
status_header( 501 );
[784] Fix | Delete
die( get_status_header_desc( 501 ) );
[785] Fix | Delete
}
[786] Fix | Delete
[787] Fix | Delete
$result = _oembed_create_xml( $data );
[788] Fix | Delete
[789] Fix | Delete
// Bail if there's no XML.
[790] Fix | Delete
if ( ! $result ) {
[791] Fix | Delete
status_header( 501 );
[792] Fix | Delete
return get_status_header_desc( 501 );
[793] Fix | Delete
}
[794] Fix | Delete
[795] Fix | Delete
if ( ! headers_sent() ) {
[796] Fix | Delete
$server->send_header( 'Content-Type', 'text/xml; charset=' . get_option( 'blog_charset' ) );
[797] Fix | Delete
}
[798] Fix | Delete
[799] Fix | Delete
echo $result;
[800] Fix | Delete
[801] Fix | Delete
return true;
[802] Fix | Delete
}
[803] Fix | Delete
[804] Fix | Delete
/**
[805] Fix | Delete
* Creates an XML string from a given array.
[806] Fix | Delete
*
[807] Fix | Delete
* @since 4.4.0
[808] Fix | Delete
* @access private
[809] Fix | Delete
*
[810] Fix | Delete
* @param array $data The original oEmbed response data.
[811] Fix | Delete
* @param SimpleXMLElement $node Optional. XML node to append the result to recursively.
[812] Fix | Delete
* @return string|false XML string on success, false on error.
[813] Fix | Delete
*/
[814] Fix | Delete
function _oembed_create_xml( $data, $node = null ) {
[815] Fix | Delete
if ( ! is_array( $data ) || empty( $data ) ) {
[816] Fix | Delete
return false;
[817] Fix | Delete
}
[818] Fix | Delete
[819] Fix | Delete
if ( null === $node ) {
[820] Fix | Delete
$node = new SimpleXMLElement( '<oembed></oembed>' );
[821] Fix | Delete
}
[822] Fix | Delete
[823] Fix | Delete
foreach ( $data as $key => $value ) {
[824] Fix | Delete
if ( is_numeric( $key ) ) {
[825] Fix | Delete
$key = 'oembed';
[826] Fix | Delete
}
[827] Fix | Delete
[828] Fix | Delete
if ( is_array( $value ) ) {
[829] Fix | Delete
$item = $node->addChild( $key );
[830] Fix | Delete
_oembed_create_xml( $value, $item );
[831] Fix | Delete
} else {
[832] Fix | Delete
$node->addChild( $key, esc_html( $value ) );
[833] Fix | Delete
}
[834] Fix | Delete
}
[835] Fix | Delete
[836] Fix | Delete
return $node->asXML();
[837] Fix | Delete
}
[838] Fix | Delete
[839] Fix | Delete
/**
[840] Fix | Delete
* Filters the given oEmbed HTML to make sure iframes have a title attribute.
[841] Fix | Delete
*
[842] Fix | Delete
* @since 5.2.0
[843] Fix | Delete
*
[844] Fix | Delete
* @param string $result The oEmbed HTML result.
[845] Fix | Delete
* @param object $data A data object result from an oEmbed provider.
[846] Fix | Delete
* @param string $url The URL of the content to be embedded.
[847] Fix | Delete
* @return string The filtered oEmbed result.
[848] Fix | Delete
*/
[849] Fix | Delete
function wp_filter_oembed_iframe_title_attribute( $result, $data, $url ) {
[850] Fix | Delete
if ( false === $result || ! in_array( $data->type, array( 'rich', 'video' ), true ) ) {
[851] Fix | Delete
return $result;
[852] Fix | Delete
}
[853] Fix | Delete
[854] Fix | Delete
$title = ! empty( $data->title ) ? $data->title : '';
[855] Fix | Delete
[856] Fix | Delete
$pattern = '`<iframe([^>]*)>`i';
[857] Fix | Delete
if ( preg_match( $pattern, $result, $matches ) ) {
[858] Fix | Delete
$attrs = wp_kses_hair( $matches[1], wp_allowed_protocols() );
[859] Fix | Delete
[860] Fix | Delete
foreach ( $attrs as $attr => $item ) {
[861] Fix | Delete
$lower_attr = strtolower( $attr );
[862] Fix | Delete
if ( $lower_attr === $attr ) {
[863] Fix | Delete
continue;
[864] Fix | Delete
}
[865] Fix | Delete
if ( ! isset( $attrs[ $lower_attr ] ) ) {
[866] Fix | Delete
$attrs[ $lower_attr ] = $item;
[867] Fix | Delete
unset( $attrs[ $attr ] );
[868] Fix | Delete
}
[869] Fix | Delete
}
[870] Fix | Delete
}
[871] Fix | Delete
[872] Fix | Delete
if ( ! empty( $attrs['title']['value'] ) ) {
[873] Fix | Delete
$title = $attrs['title']['value'];
[874] Fix | Delete
}
[875] Fix | Delete
[876] Fix | Delete
/**
[877] Fix | Delete
* Filters the title attribute of the given oEmbed HTML iframe.
[878] Fix | Delete
*
[879] Fix | Delete
* @since 5.2.0
[880] Fix | Delete
*
[881] Fix | Delete
* @param string $title The title attribute.
[882] Fix | Delete
* @param string $result The oEmbed HTML result.
[883] Fix | Delete
* @param object $data A data object result from an oEmbed provider.
[884] Fix | Delete
* @param string $url The URL of the content to be embedded.
[885] Fix | Delete
*/
[886] Fix | Delete
$title = apply_filters( 'oembed_iframe_title_attribute', $title, $result, $data, $url );
[887] Fix | Delete
[888] Fix | Delete
if ( '' === $title ) {
[889] Fix | Delete
return $result;
[890] Fix | Delete
}
[891] Fix | Delete
[892] Fix | Delete
if ( isset( $attrs['title'] ) ) {
[893] Fix | Delete
unset( $attrs['title'] );
[894] Fix | Delete
$attr_string = implode( ' ', wp_list_pluck( $attrs, 'whole' ) );
[895] Fix | Delete
$result = str_replace( $matches[0], '<iframe ' . trim( $attr_string ) . '>', $result );
[896] Fix | Delete
}
[897] Fix | Delete
return str_ireplace( '<iframe ', sprintf( '<iframe title="%s" ', esc_attr( $title ) ), $result );
[898] Fix | Delete
}
[899] Fix | Delete
[900] Fix | Delete
[901] Fix | Delete
/**
[902] Fix | Delete
* Filters the given oEmbed HTML.
[903] Fix | Delete
*
[904] Fix | Delete
* If the `$url` isn't on the trusted providers list,
[905] Fix | Delete
* we need to filter the HTML heavily for security.
[906] Fix | Delete
*
[907] Fix | Delete
* Only filters 'rich' and 'video' response types.
[908] Fix | Delete
*
[909] Fix | Delete
* @since 4.4.0
[910] Fix | Delete
*
[911] Fix | Delete
* @param string $result The oEmbed HTML result.
[912] Fix | Delete
* @param object $data A data object result from an oEmbed provider.
[913] Fix | Delete
* @param string $url The URL of the content to be embedded.
[914] Fix | Delete
* @return string The filtered and sanitized oEmbed result.
[915] Fix | Delete
*/
[916] Fix | Delete
function wp_filter_oembed_result( $result, $data, $url ) {
[917] Fix | Delete
if ( false === $result || ! in_array( $data->type, array( 'rich', 'video' ), true ) ) {
[918] Fix | Delete
return $result;
[919] Fix | Delete
}
[920] Fix | Delete
[921] Fix | Delete
$wp_oembed = _wp_oembed_get_object();
[922] Fix | Delete
[923] Fix | Delete
// Don't modify the HTML for trusted providers.
[924] Fix | Delete
if ( false !== $wp_oembed->get_provider( $url, array( 'discover' => false ) ) ) {
[925] Fix | Delete
return $result;
[926] Fix | Delete
}
[927] Fix | Delete
[928] Fix | Delete
$allowed_html = array(
[929] Fix | Delete
'a' => array(
[930] Fix | Delete
'href' => true,
[931] Fix | Delete
),
[932] Fix | Delete
'blockquote' => array(),
[933] Fix | Delete
'iframe' => array(
[934] Fix | Delete
'src' => true,
[935] Fix | Delete
'width' => true,
[936] Fix | Delete
'height' => true,
[937] Fix | Delete
'frameborder' => true,
[938] Fix | Delete
'marginwidth' => true,
[939] Fix | Delete
'marginheight' => true,
[940] Fix | Delete
'scrolling' => true,
[941] Fix | Delete
'title' => true,
[942] Fix | Delete
),
[943] Fix | Delete
);
[944] Fix | Delete
[945] Fix | Delete
$html = wp_kses( $result, $allowed_html );
[946] Fix | Delete
[947] Fix | Delete
preg_match( '|(<blockquote>.*?</blockquote>)?.*(<iframe.*?></iframe>)|ms', $html, $content );
[948] Fix | Delete
// We require at least the iframe to exist.
[949] Fix | Delete
if ( empty( $content[2] ) ) {
[950] Fix | Delete
return false;
[951] Fix | Delete
}
[952] Fix | Delete
$html = $content[1] . $content[2];
[953] Fix | Delete
[954] Fix | Delete
preg_match( '/ src=([\'"])(.*?)\1/', $html, $results );
[955] Fix | Delete
[956] Fix | Delete
if ( ! empty( $results ) ) {
[957] Fix | Delete
$secret = wp_generate_password( 10, false );
[958] Fix | Delete
[959] Fix | Delete
$url = esc_url( "{$results[2]}#?secret=$secret" );
[960] Fix | Delete
$q = $results[1];
[961] Fix | Delete
[962] Fix | Delete
$html = str_replace( $results[0], ' src=' . $q . $url . $q . ' data-secret=' . $q . $secret . $q, $html );
[963] Fix | Delete
$html = str_replace( '<blockquote', "<blockquote data-secret=\"$secret\"", $html );
[964] Fix | Delete
}
[965] Fix | Delete
[966] Fix | Delete
$allowed_html['blockquote']['data-secret'] = true;
[967] Fix | Delete
$allowed_html['iframe']['data-secret'] = true;
[968] Fix | Delete
[969] Fix | Delete
$html = wp_kses( $html, $allowed_html );
[970] Fix | Delete
[971] Fix | Delete
if ( ! empty( $content[1] ) ) {
[972] Fix | Delete
// We have a blockquote to fall back on. Hide the iframe by default.
[973] Fix | Delete
$html = str_replace( '<iframe', '<iframe style="position: absolute; visibility: hidden;"', $html );
[974] Fix | Delete
$html = str_replace( '<blockquote', '<blockquote class="wp-embedded-content"', $html );
[975] Fix | Delete
}
[976] Fix | Delete
[977] Fix | Delete
$html = str_ireplace( '<iframe', '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"', $html );
[978] Fix | Delete
[979] Fix | Delete
return $html;
[980] Fix | Delete
}
[981] Fix | Delete
[982] Fix | Delete
/**
[983] Fix | Delete
* Filters the string in the 'more' link displayed after a trimmed excerpt.
[984] Fix | Delete
*
[985] Fix | Delete
* Replaces '[...]' (appended to automatically generated excerpts) with an
[986] Fix | Delete
* ellipsis and a "Continue reading" link in the embed template.
[987] Fix | Delete
*
[988] Fix | Delete
* @since 4.4.0
[989] Fix | Delete
*
[990] Fix | Delete
* @param string $more_string Default 'more' string.
[991] Fix | Delete
* @return string 'Continue reading' link prepended with an ellipsis.
[992] Fix | Delete
*/
[993] Fix | Delete
function wp_embed_excerpt_more( $more_string ) {
[994] Fix | Delete
if ( ! is_embed() ) {
[995] Fix | Delete
return $more_string;
[996] Fix | Delete
}
[997] Fix | Delete
[998] Fix | Delete
$link = sprintf(
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function