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