Edit File by line
/home/zeestwma/richards.../wp-inclu...
File: embed.php
'<a href="%1$s" class="wp-embed-more" target="_top">%2$s</a>',
[1000] Fix | Delete
esc_url( get_permalink() ),
[1001] Fix | Delete
/* translators: %s: Post title. */
[1002] Fix | Delete
sprintf( __( 'Continue reading %s' ), '<span class="screen-reader-text">' . get_the_title() . '</span>' )
[1003] Fix | Delete
);
[1004] Fix | Delete
return ' &hellip; ' . $link;
[1005] Fix | Delete
}
[1006] Fix | Delete
[1007] Fix | Delete
/**
[1008] Fix | Delete
* Displays the post excerpt for the embed template.
[1009] Fix | Delete
*
[1010] Fix | Delete
* Intended to be used in 'The Loop'.
[1011] Fix | Delete
*
[1012] Fix | Delete
* @since 4.4.0
[1013] Fix | Delete
*/
[1014] Fix | Delete
function the_excerpt_embed() {
[1015] Fix | Delete
$output = get_the_excerpt();
[1016] Fix | Delete
[1017] Fix | Delete
/**
[1018] Fix | Delete
* Filters the post excerpt for the embed template.
[1019] Fix | Delete
*
[1020] Fix | Delete
* @since 4.4.0
[1021] Fix | Delete
*
[1022] Fix | Delete
* @param string $output The current post excerpt.
[1023] Fix | Delete
*/
[1024] Fix | Delete
echo apply_filters( 'the_excerpt_embed', $output );
[1025] Fix | Delete
}
[1026] Fix | Delete
[1027] Fix | Delete
/**
[1028] Fix | Delete
* Filters the post excerpt for the embed template.
[1029] Fix | Delete
*
[1030] Fix | Delete
* Shows players for video and audio attachments.
[1031] Fix | Delete
*
[1032] Fix | Delete
* @since 4.4.0
[1033] Fix | Delete
*
[1034] Fix | Delete
* @param string $content The current post excerpt.
[1035] Fix | Delete
* @return string The modified post excerpt.
[1036] Fix | Delete
*/
[1037] Fix | Delete
function wp_embed_excerpt_attachment( $content ) {
[1038] Fix | Delete
if ( is_attachment() ) {
[1039] Fix | Delete
return prepend_attachment( '' );
[1040] Fix | Delete
}
[1041] Fix | Delete
[1042] Fix | Delete
return $content;
[1043] Fix | Delete
}
[1044] Fix | Delete
[1045] Fix | Delete
/**
[1046] Fix | Delete
* Enqueues embed iframe default CSS and JS.
[1047] Fix | Delete
*
[1048] Fix | Delete
* Enqueue PNG fallback CSS for embed iframe for legacy versions of IE.
[1049] Fix | Delete
*
[1050] Fix | Delete
* Allows plugins to queue scripts for the embed iframe end using wp_enqueue_script().
[1051] Fix | Delete
* Runs first in oembed_head().
[1052] Fix | Delete
*
[1053] Fix | Delete
* @since 4.4.0
[1054] Fix | Delete
*/
[1055] Fix | Delete
function enqueue_embed_scripts() {
[1056] Fix | Delete
wp_enqueue_style( 'wp-embed-template-ie' );
[1057] Fix | Delete
[1058] Fix | Delete
/**
[1059] Fix | Delete
* Fires when scripts and styles are enqueued for the embed iframe.
[1060] Fix | Delete
*
[1061] Fix | Delete
* @since 4.4.0
[1062] Fix | Delete
*/
[1063] Fix | Delete
do_action( 'enqueue_embed_scripts' );
[1064] Fix | Delete
}
[1065] Fix | Delete
[1066] Fix | Delete
/**
[1067] Fix | Delete
* Enqueues the CSS in the embed iframe header.
[1068] Fix | Delete
*
[1069] Fix | Delete
* @since 6.4.0
[1070] Fix | Delete
*/
[1071] Fix | Delete
function wp_enqueue_embed_styles() {
[1072] Fix | Delete
// Back-compat for plugins that disable functionality by unhooking this action.
[1073] Fix | Delete
if ( ! has_action( 'embed_head', 'print_embed_styles' ) ) {
[1074] Fix | Delete
return;
[1075] Fix | Delete
}
[1076] Fix | Delete
remove_action( 'embed_head', 'print_embed_styles' );
[1077] Fix | Delete
[1078] Fix | Delete
$suffix = wp_scripts_get_suffix();
[1079] Fix | Delete
$handle = 'wp-embed-template';
[1080] Fix | Delete
wp_register_style( $handle, false );
[1081] Fix | Delete
wp_add_inline_style( $handle, file_get_contents( ABSPATH . WPINC . "/css/wp-embed-template$suffix.css" ) );
[1082] Fix | Delete
wp_enqueue_style( $handle );
[1083] Fix | Delete
}
[1084] Fix | Delete
[1085] Fix | Delete
/**
[1086] Fix | Delete
* Prints the JavaScript in the embed iframe header.
[1087] Fix | Delete
*
[1088] Fix | Delete
* @since 4.4.0
[1089] Fix | Delete
*/
[1090] Fix | Delete
function print_embed_scripts() {
[1091] Fix | Delete
wp_print_inline_script_tag(
[1092] Fix | Delete
file_get_contents( ABSPATH . WPINC . '/js/wp-embed-template' . wp_scripts_get_suffix() . '.js' )
[1093] Fix | Delete
);
[1094] Fix | Delete
}
[1095] Fix | Delete
[1096] Fix | Delete
/**
[1097] Fix | Delete
* Prepare the oembed HTML to be displayed in an RSS feed.
[1098] Fix | Delete
*
[1099] Fix | Delete
* @since 4.4.0
[1100] Fix | Delete
* @access private
[1101] Fix | Delete
*
[1102] Fix | Delete
* @param string $content The content to filter.
[1103] Fix | Delete
* @return string The filtered content.
[1104] Fix | Delete
*/
[1105] Fix | Delete
function _oembed_filter_feed_content( $content ) {
[1106] Fix | Delete
$p = new WP_HTML_Tag_Processor( $content );
[1107] Fix | Delete
while ( $p->next_tag( array( 'tag_name' => 'iframe' ) ) ) {
[1108] Fix | Delete
if ( $p->has_class( 'wp-embedded-content' ) ) {
[1109] Fix | Delete
$p->remove_attribute( 'style' );
[1110] Fix | Delete
}
[1111] Fix | Delete
}
[1112] Fix | Delete
return $p->get_updated_html();
[1113] Fix | Delete
}
[1114] Fix | Delete
[1115] Fix | Delete
/**
[1116] Fix | Delete
* Prints the necessary markup for the embed comments button.
[1117] Fix | Delete
*
[1118] Fix | Delete
* @since 4.4.0
[1119] Fix | Delete
*/
[1120] Fix | Delete
function print_embed_comments_button() {
[1121] Fix | Delete
if ( is_404() || ! ( get_comments_number() || comments_open() ) ) {
[1122] Fix | Delete
return;
[1123] Fix | Delete
}
[1124] Fix | Delete
?>
[1125] Fix | Delete
<div class="wp-embed-comments">
[1126] Fix | Delete
<a href="<?php comments_link(); ?>" target="_top">
[1127] Fix | Delete
<span class="dashicons dashicons-admin-comments"></span>
[1128] Fix | Delete
<?php
[1129] Fix | Delete
printf(
[1130] Fix | Delete
/* translators: %s: Number of comments. */
[1131] Fix | Delete
_n(
[1132] Fix | Delete
'%s <span class="screen-reader-text">Comment</span>',
[1133] Fix | Delete
'%s <span class="screen-reader-text">Comments</span>',
[1134] Fix | Delete
get_comments_number()
[1135] Fix | Delete
),
[1136] Fix | Delete
number_format_i18n( get_comments_number() )
[1137] Fix | Delete
);
[1138] Fix | Delete
?>
[1139] Fix | Delete
</a>
[1140] Fix | Delete
</div>
[1141] Fix | Delete
<?php
[1142] Fix | Delete
}
[1143] Fix | Delete
[1144] Fix | Delete
/**
[1145] Fix | Delete
* Prints the necessary markup for the embed sharing button.
[1146] Fix | Delete
*
[1147] Fix | Delete
* @since 4.4.0
[1148] Fix | Delete
*/
[1149] Fix | Delete
function print_embed_sharing_button() {
[1150] Fix | Delete
if ( is_404() ) {
[1151] Fix | Delete
return;
[1152] Fix | Delete
}
[1153] Fix | Delete
?>
[1154] Fix | Delete
<div class="wp-embed-share">
[1155] Fix | Delete
<button type="button" class="wp-embed-share-dialog-open" aria-label="<?php esc_attr_e( 'Open sharing dialog' ); ?>">
[1156] Fix | Delete
<span class="dashicons dashicons-share"></span>
[1157] Fix | Delete
</button>
[1158] Fix | Delete
</div>
[1159] Fix | Delete
<?php
[1160] Fix | Delete
}
[1161] Fix | Delete
[1162] Fix | Delete
/**
[1163] Fix | Delete
* Prints the necessary markup for the embed sharing dialog.
[1164] Fix | Delete
*
[1165] Fix | Delete
* @since 4.4.0
[1166] Fix | Delete
*/
[1167] Fix | Delete
function print_embed_sharing_dialog() {
[1168] Fix | Delete
if ( is_404() ) {
[1169] Fix | Delete
return;
[1170] Fix | Delete
}
[1171] Fix | Delete
[1172] Fix | Delete
$unique_suffix = get_the_ID() . '-' . wp_rand();
[1173] Fix | Delete
$share_tab_wordpress_id = 'wp-embed-share-tab-wordpress-' . $unique_suffix;
[1174] Fix | Delete
$share_tab_html_id = 'wp-embed-share-tab-html-' . $unique_suffix;
[1175] Fix | Delete
$description_wordpress_id = 'wp-embed-share-description-wordpress-' . $unique_suffix;
[1176] Fix | Delete
$description_html_id = 'wp-embed-share-description-html-' . $unique_suffix;
[1177] Fix | Delete
?>
[1178] Fix | Delete
<div class="wp-embed-share-dialog hidden" role="dialog" aria-label="<?php esc_attr_e( 'Sharing options' ); ?>">
[1179] Fix | Delete
<div class="wp-embed-share-dialog-content">
[1180] Fix | Delete
<div class="wp-embed-share-dialog-text">
[1181] Fix | Delete
<ul class="wp-embed-share-tabs" role="tablist">
[1182] Fix | Delete
<li class="wp-embed-share-tab-button wp-embed-share-tab-button-wordpress" role="presentation">
[1183] Fix | Delete
<button type="button" role="tab" aria-controls="<?php echo $share_tab_wordpress_id; ?>" aria-selected="true" tabindex="0"><?php esc_html_e( 'WordPress Embed' ); ?></button>
[1184] Fix | Delete
</li>
[1185] Fix | Delete
<li class="wp-embed-share-tab-button wp-embed-share-tab-button-html" role="presentation">
[1186] Fix | Delete
<button type="button" role="tab" aria-controls="<?php echo $share_tab_html_id; ?>" aria-selected="false" tabindex="-1"><?php esc_html_e( 'HTML Embed' ); ?></button>
[1187] Fix | Delete
</li>
[1188] Fix | Delete
</ul>
[1189] Fix | Delete
<div id="<?php echo $share_tab_wordpress_id; ?>" class="wp-embed-share-tab" role="tabpanel" aria-hidden="false">
[1190] Fix | Delete
<input type="text" value="<?php the_permalink(); ?>" class="wp-embed-share-input" aria-label="<?php esc_attr_e( 'URL' ); ?>" aria-describedby="<?php echo $description_wordpress_id; ?>" tabindex="0" readonly/>
[1191] Fix | Delete
[1192] Fix | Delete
<p class="wp-embed-share-description" id="<?php echo $description_wordpress_id; ?>">
[1193] Fix | Delete
<?php _e( 'Copy and paste this URL into your WordPress site to embed' ); ?>
[1194] Fix | Delete
</p>
[1195] Fix | Delete
</div>
[1196] Fix | Delete
<div id="<?php echo $share_tab_html_id; ?>" class="wp-embed-share-tab" role="tabpanel" aria-hidden="true">
[1197] Fix | Delete
<textarea class="wp-embed-share-input" aria-label="<?php esc_attr_e( 'HTML' ); ?>" aria-describedby="<?php echo $description_html_id; ?>" tabindex="0" readonly><?php echo esc_textarea( get_post_embed_html( 600, 400 ) ); ?></textarea>
[1198] Fix | Delete
[1199] Fix | Delete
<p class="wp-embed-share-description" id="<?php echo $description_html_id; ?>">
[1200] Fix | Delete
<?php _e( 'Copy and paste this code into your site to embed' ); ?>
[1201] Fix | Delete
</p>
[1202] Fix | Delete
</div>
[1203] Fix | Delete
</div>
[1204] Fix | Delete
[1205] Fix | Delete
<button type="button" class="wp-embed-share-dialog-close" aria-label="<?php esc_attr_e( 'Close sharing dialog' ); ?>">
[1206] Fix | Delete
<span class="dashicons dashicons-no"></span>
[1207] Fix | Delete
</button>
[1208] Fix | Delete
</div>
[1209] Fix | Delete
</div>
[1210] Fix | Delete
<?php
[1211] Fix | Delete
}
[1212] Fix | Delete
[1213] Fix | Delete
/**
[1214] Fix | Delete
* Prints the necessary markup for the site title in an embed template.
[1215] Fix | Delete
*
[1216] Fix | Delete
* @since 4.5.0
[1217] Fix | Delete
*/
[1218] Fix | Delete
function the_embed_site_title() {
[1219] Fix | Delete
$site_title = sprintf(
[1220] Fix | Delete
'<a href="%s" target="_top"><img src="%s" srcset="%s 2x" width="32" height="32" alt="" class="wp-embed-site-icon" /><span>%s</span></a>',
[1221] Fix | Delete
esc_url( home_url() ),
[1222] Fix | Delete
esc_url( get_site_icon_url( 32, includes_url( 'images/w-logo-blue.png' ) ) ),
[1223] Fix | Delete
esc_url( get_site_icon_url( 64, includes_url( 'images/w-logo-blue.png' ) ) ),
[1224] Fix | Delete
esc_html( get_bloginfo( 'name' ) )
[1225] Fix | Delete
);
[1226] Fix | Delete
[1227] Fix | Delete
$site_title = '<div class="wp-embed-site-title">' . $site_title . '</div>';
[1228] Fix | Delete
[1229] Fix | Delete
/**
[1230] Fix | Delete
* Filters the site title HTML in the embed footer.
[1231] Fix | Delete
*
[1232] Fix | Delete
* @since 4.4.0
[1233] Fix | Delete
*
[1234] Fix | Delete
* @param string $site_title The site title HTML.
[1235] Fix | Delete
*/
[1236] Fix | Delete
echo apply_filters( 'embed_site_title_html', $site_title );
[1237] Fix | Delete
}
[1238] Fix | Delete
[1239] Fix | Delete
/**
[1240] Fix | Delete
* Filters the oEmbed result before any HTTP requests are made.
[1241] Fix | Delete
*
[1242] Fix | Delete
* If the URL belongs to the current site, the result is fetched directly instead of
[1243] Fix | Delete
* going through the oEmbed discovery process.
[1244] Fix | Delete
*
[1245] Fix | Delete
* @since 4.5.3
[1246] Fix | Delete
*
[1247] Fix | Delete
* @param null|string $result The UNSANITIZED (and potentially unsafe) HTML that should be used to embed. Default null.
[1248] Fix | Delete
* @param string $url The URL that should be inspected for discovery `<link>` tags.
[1249] Fix | Delete
* @param array $args oEmbed remote get arguments.
[1250] Fix | Delete
* @return null|string The UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
[1251] Fix | Delete
* Null if the URL does not belong to the current site.
[1252] Fix | Delete
*/
[1253] Fix | Delete
function wp_filter_pre_oembed_result( $result, $url, $args ) {
[1254] Fix | Delete
$data = get_oembed_response_data_for_url( $url, $args );
[1255] Fix | Delete
[1256] Fix | Delete
if ( $data ) {
[1257] Fix | Delete
return _wp_oembed_get_object()->data2html( $data, $url );
[1258] Fix | Delete
}
[1259] Fix | Delete
[1260] Fix | Delete
return $result;
[1261] Fix | Delete
}
[1262] Fix | Delete
[1263] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function