Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/jetpack/modules/shortcod...
File: scribd.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Scribd Shortcode
[2] Fix | Delete
*
[3] Fix | Delete
* [scribd id=DOCUMENT_ID key=DOCUMENT_KEY mode=MODE]
[4] Fix | Delete
* DOCUMENT_ID is an integer (also used as an object_id)
[5] Fix | Delete
* DOCUMENT_KEY is an alphanumeric hash ('-' character as well)
[6] Fix | Delete
* MODE can be 'list', 'book', 'slide', 'slideshow', or 'tile'
[7] Fix | Delete
*
[8] Fix | Delete
* [scribd id=39027960 key=key-3kaiwcjqhtipf25m8tw mode=list]
[9] Fix | Delete
*
[10] Fix | Delete
* @package automattic/jetpack
[11] Fix | Delete
*/
[12] Fix | Delete
[13] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[14] Fix | Delete
exit( 0 );
[15] Fix | Delete
}
[16] Fix | Delete
[17] Fix | Delete
/**
[18] Fix | Delete
* Register Scribd shortcode.
[19] Fix | Delete
*
[20] Fix | Delete
* @param array $atts Shortcode attributes.
[21] Fix | Delete
*/
[22] Fix | Delete
function scribd_shortcode_handler( $atts ) {
[23] Fix | Delete
$atts = shortcode_atts(
[24] Fix | Delete
array(
[25] Fix | Delete
'id' => 0,
[26] Fix | Delete
'key' => 0,
[27] Fix | Delete
'mode' => '',
[28] Fix | Delete
),
[29] Fix | Delete
$atts,
[30] Fix | Delete
'scribd'
[31] Fix | Delete
);
[32] Fix | Delete
[33] Fix | Delete
$modes = array( 'list', 'book', 'slide', 'slideshow', 'tile' );
[34] Fix | Delete
[35] Fix | Delete
$atts['id'] = (int) $atts['id'];
[36] Fix | Delete
if ( preg_match( '/^[A-Za-z0-9-]+$/', $atts['key'], $m ) ) {
[37] Fix | Delete
$atts['key'] = $m[0];
[38] Fix | Delete
[39] Fix | Delete
if ( ! in_array( $atts['mode'], $modes, true ) ) {
[40] Fix | Delete
$atts['mode'] = '';
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
return scribd_shortcode_markup( $atts );
[44] Fix | Delete
} else {
[45] Fix | Delete
return '';
[46] Fix | Delete
}
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
/**
[50] Fix | Delete
* Display the shortcode.
[51] Fix | Delete
*
[52] Fix | Delete
* @param array $atts Shortcode attributes.
[53] Fix | Delete
* @return string The rendered shortcode.
[54] Fix | Delete
*/
[55] Fix | Delete
function scribd_shortcode_markup( $atts ) {
[56] Fix | Delete
$sandbox = class_exists( 'Jetpack_AMP_Support' ) && Jetpack_AMP_Support::is_amp_request()
[57] Fix | Delete
? 'sandbox="allow-popups allow-scripts allow-same-origin"'
[58] Fix | Delete
: '';
[59] Fix | Delete
[60] Fix | Delete
$url = add_query_arg(
[61] Fix | Delete
array(
[62] Fix | Delete
'start_page' => '1',
[63] Fix | Delete
'view_mode' => esc_attr( $atts['mode'] ),
[64] Fix | Delete
'access_key' => esc_attr( $atts['key'] ),
[65] Fix | Delete
),
[66] Fix | Delete
esc_url(
[67] Fix | Delete
sprintf(
[68] Fix | Delete
'https://www.scribd.com/embeds/%1$d/content',
[69] Fix | Delete
absint( $atts['id'] )
[70] Fix | Delete
)
[71] Fix | Delete
)
[72] Fix | Delete
);
[73] Fix | Delete
[74] Fix | Delete
return sprintf(
[75] Fix | Delete
'<iframe class="scribd_iframe_embed" src="%1$s" %2$s data-auto-height="true" scrolling="no" id="scribd_%3$d" width="100%%" height="500" frameborder="0"></iframe>
[76] Fix | Delete
<div style="font-size:10px;text-align:center;width:100%%"><a href="https://www.scribd.com/doc/%3$d" rel="noopener noreferrer" target="_blank">%4$s</a></div>',
[77] Fix | Delete
$url,
[78] Fix | Delete
$sandbox,
[79] Fix | Delete
absint( $atts['id'] ),
[80] Fix | Delete
esc_html__( 'View this document on Scribd', 'jetpack' )
[81] Fix | Delete
);
[82] Fix | Delete
}
[83] Fix | Delete
add_shortcode( 'scribd', 'scribd_shortcode_handler' );
[84] Fix | Delete
[85] Fix | Delete
/**
[86] Fix | Delete
* Scribd supports HTTPS, so use that endpoint to get HTTPS-compatible embeds.
[87] Fix | Delete
*
[88] Fix | Delete
* @param array $providers Array of oEmbed providers.
[89] Fix | Delete
*/
[90] Fix | Delete
function scribd_https_oembed( $providers ) {
[91] Fix | Delete
if ( isset( $providers['#https?://(www\.)?scribd\.com/doc/.*#i'] ) ) {
[92] Fix | Delete
$providers['#https?://(www\.)?scribd\.com/doc/.*#i'][0] = 'https://www.scribd.com/services/oembed';
[93] Fix | Delete
}
[94] Fix | Delete
[95] Fix | Delete
return $providers;
[96] Fix | Delete
}
[97] Fix | Delete
add_filter( 'oembed_providers', 'scribd_https_oembed' );
[98] Fix | Delete
[99] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function