Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/accelera.../includes
File: thirdparty-compatibility.php
$output .= '<div class="saswp_faq_tiny_content">'.esc_html($value['answer']).'</div>';
[1500] Fix | Delete
$output .= '</div>';
[1501] Fix | Delete
$output .= '</details>';
[1502] Fix | Delete
}
[1503] Fix | Delete
}
[1504] Fix | Delete
}
[1505] Fix | Delete
return $output;
[1506] Fix | Delete
}
[1507] Fix | Delete
[1508] Fix | Delete
add_action('pre_amp_render_post', 'amp_3d_viewer_comp');
[1509] Fix | Delete
function amp_3d_viewer_comp(){
[1510] Fix | Delete
if ( function_exists('ampforwp_is_amp_endpoint') && ampforwp_is_amp_endpoint() ) {
[1511] Fix | Delete
remove_shortcode('3d_viewer', ['Shortcode', 'bp3dviewer_cpt_content_func']);
[1512] Fix | Delete
add_shortcode( '3d_viewer', 'amp_3dviewer_content_func' );
[1513] Fix | Delete
}
[1514] Fix | Delete
}
[1515] Fix | Delete
[1516] Fix | Delete
function amp_3dviewer_content_func( $atts ){
[1517] Fix | Delete
extract( shortcode_atts( array(
[1518] Fix | Delete
'id' => '',
[1519] Fix | Delete
'src' => '',
[1520] Fix | Delete
'alt' => '',
[1521] Fix | Delete
'width' => '100%',
[1522] Fix | Delete
'height' => '%',
[1523] Fix | Delete
'auto_rotate' => 'auto-rotate',
[1524] Fix | Delete
'camera_controls' =>'camera-controls',
[1525] Fix | Delete
'zooming_3d' => '',
[1526] Fix | Delete
'loading' => '',
[1527] Fix | Delete
), $atts ) ); ob_start();
[1528] Fix | Delete
[1529] Fix | Delete
// Options Data
[1530] Fix | Delete
$modeview_3d = false;
[1531] Fix | Delete
if($id){
[1532] Fix | Delete
$modeview_3d = get_post_meta( $id, '_bp3dimages_', true );
[1533] Fix | Delete
}else {
[1534] Fix | Delete
$id = uniqid();
[1535] Fix | Delete
}
[1536] Fix | Delete
[1537] Fix | Delete
$attribute = [];
[1538] Fix | Delete
[1539] Fix | Delete
if( class_exists( 'BP3D' ) && $modeview_3d && is_array($modeview_3d) ) {
[1540] Fix | Delete
//https://playground.amp.dev/static/samples/glTF/DamagedHelmet.glb
[1541] Fix | Delete
$src = BP3D\Helper\Utils::isset2($modeview_3d, 'bp_3d_src', 'url', 'i-do-not-exist.glb');
[1542] Fix | Delete
$src = str_replace('http', 'https', $src);
[1543] Fix | Delete
$width = BP3D\Helper\Utils::isset2($modeview_3d, 'bp_3d_width', 'width', '100').BP3D\Helper\Utils::isset2($modeview_3d, 'bp_3d_width', 'unit', '%');
[1544] Fix | Delete
$height = BP3D\Helper\Utils::isset2($modeview_3d, 'bp_3d_height', 'height', '300').BP3D\Helper\Utils::isset2($modeview_3d, 'bp_3d_height', 'unit', 'px');
[1545] Fix | Delete
$camera_controls = $modeview_3d['bp_camera_control'] == 1 ? 'camera-controls' : '';
[1546] Fix | Delete
$alt = !empty($modeview_3d['bp_3d_src']['url']) ? $modeview_3d['bp_3d_src']['title'] : '';
[1547] Fix | Delete
$auto_rotate = $modeview_3d['bp_3d_rotate'] === '1' ? 'auto-rotate' : '';
[1548] Fix | Delete
$zooming_3d = $modeview_3d['bp_3d_zooming'] === '1' ? '' : 'disable-zoom';
[1549] Fix | Delete
// Preload
[1550] Fix | Delete
$loading = isset ($modeview_3d['bp_3d_loading']) ? $modeview_3d['bp_3d_loading'] : '';
[1551] Fix | Delete
$attribute = apply_filters('bp3d_model_attribute', [], $id, false);
[1552] Fix | Delete
}
[1553] Fix | Delete
if( !empty($src) ){ ?>
[1554] Fix | Delete
<!-- 3D Model html -->
[1555] Fix | Delete
<div class="bp_grand wrapper_<?php echo esc_attr($id) ?>">
[1556] Fix | Delete
<div class="bp_model_parent">
[1557] Fix | Delete
<amp-3d-gltf class="model" id="bp_model_id_<?php echo esc_attr($id); ?>" src="<?php echo esc_url($src); ?>" alt="<?php echo esc_attr($alt); ?>" layout="fixed" width="320" height="240"></amp-3d-gltf>
[1558] Fix | Delete
</div>
[1559] Fix | Delete
</div>
[1560] Fix | Delete
<?php }
[1561] Fix | Delete
$output = ob_get_clean(); return $output;
[1562] Fix | Delete
}
[1563] Fix | Delete
[1564] Fix | Delete
//JetPack Boost
[1565] Fix | Delete
add_action('wp','ampforwp_jetpack_defer_js_comp');
[1566] Fix | Delete
function ampforwp_jetpack_defer_js_comp(){
[1567] Fix | Delete
if( (function_exists( 'ampforwp_is_amp_endpoint' ) && ampforwp_is_amp_endpoint()) || (function_exists( 'is_amp_endpoint' ) && is_amp_endpoint()) ){
[1568] Fix | Delete
add_filter( 'jetpack_boost_should_defer_js', '__return_false' );
[1569] Fix | Delete
}
[1570] Fix | Delete
}
[1571] Fix | Delete
[1572] Fix | Delete
add_filter('the_content','ampforwp_newsp_td_get_css', 12);
[1573] Fix | Delete
function ampforwp_newsp_td_get_css($content){
[1574] Fix | Delete
$the_ID = function_exists('ampforwp_get_the_ID') ? ampforwp_get_the_ID() : get_the_ID();
[1575] Fix | Delete
$tdc_status = get_post_meta( $the_ID, 'tdc_content', true);
[1576] Fix | Delete
if(!empty($tdc_status)){
[1577] Fix | Delete
global $amp_td_custom_css;
[1578] Fix | Delete
$amp_td_custom_css = '';
[1579] Fix | Delete
preg_match_all('/<style>(.*?)<\/style>/s', $content, $matches);
[1580] Fix | Delete
if($matches[1]){
[1581] Fix | Delete
foreach ($matches[1] as $key => $value) {
[1582] Fix | Delete
$amp_td_custom_css .= $value;
[1583] Fix | Delete
}
[1584] Fix | Delete
}
[1585] Fix | Delete
$content = preg_replace('/data-img-url="(.*?)"/', 'data-img-url="$1" style="background-image:url($1)"', $content);
[1586] Fix | Delete
}
[1587] Fix | Delete
return $content;
[1588] Fix | Delete
}
[1589] Fix | Delete
[1590] Fix | Delete
add_action('amp_post_template_css','ampforwp_newsp_td_render_css');
[1591] Fix | Delete
function ampforwp_newsp_td_render_css(){
[1592] Fix | Delete
$tdc_status = get_post_meta( ampforwp_get_the_ID(), 'tdc_content', true);
[1593] Fix | Delete
if(!empty($tdc_status)){
[1594] Fix | Delete
global $amp_td_custom_css;
[1595] Fix | Delete
$cssData = $newspaper_css = '';
[1596] Fix | Delete
$newspaper_css_url[] = get_template_directory_uri().'/style.css';
[1597] Fix | Delete
$newspaper_css_url[] = TDC_URL_LEGACY . '/assets/css/td_legacy_main.css';
[1598] Fix | Delete
if($newspaper_css_url){
[1599] Fix | Delete
foreach ($newspaper_css_url as $key => $urlValue) {
[1600] Fix | Delete
$cssData = ampforwp_get_remote_content($urlValue);
[1601] Fix | Delete
$cssData = preg_replace("/\/\*(.*?)\*\//si", "", $cssData);
[1602] Fix | Delete
$newspaper_css = preg_replace_callback('/url[(](.*?)[)]/', function($matches)use($urlValue){
[1603] Fix | Delete
$matches[1] = str_replace(array('"', "'"), array('', ''), $matches[1]);
[1604] Fix | Delete
if(!wp_http_validate_url($matches[1]) && strpos($matches[1],"data:")===false){
[1605] Fix | Delete
$urlExploded = explode("/", $urlValue);
[1606] Fix | Delete
$parentUrl = str_replace(end($urlExploded), "", $urlValue);
[1607] Fix | Delete
return 'url('.$parentUrl.$matches[1].")";
[1608] Fix | Delete
}else{
[1609] Fix | Delete
return $matches[0];
[1610] Fix | Delete
}
[1611] Fix | Delete
}, $cssData);
[1612] Fix | Delete
}
[1613] Fix | Delete
}
[1614] Fix | Delete
echo $newspaper_css;
[1615] Fix | Delete
echo $amp_td_custom_css;
[1616] Fix | Delete
if(method_exists('td_block', 'get_common_css') && method_exists('td_util', 'remove_style_tag')){
[1617] Fix | Delete
echo td_util::remove_style_tag(td_block::get_common_css());
[1618] Fix | Delete
}
[1619] Fix | Delete
}
[1620] Fix | Delete
}
[1621] Fix | Delete
[1622] Fix | Delete
/**
[1623] Fix | Delete
* Ampforwp_compatibility_filter_tags_for_wordproof_plugin function
[1624] Fix | Delete
*
[1625] Fix | Delete
* @since 1.0.86
[1626] Fix | Delete
* @param mixed|string $amp_post_template_data
[1627] Fix | Delete
* @return mixed|string
[1628] Fix | Delete
*/
[1629] Fix | Delete
function ampforwp_compatibility_filter_tags_for_wordproof_plugin( $amp_post_template_data )
[1630] Fix | Delete
{
[1631] Fix | Delete
global $wpdb,$post;
[1632] Fix | Delete
if(is_single() && isset($post->ID) && !empty($post->ID)){
[1633] Fix | Delete
[1634] Fix | Delete
[1635] Fix | Delete
$results = $wpdb->get_results(
[1636] Fix | Delete
$wpdb->prepare(
[1637] Fix | Delete
"SELECT meta_value FROM {$wpdb->prefix}postmeta WHERE post_id = %d AND meta_key LIKE %s",array( $post->ID,'_wordproof_hash_input_%' )),
[1638] Fix | Delete
ARRAY_N
[1639] Fix | Delete
);
[1640] Fix | Delete
if($results)
[1641] Fix | Delete
{
[1642] Fix | Delete
$schema_data = reset($results);
[1643] Fix | Delete
if(isset($schema_data[0])){
[1644] Fix | Delete
$schema_data = unserialize($schema_data[0]);
[1645] Fix | Delete
}
[1646] Fix | Delete
if(empty($schema_data)) { return $amp_post_template_data; }
[1647] Fix | Delete
$content = $amp_post_template_data['post_amp_content'];
[1648] Fix | Delete
// for w-certificate-button
[1649] Fix | Delete
if( false !== strpos($content, "<w-certificate-button") ) {
[1650] Fix | Delete
add_action( 'amp_post_template_css', 'amp_wordproof_compatibility_css' );
[1651] Fix | Delete
$findRegExforTag = '~<(w-certificate-button)(.*) text="(.*)"?>(.*)<\/\1>~mi';
[1652] Fix | Delete
$content = preg_replace( $findRegExforTag, "<button on='tap:w-certificate-button'>$3</button>", $content);
[1653] Fix | Delete
}
[1654] Fix | Delete
[1655] Fix | Delete
$lightbox_content = '<amp-lightbox id="w-certificate-button" layout="nodisplay" scrollable>';
[1656] Fix | Delete
$lightbox_content.='<div class="amp_wordproof_lightbox" role="button" tabindex="0" on="tap:w-certificate-button.close">';
[1657] Fix | Delete
$lightbox_content.='<svg xmlns="http://www.w3.org/2000/svg" class="shield"><use xlink:href="#shield"></use><symbol id="shield" viewBox="0 0 44 58"><path d="M21.799.018c1.463-.176 3.371 1.017 4.736 1.475 4.102 1.375 8.177 2.9 12.235 4.405 1.344.5 4.237.945 4.939 2.296.513.989.191 2.694.191 3.783v8.875c0 8.06.633 16.427-3.742 23.623-1.15 1.889-2.563 3.55-4.151 5.088-1.867 1.807-4.078 3.306-6.315 4.621a81.965 81.965 0 01-5.13 2.788c-.766.38-1.626.968-2.5 1.025-.857.055-1.763-.595-2.5-.96-2.019-1.002-4.003-2.057-5.92-3.24-2.533-1.565-4.924-3.364-6.961-5.537C-.563 40.532.091 30.113.091 20.33v-8.353c0-1.066-.301-2.682.192-3.654.77-1.517 3.831-2.007 5.334-2.525 3.657-1.26 7.287-2.627 10.92-3.96 1.643-.602 3.516-1.61 5.262-1.82m0 3.817c-1.708.222-3.526 1.221-5.131 1.822-2.834 1.06-5.737 1.947-8.552 3.057-.936.37-3.805.823-4.262 1.752-.37.754-.08 2.244-.08 3.077v7.309c0 8.573-.77 17.4 5.19 24.406 1.563 1.837 3.498 3.303 5.467 4.68 1.675 1.17 3.484 2.1 5.263 3.095.63.352 1.62 1.068 2.368 1.021.745-.047 1.602-.686 2.236-1.04 1.46-.817 2.917-1.598 4.342-2.48a30.632 30.632 0 005.915-4.754c6.455-6.7 5.662-15.868 5.662-24.406v-7.7c0-.864.306-2.428-.08-3.208-.424-.86-3.243-1.385-4.13-1.71-3.282-1.204-6.588-2.346-9.867-3.559-1.192-.441-3.056-1.53-4.341-1.362m-1.053 32.417h-.132l-6.183-6.134c-.48-.476-2.081-1.63-2.078-2.35.004-.827 1.785-2.058 2.341-2.61 1.521 1.098 2.898 2.683 4.188 4.042.408.43 1.209 1.572 1.864 1.564.814-.01 2.082-1.798 2.631-2.342l6.447-6.395c.518-.515 1.588-2.044 2.368-2.064.793-.02 2.65 2.02 2.187 2.716-1.094 1.638-3.023 3.048-4.424 4.438z" fill="currentColor"></path></symbol></svg>';
[1658] Fix | Delete
if(isset($schema_data->dateCreated)){
[1659] Fix | Delete
$datetime = new DateTime($schema_data->dateCreated);
[1660] Fix | Delete
$lightbox_content.= '<h5>Last edited '.esc_attr($datetime->format('F j, Y at h:i A')) .' </h5>';
[1661] Fix | Delete
}
[1662] Fix | Delete
$lightbox_content.= '<h4>This information did not change since the last timestamp</h4><p>This is important, because it proves that the content has not been tampered with and it can be trusted.<p>';
[1663] Fix | Delete
$lightbox_content.= '</div></amp-lightbox>';
[1664] Fix | Delete
[1665] Fix | Delete
// for w-certificate
[1666] Fix | Delete
if( false !== strpos($content, "<w-certificate") ) {
[1667] Fix | Delete
$findRegExforTag = '~<(w-certificate)(.*)?>(.*)<\/\1>~mi';
[1668] Fix | Delete
$content = preg_replace( $findRegExforTag, $lightbox_content, $content);
[1669] Fix | Delete
}
[1670] Fix | Delete
[1671] Fix | Delete
$amp_post_template_data['post_amp_content'] = $content;
[1672] Fix | Delete
}
[1673] Fix | Delete
[1674] Fix | Delete
}
[1675] Fix | Delete
[1676] Fix | Delete
[1677] Fix | Delete
return $amp_post_template_data;
[1678] Fix | Delete
}
[1679] Fix | Delete
[1680] Fix | Delete
function amp_wordproof_compatibility_css(){
[1681] Fix | Delete
echo '.amp_wordproof_lightbox{background:rgba(0,0,0,.8);width:100%;height:100%;position:absolute;display:flex;flex-wrap:wrap;color:#fff;justify-content:center;align-content:center;align-items:center}.amp_wordproof_lightbox h4,.amp_wordproof_lightbox h5,.amp_wordproof_lightbox p{padding:0 10px}';
[1682] Fix | Delete
}
[1683] Fix | Delete
/**
[1684] Fix | Delete
* ampforwp_compatibility_for_opensea_plugin function
[1685] Fix | Delete
*
[1686] Fix | Delete
* @since 1.0.86
[1687] Fix | Delete
* @param mixed|string $amp_post_template_data
[1688] Fix | Delete
* @return mixed|string
[1689] Fix | Delete
*/
[1690] Fix | Delete
function ampforwp_compatibility_for_opensea_plugin( $amp_post_template_data )
[1691] Fix | Delete
{
[1692] Fix | Delete
$content = $amp_post_template_data['post_amp_content'];
[1693] Fix | Delete
if( false !== strpos($content, "<nft-card") ) {
[1694] Fix | Delete
add_action( 'amp_post_template_css', 'ampforwp_opensea_compatibility_css' );
[1695] Fix | Delete
[1696] Fix | Delete
$findRegExforTag = '~<(nft-card) tokenaddress="(.*)" tokenid="(.*)">?>(.*)<\/\1>~mi';
[1697] Fix | Delete
$content = preg_replace_callback($findRegExforTag, 'ampforwp_compatibility_for_opensea_callback', $content);
[1698] Fix | Delete
}
[1699] Fix | Delete
$amp_post_template_data['post_amp_content'] = $content;
[1700] Fix | Delete
return $amp_post_template_data;
[1701] Fix | Delete
}
[1702] Fix | Delete
[1703] Fix | Delete
function ampforwp_opensea_compatibility_css(){
[1704] Fix | Delete
echo '.ampforwp_opensea_card .asset-detail-type a {border: 1px solid;border-radius: 20px;display: flex;flex-direction: row;align-items: center;}.ampforwp_opensea_card .asset-detail-type img {width:25px;border-radius:50%;padding:5px;}.ampforwp_opensea_card{background-color:#fff;font-family:Roboto,sans-serif;-webkit-font-smoothing:antialiased;font-style:normal;font-weight:400;line-height:normal;border-radius:5px;perspective:1000px;margin:auto;width:80vw;height:210px;min-height:200px;max-width:670px}.ampforwp_opensea_card .card-inner{position:relative;width:100%;height:100%;text-align:center;transition:transform .6s;transform-style:preserve-3d;box-shadow:0 1px 6px rgba(0,0,0,.25);border-radius:5px}.ampforwp_opensea_card a{text-decoration:none;color:inherit}.ampforwp_opensea_card .card-front{backface-visibility:hidden;background:#fff;border-radius:5px;display:grid;grid-template-columns:1fr 2fr;position:relative;width:100%;height:100%;transform:translateY(0);overflow:hidden}.ampforwp_opensea_card .card-front p{margin:0;padding:0 10px;}.ampforwp_opensea_card .asset-image-container{border-right:1px solid #e2e6ef;background-size:cover;box-sizing:border-box}.ampforwp_opensea_card .asset-image{background-size:contain;background-position:50%;background-repeat:no-repeat;height:100%;box-sizing:border-box}.ampforwp_opensea_card .asset-details-container{display:grid;grid-template-rows:auto;grid-template-columns:1fr 1fr;padding:20px;align-items:center}.ampforwp_opensea_card .asset-detail{display:flex}.ampforwp_opensea_card .asset-detail .asset-detail-type{height:35px;font-size:12px;margin-right:10px}.ampforwp_opensea_card .asset-detail .asset-detail-badge{width:54px;height:30px;font-size:12px}.ampforwp_opensea_card .asset-detail-name{font-weight:400;text-align:left}.ampforwp_opensea_card .asset-detail-price{align-items:flex-end;font-size:18px;font-weight:400;display:flex;flex-flow:row;justify-content:flex-end;line-height:15px;text-align:right;padding:6px 0}.ampforwp_opensea_card .asset-detail-price img{margin:0 4px}.ampforwp_opensea_card .asset-detail-price-current img{width:15px}.ampforwp_opensea_card .asset-detail-price-previous{font-size:14px;color:#828282;line-height:10px}.ampforwp_opensea_card .asset-detail-price-previous img{width:1ex}.ampforwp_opensea_card .asset-detail-price .value{margin-left:5px}.ampforwp_opensea_card .asset-detail-price .previous-value{font-size:14px;color:#828282}.ampforwp_opensea_card .asset-action-buy{grid-column-start:1;grid-column-end:3}.ampforwp_opensea_card .asset-action-buy button{width:100%;background:#3291e9;border-radius:5px;height:35px;color:#fff;font-weight:700;letter-spacing:.5px;cursor:pointer;transition:.2s;outline:0;border-style:none;text-transform:uppercase}.ampforwp_opensea_card .asset-action-buy button:hover{background:#153d62}.ampforwp_opensea_card .asset-link{text-decoration:none;}';
[1705] Fix | Delete
}
[1706] Fix | Delete
[1707] Fix | Delete
function ampforwp_compatibility_for_opensea_callback($matches){
[1708] Fix | Delete
$default_return="";
[1709] Fix | Delete
if(isset($matches[2]) && !empty($matches[2]) && isset($matches[3]) && !empty($matches[3])){
[1710] Fix | Delete
[1711] Fix | Delete
$response = wp_remote_get( 'https://api.opensea.io/api/v1/asset/'.$matches[2].'/'.$matches[3].'/?',
[1712] Fix | Delete
array('headers'=>array('X-API-KEY'=>'e4e7b08f1807492e91301de85728ce2e',
[1713] Fix | Delete
'accept' => 'application/json'
[1714] Fix | Delete
)) );
[1715] Fix | Delete
if ( is_array( $response ) && ! is_wp_error( $response ) ) {
[1716] Fix | Delete
[1717] Fix | Delete
$body = $response['body']; // use the content
[1718] Fix | Delete
$nft_data = json_decode($body,true);
[1719] Fix | Delete
[1720] Fix | Delete
if(isset($nft_data['token_id']) && isset($nft_data['image_url']) && isset($nft_data['name']) && isset($nft_data['permalink']) && isset($nft_data['asset_contract']['name']) && isset($nft_data['asset_contract']['image_url']) && isset($nft_data['collection']['slug'])){
[1721] Fix | Delete
$nft_card_html="
[1722] Fix | Delete
<div class='ampforwp_opensea_card'>
[1723] Fix | Delete
<div class='card-inner'>
[1724] Fix | Delete
<div class='card-front'>
[1725] Fix | Delete
<div class='asset-image-container'>
[1726] Fix | Delete
<a target='_blank' href='".esc_url($nft_data['permalink'])."'>
[1727] Fix | Delete
<div class='asset-image' style='background-image: url(&quot;".esc_url($nft_data['image_url'])."&quot;); background-size: contain;'></div>
[1728] Fix | Delete
</a>
[1729] Fix | Delete
</div>
[1730] Fix | Delete
<div class='asset-details-container'>
[1731] Fix | Delete
<div class='asset-detail'>
[1732] Fix | Delete
<div class='asset-detail-type'>
[1733] Fix | Delete
<a class='asset-link' target='_blank' href='https://opensea.io/assets/".esc_url($nft_data['collection']['slug'])."'>
[1734] Fix | Delete
<img alt='' src='".esc_url($nft_data['asset_contract']['image_url'])."'>
[1735] Fix | Delete
<p>".esc_attr($nft_data['asset_contract']['name'])."</p>
[1736] Fix | Delete
</a>
[1737] Fix | Delete
</div>
[1738] Fix | Delete
</div>
[1739] Fix | Delete
<div class='spacer'></div>
[1740] Fix | Delete
<div class='asset-detail-name'>
[1741] Fix | Delete
<a class='asset-link' target='_blank' href='".esc_url($nft_data['permalink'])."'>".esc_attr($nft_data['name'])."</a>
[1742] Fix | Delete
</div>
[1743] Fix | Delete
[1744] Fix | Delete
<a class='asset-link' target='_blank' href='".esc_url($nft_data['permalink'])."'>
[1745] Fix | Delete
<div class='asset-detail-price asset-detail-price-previous'>
[1746] Fix | Delete
<div class='previous-value'>Prev.&nbsp;</div>
[1747] Fix | Delete
<img alt='' src='https://openseauserdata.com/files/6f8e2979d428180222796ff4a33ab929.svg'>
[1748] Fix | Delete
<div class='asset-detail-price-value'>
[1749] Fix | Delete
";
[1750] Fix | Delete
if(isset($nft_data['last_sale']['total_price'])){
[1751] Fix | Delete
$price_to_show=round($nft_data['last_sale']['total_price']/1000000000000000000,3);
[1752] Fix | Delete
$nft_card_html.= esc_attr($price_to_show);
[1753] Fix | Delete
}
[1754] Fix | Delete
$nft_card_html.="</div>
[1755] Fix | Delete
</div>
[1756] Fix | Delete
</a>
[1757] Fix | Delete
<div class='asset-action-buy'>
[1758] Fix | Delete
<button>
[1759] Fix | Delete
<a class='asset-link' target='_blank' href='".esc_url($nft_data['permalink'])."'> buy this item > </a>
[1760] Fix | Delete
</button>
[1761] Fix | Delete
</div>
[1762] Fix | Delete
</div>
[1763] Fix | Delete
</div>
[1764] Fix | Delete
</div>
[1765] Fix | Delete
</div>";
[1766] Fix | Delete
return $nft_card_html;
[1767] Fix | Delete
}
[1768] Fix | Delete
}
[1769] Fix | Delete
[1770] Fix | Delete
}
[1771] Fix | Delete
if(isset($response['response']['code']) && $response['response']['message'] ){
[1772] Fix | Delete
$default_return = '<center><small> Opensea Error - '.esc_attr($response['response']['code']).' : '.esc_attr($response['response']['message']).'</small></center>' ;
[1773] Fix | Delete
}
[1774] Fix | Delete
return $default_return;
[1775] Fix | Delete
}
[1776] Fix | Delete
/**
[1777] Fix | Delete
* ampforwp_add_target_attribute_in_form_tags function
[1778] Fix | Delete
*
[1779] Fix | Delete
* @since 1.0.86
[1780] Fix | Delete
* @param mixed|string $amp_post_template_data
[1781] Fix | Delete
* @return mixed|string
[1782] Fix | Delete
*/
[1783] Fix | Delete
function ampforwp_add_target_attribute_in_form_tags( $amp_post_template_data )
[1784] Fix | Delete
{
[1785] Fix | Delete
$content = $amp_post_template_data['post_amp_content'];
[1786] Fix | Delete
$pattern = '~<form(?![^>]*\btarget=)[^<]*>~im';
[1787] Fix | Delete
[1788] Fix | Delete
if( preg_match_all( $pattern, $content, $matches ) )
[1789] Fix | Delete
{
[1790] Fix | Delete
if( 0 < count( $matches[0] ) )
[1791] Fix | Delete
{
[1792] Fix | Delete
$matchesUnique = array_unique( $matches[0] );
[1793] Fix | Delete
foreach( $matchesUnique as $match )
[1794] Fix | Delete
{
[1795] Fix | Delete
$matchStr = trim( str_replace( '>', '', $match ) );
[1796] Fix | Delete
$content = str_replace( $matchStr, $matchStr . ' target="_top"', $content );
[1797] Fix | Delete
}
[1798] Fix | Delete
}
[1799] Fix | Delete
}
[1800] Fix | Delete
[1801] Fix | Delete
$amp_post_template_data['post_amp_content'] = $content;
[1802] Fix | Delete
[1803] Fix | Delete
return $amp_post_template_data;
[1804] Fix | Delete
}
[1805] Fix | Delete
[1806] Fix | Delete
[1807] Fix | Delete
add_filter('the_content','ampforwp_heista_pro_frontpage_section');
[1808] Fix | Delete
function ampforwp_heista_pro_frontpage_section($content){
[1809] Fix | Delete
global $redux_builder_amp;
[1810] Fix | Delete
$ampforwp_frontpage = $redux_builder_amp['amp-frontpage-select-option-pages']?intval($redux_builder_amp['amp-frontpage-select-option-pages']):0;
[1811] Fix | Delete
if ( (is_home() || is_page($ampforwp_frontpage)) && function_exists('hestia_run')) {
[1812] Fix | Delete
if ( $redux_builder_amp['amp-frontpage-select-option'] == 1 && class_exists('Hestia_Defaults_Models')) {
[1813] Fix | Delete
$slider_default = Hestia_Defaults_Models::instance()->get_slider_default();
[1814] Fix | Delete
$slider_content = get_theme_mod( 'hestia_slider_content',wp_json_encode($slider_default));
[1815] Fix | Delete
$slider_content = json_decode( $slider_content );
[1816] Fix | Delete
if ( !empty( $slider_content ) ) {
[1817] Fix | Delete
$amp_html='<div class="ampforwp-carousel-cont" >
[1818] Fix | Delete
<amp-carousel width="500" height="300" layout="responsive" type="slides" aria-label="Hestia Header carousel">';
[1819] Fix | Delete
foreach ( $slider_content as $slider_item ) {
[1820] Fix | Delete
$title = ! empty( $slider_item->title ) ? apply_filters( 'hestia_translate_single_string', $slider_item->title, 'Slider section' ) : '';
[1821] Fix | Delete
$subtitle = ! empty( $slider_item->subtitle ) ? apply_filters( 'hestia_translate_single_string', $slider_item->subtitle, 'Slider section' ) : '';
[1822] Fix | Delete
$button = ! empty( $slider_item->text ) ? apply_filters( 'hestia_translate_single_string', $slider_item->text, 'Slider section' ) : '';
[1823] Fix | Delete
$link = ! empty( $slider_item->link ) ? apply_filters( 'hestia_translate_single_string', $slider_item->link, 'Slider section' ) : '';
[1824] Fix | Delete
$button2 = ! empty( $slider_item->text2 ) ? apply_filters( 'hestia_translate_single_string', $slider_item->text2, 'Slider section' ) : '';
[1825] Fix | Delete
$link2 = ! empty( $slider_item->link2 ) ? apply_filters( 'hestia_translate_single_string', $slider_item->link2, 'Slider section' ) : '';
[1826] Fix | Delete
$slider_type = get_theme_mod( 'hestia_slider_type', apply_filters( 'hestia_slider_type_default', 'image' ) );
[1827] Fix | Delete
$image_url_bg = ! empty( $slider_item->image_url ) && $slider_type=='image' ? apply_filters( 'hestia_translate_single_string', $slider_item->image_url, 'Slider section' ) : '';
[1828] Fix | Delete
$amp_html.='<div class="ampforwp-carousel-wrapper">';
[1829] Fix | Delete
if($image_url_bg){
[1830] Fix | Delete
$amp_html.='<div class="ampforwp-carousel-img-wrapper" ><amp-img src="'.esc_url($image_url_bg).'" width="1200" height="800" layout="fill"></amp-img></div>';
[1831] Fix | Delete
}
[1832] Fix | Delete
$amp_html.='<div class="ampforwp-carousel-content">';
[1833] Fix | Delete
if($title){
[1834] Fix | Delete
$amp_html.= '<h1>'.esc_attr( $title ).'</h1>';
[1835] Fix | Delete
}
[1836] Fix | Delete
if($subtitle){
[1837] Fix | Delete
$amp_html.= '<p>'.esc_attr( $subtitle ).'</p>';
[1838] Fix | Delete
}
[1839] Fix | Delete
if($button && $link){
[1840] Fix | Delete
$amp_html.= '<a href="'.esc_url($link).'" title="'.esc_attr( $button ).'"><button>'.esc_attr( $button ).'</button></a>';
[1841] Fix | Delete
}
[1842] Fix | Delete
if($button2 && $link2){
[1843] Fix | Delete
$amp_html.= '<a href="'.esc_url($link2).'" title="'.esc_attr( $button2 ).'"><button>'.esc_attr( $button2 ).'</button></a>';
[1844] Fix | Delete
}
[1845] Fix | Delete
$amp_html.='</div>
[1846] Fix | Delete
</div>';
[1847] Fix | Delete
}
[1848] Fix | Delete
$amp_html.='</amp-carousel></div>';
[1849] Fix | Delete
[1850] Fix | Delete
}
[1851] Fix | Delete
$content = $amp_html.$content;
[1852] Fix | Delete
[1853] Fix | Delete
}
[1854] Fix | Delete
}
[1855] Fix | Delete
return $content;
[1856] Fix | Delete
}
[1857] Fix | Delete
add_action('amp_post_template_css','ampforwp_heista_pro_frontpage_section_css');
[1858] Fix | Delete
function ampforwp_heista_pro_frontpage_section_css(){
[1859] Fix | Delete
global $redux_builder_amp;
[1860] Fix | Delete
$ampforwp_frontpage = $redux_builder_amp['amp-frontpage-select-option-pages']?intval($redux_builder_amp['amp-frontpage-select-option-pages']):0;
[1861] Fix | Delete
if ( (is_home() || is_page($ampforwp_frontpage)) && function_exists('hestia_run')) {
[1862] Fix | Delete
echo '.ampforwp-carousel-cont amp-carousel{height:400px} .ampforwp-carousel-wrapper{position:relative;width:100%;} .ampforwp-carousel-img-wrapper img{filter: brightness(50%);} .ampforwp-carousel-content h1 , .ampforwp-carousel-content p{width:90%;padding: 0px 10px;border-radius:8px} .ampforwp-carousel-content{position:absolute;top:0;bottom:0;right:0;left:0;text-align:center;display: flex;flex-direction: column;align-items: center;justify-content: center;color:#fff;}';
[1863] Fix | Delete
}
[1864] Fix | Delete
}
[1865] Fix | Delete
[1866] Fix | Delete
/*
[1867] Fix | Delete
* To fix validation error attribute a may not appear in a tag
[1868] Fix | Delete
* Issue is due to WPBakery Page Builder plugin which is adding a attribute in anchor tag
[1869] Fix | Delete
*/
[1870] Fix | Delete
add_filter( 'vc_gitem_post_data_get_link_real_link','ampforwp_fix_a_attr_in_anchor_tag',99,1);
[1871] Fix | Delete
function ampforwp_fix_a_attr_in_anchor_tag($target_link){
[1872] Fix | Delete
if ( function_exists('ampforwp_is_amp_endpoint') && ampforwp_is_amp_endpoint() ) {
[1873] Fix | Delete
if(preg_match('/a (.*?)/', $target_link)){
[1874] Fix | Delete
$target_link = preg_replace('/a (.*?)/', '$1', $target_link);
[1875] Fix | Delete
}
[1876] Fix | Delete
}
[1877] Fix | Delete
return $target_link;
[1878] Fix | Delete
}
[1879] Fix | Delete
[1880] Fix | Delete
//ftc theme compatibility
[1881] Fix | Delete
add_action( 'admin_init', 'ampforwp_fTC_theme_remove_scripts');
[1882] Fix | Delete
function ampforwp_fTC_theme_remove_scripts() {
[1883] Fix | Delete
if ( isset ( $_GET['page'] ) && $_GET['page'] == 'amp_options' ) {
[1884] Fix | Delete
remove_action('admin_enqueue_scripts', 'ftc_register_admin_scripts');
[1885] Fix | Delete
}
[1886] Fix | Delete
}
[1887] Fix | Delete
[1888] Fix | Delete
//Remove Poll maker to solve validation error
[1889] Fix | Delete
add_action('wp','ampforwp_poll_maker_remove_html');
[1890] Fix | Delete
function ampforwp_poll_maker_remove_html(){
[1891] Fix | Delete
if((function_exists('ampforwp_is_amp_endpoint') && ampforwp_is_amp_endpoint()) || (function_exists('is_amp_endpoint') && is_amp_endpoint())){
[1892] Fix | Delete
$plugin_name = 'poll-maker-ays';
[1893] Fix | Delete
if (defined('POLL_MAKER_AYS_VERSION')) {
[1894] Fix | Delete
$version = POLL_MAKER_AYS_VERSION;
[1895] Fix | Delete
} else {
[1896] Fix | Delete
$version = '1.0.0';
[1897] Fix | Delete
}
[1898] Fix | Delete
if(class_exists('Poll_Maker_Ays_Public')){
[1899] Fix | Delete
$new = new Poll_Maker_Ays_Public($plugin_name, $version);
[1900] Fix | Delete
remove_shortcode('ays_poll', array($new, 'ays_poll_generate_shortcode'));
[1901] Fix | Delete
add_shortcode('ays_poll', 'ampforwp_ays_poll_remove_shortcode');
[1902] Fix | Delete
}
[1903] Fix | Delete
}
[1904] Fix | Delete
}
[1905] Fix | Delete
[1906] Fix | Delete
function ampforwp_ays_poll_remove_shortcode($atts){
[1907] Fix | Delete
return;
[1908] Fix | Delete
}
[1909] Fix | Delete
[1910] Fix | Delete
/*
[1911] Fix | Delete
* Adding compatiblity for Amazon Auto Links Plugin
[1912] Fix | Delete
* since 1.0.96
[1913] Fix | Delete
*/
[1914] Fix | Delete
add_filter('the_content','ampforwp_aal_content_fix', 9);
[1915] Fix | Delete
function ampforwp_aal_content_fix($content){
[1916] Fix | Delete
if(is_amp_endpoint() && class_exists('AmazonAutoLinks_Registry_Base')){
[1917] Fix | Delete
$auto_insert ='';
[1918] Fix | Delete
// get all post ids with post_type aal_auto_insert and are published. Only need to fetch ids not the whole post
[1919] Fix | Delete
[1920] Fix | Delete
$posts = get_posts(array(
[1921] Fix | Delete
'post_type' => 'aal_auto_insert',
[1922] Fix | Delete
'post_status' => 'publish',
[1923] Fix | Delete
'fields' => 'ids',
[1924] Fix | Delete
'posts_per_page' => -1
[1925] Fix | Delete
));
[1926] Fix | Delete
[1927] Fix | Delete
// if there are no posts then return the content as it is
[1928] Fix | Delete
if(empty($posts)){
[1929] Fix | Delete
return $content;
[1930] Fix | Delete
}
[1931] Fix | Delete
$position = 'below';
[1932] Fix | Delete
foreach($posts as $post){
[1933] Fix | Delete
$unit_ids = get_post_meta( $post, 'unit_ids', true );
[1934] Fix | Delete
$status = get_post_meta( $post, 'status', true );
[1935] Fix | Delete
$position = get_post_meta( $post, 'position', true );
[1936] Fix | Delete
$enable_post_ids = get_post_meta( $post, 'enable_post_ids', true );
[1937] Fix | Delete
$enable_page_types = get_post_meta( $post, 'enable_page_types', true );
[1938] Fix | Delete
$enable_post_types = get_post_meta( $post, 'enable_post_types', true );
[1939] Fix | Delete
$diable_post_ids = get_post_meta( $post, 'diable_post_ids', true );
[1940] Fix | Delete
$disable_page_types = get_post_meta( $post, 'disable_page_types', true );
[1941] Fix | Delete
$disable_post_types = get_post_meta( $post, 'disable_post_types', true );
[1942] Fix | Delete
$pages_types = ['is_singular'=>is_singular(),'is_home'=>is_home(),'is_archive'=>is_archive(),'is_404'=>is_404(),'is_search'=>is_search()];
[1943] Fix | Delete
$get_current_post_type = get_post_type();
[1944] Fix | Delete
$get_current_post_id = get_the_ID();
[1945] Fix | Delete
$enable_post_types_values = array_filter(array_unique(array_values($enable_post_types)));
[1946] Fix | Delete
$disable_post_types_values = array_filter(array_unique(array_values($disable_post_types)));
[1947] Fix | Delete
$enable_pages_types_values = array_filter(array_unique(array_values($enable_page_types)));
[1948] Fix | Delete
$disable_pages_types_values = array_filter(array_unique(array_values($disable_page_types)));
[1949] Fix | Delete
$diable_post_ids = array_filter(explode(',',$diable_post_ids));
[1950] Fix | Delete
$enable_post_ids = array_filter(explode(',',$enable_post_ids));
[1951] Fix | Delete
[1952] Fix | Delete
if($status == '1' && (empty($enable_post_ids) || (!empty($enable_post_ids) &&in_array($get_current_post_id, $enable_post_ids))) && (!in_array('1', $enable_post_types_values) || (in_array('1', $enable_post_types_values) && isset($enable_post_types[$get_current_post_type]) && $enable_post_types[$get_current_post_type] == 1)) && !in_array($get_current_post_id, $diable_post_ids) && (!in_array('1', $disable_post_types) ||( in_array('1', $disable_post_types_values) && isset($disable_post_types[$get_current_post_type]) && $disable_post_types[$get_current_post_type] == 0)) && ((!in_array('1', $enable_pages_types_values) || (in_array('1', $enable_pages_types_values) && ampforwp_aal_check_pages_types($pages_types,$enable_page_types)) ))&& ((!in_array('1', $disable_pages_types_values) || (in_array('1', $disable_pages_types_values) && ampforwp_aal_check_pages_types($pages_types,$disable_page_types)) )))
[1953] Fix | Delete
{
[1954] Fix | Delete
$auto_insert .= apply_filters( 'aal_filter_output', '', array('id'=>implode(',',$unit_ids)));
[1955] Fix | Delete
}
[1956] Fix | Delete
[1957] Fix | Delete
}
[1958] Fix | Delete
[1959] Fix | Delete
if($position == 'above'){
[1960] Fix | Delete
$content = $auto_insert.$content;
[1961] Fix | Delete
}else if($position == 'both'){
[1962] Fix | Delete
$content = $auto_insert.$content.$auto_insert;
[1963] Fix | Delete
}else{
[1964] Fix | Delete
$content = $content.$auto_insert;
[1965] Fix | Delete
}
[1966] Fix | Delete
[1967] Fix | Delete
[1968] Fix | Delete
}
[1969] Fix | Delete
return $content;
[1970] Fix | Delete
}
[1971] Fix | Delete
[1972] Fix | Delete
function ampforwp_aal_check_pages_types($pages_types, $enabled_or_not) {
[1973] Fix | Delete
foreach ($pages_types as $key => $value) {
[1974] Fix | Delete
if ($value && $enabled_or_not[$key] == '1') {
[1975] Fix | Delete
return true;
[1976] Fix | Delete
}
[1977] Fix | Delete
}
[1978] Fix | Delete
return false;
[1979] Fix | Delete
}
[1980] Fix | Delete
[1981] Fix | Delete
add_action('amp_post_template_css','ampforwp_aal_css');
[1982] Fix | Delete
function ampforwp_aal_css(){
[1983] Fix | Delete
if (is_amp_endpoint() && class_exists('AmazonAutoLinks_Registry_Base')) {
[1984] Fix | Delete
echo '.amazon-products-container-list{overflow-y:auto;overflow-x:hidden;width:100%}.amazon-products-container-list *{-webkit-box-sizing:border-box;box-sizing:border-box}.amazon-products-container-list a{color:inherit;text-decoration:none}.amazon-products-container-list .amazon-product-container{width:100%;display:block;clear:both;margin-bottom:1.4em}.amazon-products-container-list .amazon-product-title{margin:.1em 0 1em}.amazon-products-container-list .amazon-product-thumbnail-container{width:100%}.amazon-products-container-list .amazon-product-thumbnail{display:table;margin:auto;text-align:center;padding:1em}.amazon-products-container-list .amazon-product-thumbnail a{display:inline-block;background-color:#fff;padding:.8em;border:none;border-radius:4%;-webkit-box-shadow:none;box-shadow:none}.amazon-products-container-list .amazon-product-thumbnail a:focus,.amazon-products-container-list .amazon-product-thumbnail a:hover{-webkit-box-shadow:none;box-shadow:none}.amazon-products-container-list .amazon-product-thumbnail img{max-width:100%;margin-left:auto;margin-right:auto}.amazon-products-container-list .amazon-auto-links-product-body{display:inline-block;width:65.8%}.amazon-products-container-list .crIFrameNumCustReviews{display:inline-block;vertical-align:top;height:auto}.amazon-products-container-list .crAvgStars{white-space:nowrap}.amazon-products-container-list span.crAvgStars a{font-size:inherit}.amazon-products-container-list .amazon-customer-rating-stars{display:inline-block;margin:0 .2em 0 0;vertical-align:middle;line-height:1.6;font-size:88%}.amazon-products-container-list .amazon-customer-rating-stars .review-stars{display:inline;vertical-align:text-bottom;margin-right:.44em;line-height:1}.amazon-products-container-list .amazon-customer-rating-stars .review-stars svg{top:-2px}.amazon-products-container-list .amazon-customer-rating-stars .review-count{margin-top:2px;margin-left:-2px;display:inline}.amazon-products-container-list .pricing-disclaimer a.amazon-disclaimer-tooltip{outline:0}.amazon-products-container-list .pricing-disclaimer a.amazon-disclaimer-tooltip>span.amazon-disclaimer-tooltip-content>.amazon-disclaimer-tooltip-content-text{z-index:999;display:none;padding:14px 20px;margin-top:-30px;margin-left:28px;width:300px;line-height:16px;border-radius:4px;-webkit-box-shadow:5px 5px 8px #ccc;box-shadow:5px 5px 8px #ccc}.amazon-products-container-list .pricing-disclaimer a.amazon-disclaimer-tooltip:hover{text-decoration:none}.amazon-products-container-list .pricing-disclaimer a.amazon-disclaimer-tooltip:hover>span.amazon-disclaimer-tooltip-content{display:inline;position:relative}.amazon-products-container-list .pricing-disclaimer a.amazon-disclaimer-tooltip:hover>span.amazon-disclaimer-tooltip-content>.amazon-disclaimer-tooltip-content-text{display:inline;float:right;position:absolute;color:#111;border:1px solid #dca;background:#fffaf0;margin-left:-100px;margin-top:-140px}.amazon-products-container-list .amazon-auto-links-product-image{vertical-align:top;display:inline-block;width:32%;margin-right:1%;font-size:80%}.amazon-products-container-list .amazon-prices{margin-right:.2em;line-height:1.6;font-size:88%;display:inline-block;vertical-align:middle}.amazon-products-container-list .amazon-prices .offered-price{display:inline}.amazon-products-container-list span.offered-price{color:#b12704;font-weight:700}@media only screen and (max-width:520px){.amazon-products-container-list .amazon-auto-links-product-image{width:100%;margin-bottom:1em}.amazon-products-container-list .amazon-auto-links-product-body{font-size:88%;width:100%}}.amazon-product-thumbnail .amp-wp-enforced-sizes {width:100px;height:100px;}';
[1985] Fix | Delete
}
[1986] Fix | Delete
}
[1987] Fix | Delete
[1988] Fix | Delete
add_filter('amp_post_template_data','ampforwp_aal_compatibility');
[1989] Fix | Delete
[1990] Fix | Delete
function ampforwp_aal_compatibility( $amp_post_template_data )
[1991] Fix | Delete
{
[1992] Fix | Delete
if (is_amp_endpoint() && class_exists('AmazonAutoLinks_Registry_Base')) {
[1993] Fix | Delete
$content = $amp_post_template_data['post_amp_content'];
[1994] Fix | Delete
if (strpos($content, '<div class="amazon-customer-rating-stars">') !== false) {
[1995] Fix | Delete
// Perform the replacement within <span class="review-stars">
[1996] Fix | Delete
$content = preg_replace('/(<span class="review-stars">.*?<a [^>]*>).*?<svg[^>]*><title>([^<]*)<\/title>.*?<\/svg>(.*?<\/a>.*?<\/span>)/s', '$1$2$3', $content);
[1997] Fix | Delete
$amp_post_template_data['post_amp_content'] = $content;
[1998] Fix | Delete
}
[1999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function