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
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/accelera.../pagebuil.../modules
File: contents-module.php
<?php
[0] Fix | Delete
// Exit if accessed directly.
[1] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) exit;
[2] Fix | Delete
require_once ABSPATH . WPINC . '/category.php';
[3] Fix | Delete
add_filter('ampforwp_content_module_args','ampforwp_content_module_pagination',10,2);
[4] Fix | Delete
function ampforwp_content_module_pagination($args, $fieldValues){
[5] Fix | Delete
if(isset($fieldValues['pagination']) && $fieldValues['pagination'] == 1 ){
[6] Fix | Delete
if( isset($_GET['pageno']) && $_GET['pageno']!=''){
[7] Fix | Delete
$paged = intval($_GET['pageno']);
[8] Fix | Delete
}else{
[9] Fix | Delete
$paged = 1;
[10] Fix | Delete
}
[11] Fix | Delete
$offset = ( $paged - 1 ) * $args['posts_per_page'] + $args['offset'];
[12] Fix | Delete
$args['paged'] = $paged;
[13] Fix | Delete
$args['offset'] = $offset;
[14] Fix | Delete
[15] Fix | Delete
return $args;
[16] Fix | Delete
}else{
[17] Fix | Delete
[18] Fix | Delete
return $args;
[19] Fix | Delete
}
[20] Fix | Delete
}
[21] Fix | Delete
$output = '{{if_condition_content_layout_type==1}}
[22] Fix | Delete
<div {{if_id}}id="{{id}}"{{ifend_id}} class="pb_mod cm {{user_class}}">
[23] Fix | Delete
{{if_content_title}}<h4>{{content_title}}</h4> {{ifend_content_title}}
[24] Fix | Delete
<div id="cat-jump{{id}}" class="wrap"><ul>{{category_selection}}</ul></div>
[25] Fix | Delete
{{pagination_links}}
[26] Fix | Delete
</div>
[27] Fix | Delete
{{ifend_condition_content_layout_type_1}}
[28] Fix | Delete
';
[29] Fix | Delete
[30] Fix | Delete
[31] Fix | Delete
$frontCss = '
[32] Fix | Delete
{{if_condition_content_layout_type==1}}
[33] Fix | Delete
.wrap{width:100%;display:inline-block;margin-top:10px;}
[34] Fix | Delete
[35] Fix | Delete
{{module-class}} .cm ul{
[36] Fix | Delete
display:grid;
[37] Fix | Delete
width:100%;
[38] Fix | Delete
grid-template-columns:1fr 1fr 1fr;
[39] Fix | Delete
grid-gap:30px;
[40] Fix | Delete
}
[41] Fix | Delete
{{module-class}} .cm ul li {
[42] Fix | Delete
list-style-type: none;
[43] Fix | Delete
}
[44] Fix | Delete
{{module-class}} .cm .cml{
[45] Fix | Delete
line-height:0;
[46] Fix | Delete
}
[47] Fix | Delete
{{module-class}} .cm {margin:{{margin_css}};padding:{{padding_css}};}
[48] Fix | Delete
{{module-class}} .cm h4{border-bottom: 2px solid #eee;padding-bottom: 8px;margin-bottom: 5px;font-size:18px;color: #191919;font-weight: 600;}
[49] Fix | Delete
{{module-class}} .cm .cmr{display:flex;flex-direction: column;margin-top: 6px;}
[50] Fix | Delete
{{module-class}} .cm .cmr a{font-size: 16px;line-height: 1.3;font-weight: 500;color: #000;margin: 0px 0px 5px 0px;}
[51] Fix | Delete
{{module-class}} .cm .cmr p{color: #555;font-size: 13px;line-height: 20px;letter-spacing: 0.10px;margin-bottom:0;}
[52] Fix | Delete
{{module-class}} .cm .cml{width:100%;}
[53] Fix | Delete
{{module-class}} .cmp a {
[54] Fix | Delete
color: black;
[55] Fix | Delete
float: left;
[56] Fix | Delete
padding: 8px 16px;
[57] Fix | Delete
text-decoration: none;
[58] Fix | Delete
transition: background-color .3s;
[59] Fix | Delete
}
[60] Fix | Delete
{{module-class}} .cmp a.active {
[61] Fix | Delete
background-color: dodgerblue;
[62] Fix | Delete
color: white;
[63] Fix | Delete
}
[64] Fix | Delete
{{module-class}} .cmp a:hover:not(.active) {background-color: #ddd;}
[65] Fix | Delete
{{module-class}} .cmp{
[66] Fix | Delete
width: 100%;
[67] Fix | Delete
margin: 30px 0px 0px 0px;
[68] Fix | Delete
display: flex;
[69] Fix | Delete
flex-wrap: wrap;
[70] Fix | Delete
flex-direction: row;
[71] Fix | Delete
justify-content: center;
[72] Fix | Delete
}
[73] Fix | Delete
{{module-class}} .cm .cmr p a{
[74] Fix | Delete
font-size:13px;
[75] Fix | Delete
color:#005be2;
[76] Fix | Delete
}
[77] Fix | Delete
@media(max-width:768px){
[78] Fix | Delete
{{module-class}} .cm ul{
[79] Fix | Delete
grid-template-columns:1fr;
[80] Fix | Delete
grid-gap:20px;
[81] Fix | Delete
}
[82] Fix | Delete
{{module-class}} .cm ul li{
[83] Fix | Delete
display:flex;
[84] Fix | Delete
}
[85] Fix | Delete
{{module-class}} .cml amp-img{width:100%;}
[86] Fix | Delete
{{module-class}} .cm .cml{
[87] Fix | Delete
margin-right: 20px;
[88] Fix | Delete
}
[89] Fix | Delete
{{module-class}} .cm .cmr{
[90] Fix | Delete
flex: 1 0 55%;
[91] Fix | Delete
margin-top: 0;
[92] Fix | Delete
}
[93] Fix | Delete
}
[94] Fix | Delete
@media(max-width:767px){
[95] Fix | Delete
[96] Fix | Delete
{{module-class}} .cmp a{
[97] Fix | Delete
padding:5px 12px;
[98] Fix | Delete
font-size:16px;
[99] Fix | Delete
}
[100] Fix | Delete
}
[101] Fix | Delete
@media (max-width: 480px){
[102] Fix | Delete
{{module-class}} .cm ul li{
[103] Fix | Delete
display:inline-block;
[104] Fix | Delete
}
[105] Fix | Delete
{{module-class}} .cm .cml{
[106] Fix | Delete
margin:0px 0px 20px;
[107] Fix | Delete
}
[108] Fix | Delete
{{module-class}} .cm .cmr{
[109] Fix | Delete
flex: 1 0 100%;
[110] Fix | Delete
}
[111] Fix | Delete
[112] Fix | Delete
}
[113] Fix | Delete
{{ifend_condition_content_layout_type_1}}
[114] Fix | Delete
';
[115] Fix | Delete
if(ampforwp_get_setting('amp-design-selector') == 3 || ampforwp_get_setting('amp-design-selector') == 2){
[116] Fix | Delete
$frontCss .= '@media (max-width: 480px){
[117] Fix | Delete
{{module-class}} .cm ul{
[118] Fix | Delete
width:80%;
[119] Fix | Delete
}
[120] Fix | Delete
}';
[121] Fix | Delete
}
[122] Fix | Delete
$options = '<option value="recent_option">Recent Posts</option>';
[123] Fix | Delete
$post_types = '';
[124] Fix | Delete
$categoriesArray = array();
[125] Fix | Delete
if ( is_admin() ) {
[126] Fix | Delete
$post_types = get_post_types(array('public'=>true));
[127] Fix | Delete
$post_types = get_option('ampforwp_cpt_generated_post_types');
[128] Fix | Delete
$post_types['post'] = 'Post';
[129] Fix | Delete
$categories = get_categories( array(
[130] Fix | Delete
'orderby' => 'name',
[131] Fix | Delete
'order' => 'ASC',
[132] Fix | Delete
'number' => 500
[133] Fix | Delete
) );
[134] Fix | Delete
$categoriesArray = array('recent_option'=>'Recent Posts');
[135] Fix | Delete
foreach($categories as $category){
[136] Fix | Delete
$categoryName = htmlspecialchars(esc_html($category->name), ENT_QUOTES);
[137] Fix | Delete
$categoriesArray[$category->term_id] = $categoryName;
[138] Fix | Delete
$options.= '<option value="'.esc_attr($category->term_id).'">'.esc_html($categoryName).'</option>';
[139] Fix | Delete
}
[140] Fix | Delete
}
[141] Fix | Delete
return array(
[142] Fix | Delete
'label' =>'Category',
[143] Fix | Delete
'name' => 'contents',
[144] Fix | Delete
'default_tab'=> 'customizer',
[145] Fix | Delete
'tabs' => array(
[146] Fix | Delete
'customizer'=>'Content',
[147] Fix | Delete
'layout' => 'Layout',
[148] Fix | Delete
'container_css'=>'Design',
[149] Fix | Delete
'advanced' => 'Advanced'
[150] Fix | Delete
),
[151] Fix | Delete
'fields' => array(
[152] Fix | Delete
array(
[153] Fix | Delete
'type' =>'layout-image-picker',
[154] Fix | Delete
'name' =>"content_layout_type",
[155] Fix | Delete
'label' =>"Select Layout",
[156] Fix | Delete
'tab' =>'layout',
[157] Fix | Delete
'default' =>'1',
[158] Fix | Delete
'options_details'=>array(
[159] Fix | Delete
array(
[160] Fix | Delete
'value'=>'1',
[161] Fix | Delete
'label'=>'',
[162] Fix | Delete
'demo_image'=> AMPFORWP_PLUGIN_DIR_URI.'/images/cat-dg-1.png'
[163] Fix | Delete
),
[164] Fix | Delete
[165] Fix | Delete
),
[166] Fix | Delete
'content_type'=>'html',
[167] Fix | Delete
),
[168] Fix | Delete
array(
[169] Fix | Delete
'type' =>'text',
[170] Fix | Delete
'name' =>"content_title",
[171] Fix | Delete
'label' =>'Category Block',
[172] Fix | Delete
'tab' =>'customizer',
[173] Fix | Delete
'default' =>'Category',
[174] Fix | Delete
'content_type'=>'html',
[175] Fix | Delete
),
[176] Fix | Delete
array(
[177] Fix | Delete
'type' =>'text',
[178] Fix | Delete
'name' =>"id",
[179] Fix | Delete
'label' =>'ID',
[180] Fix | Delete
'tab' =>'advanced',
[181] Fix | Delete
'default' =>'',
[182] Fix | Delete
'content_type'=>'html'
[183] Fix | Delete
),
[184] Fix | Delete
array(
[185] Fix | Delete
'type' =>'text',
[186] Fix | Delete
'name' =>"user_class",
[187] Fix | Delete
'label' =>'Class',
[188] Fix | Delete
'tab' =>'advanced',
[189] Fix | Delete
'default' =>'',
[190] Fix | Delete
'content_type'=>'html'
[191] Fix | Delete
),
[192] Fix | Delete
array(
[193] Fix | Delete
'type' =>'spacing',
[194] Fix | Delete
'name' =>"margin_css",
[195] Fix | Delete
'label' =>'Margin',
[196] Fix | Delete
'tab' =>'advanced',
[197] Fix | Delete
'default' =>
[198] Fix | Delete
array(
[199] Fix | Delete
'top'=>'20px',
[200] Fix | Delete
'right'=>'0px',
[201] Fix | Delete
'bottom'=>'20px',
[202] Fix | Delete
'left'=>'0px',
[203] Fix | Delete
),
[204] Fix | Delete
'content_type'=>'css',
[205] Fix | Delete
),
[206] Fix | Delete
array(
[207] Fix | Delete
'type' =>'spacing',
[208] Fix | Delete
'name' =>"padding_css",
[209] Fix | Delete
'label' =>'Padding',
[210] Fix | Delete
'tab' =>'advanced',
[211] Fix | Delete
'default' =>array(
[212] Fix | Delete
'left'=>'0px',
[213] Fix | Delete
'right'=>'0px',
[214] Fix | Delete
'top'=>'0px',
[215] Fix | Delete
'bottom'=>'0px'
[216] Fix | Delete
),
[217] Fix | Delete
'content_type'=>'css',
[218] Fix | Delete
),
[219] Fix | Delete
array(
[220] Fix | Delete
'type' =>'text',
[221] Fix | Delete
'name' =>"ampforwp_pb_cat_pagination_next",
[222] Fix | Delete
'label' =>'Pagination For Next Label',
[223] Fix | Delete
'tab' =>'advanced',
[224] Fix | Delete
'default' =>'First',
[225] Fix | Delete
'content_type'=>'html',
[226] Fix | Delete
'required' => array('pagination'=>'1'),
[227] Fix | Delete
),
[228] Fix | Delete
array(
[229] Fix | Delete
'type' =>'text',
[230] Fix | Delete
'name' =>"ampforwp_pb_cat_pagination_last",
[231] Fix | Delete
'label' =>'Pagination For Last Label',
[232] Fix | Delete
'tab' =>'advanced',
[233] Fix | Delete
'default' =>'Last',
[234] Fix | Delete
'content_type'=>'html',
[235] Fix | Delete
'required' => array('pagination'=>'1'),
[236] Fix | Delete
),
[237] Fix | Delete
array(
[238] Fix | Delete
'type' =>'select',
[239] Fix | Delete
'name' =>"post_type_selection",
[240] Fix | Delete
'label' =>"Select Post Type",
[241] Fix | Delete
'tab' =>'customizer',
[242] Fix | Delete
'default' =>'post',
[243] Fix | Delete
'options' => $post_types,
[244] Fix | Delete
'options_details'=>$post_types ,
[245] Fix | Delete
'content_type'=>'html',
[246] Fix | Delete
'ajax' => true,
[247] Fix | Delete
'ajax_dep' => 'taxonomy_selection',
[248] Fix | Delete
'ajax_action' => 'ampforwp_pb_taxonomy'
[249] Fix | Delete
),
[250] Fix | Delete
array(
[251] Fix | Delete
'type' =>'select',
[252] Fix | Delete
'name' =>"taxonomy_selection",
[253] Fix | Delete
'label' => esc_html__("Select Taxonomy","accelerated-mobile-pages"),
[254] Fix | Delete
'tab' =>'customizer',
[255] Fix | Delete
'default' =>'',
[256] Fix | Delete
'options' => $options,
[257] Fix | Delete
'options_details'=>$categoriesArray ,
[258] Fix | Delete
'content_type'=>'html',
[259] Fix | Delete
'ajax' => true,
[260] Fix | Delete
'ajax_dep' => 'category_selection',
[261] Fix | Delete
'ajax_action' => 'ampforwp_pb_cats'
[262] Fix | Delete
),
[263] Fix | Delete
array(
[264] Fix | Delete
'type' =>'select',
[265] Fix | Delete
'name' =>"category_selection",
[266] Fix | Delete
'label' =>"Select Category",
[267] Fix | Delete
'tab' =>'customizer',
[268] Fix | Delete
'default' =>'recent_option',
[269] Fix | Delete
'options' => $options,
[270] Fix | Delete
'options_details'=>$categoriesArray ,
[271] Fix | Delete
'content_type'=>'html',
[272] Fix | Delete
),
[273] Fix | Delete
array(
[274] Fix | Delete
'type' =>'text',
[275] Fix | Delete
'name' =>"show_total_posts",
[276] Fix | Delete
'label' =>'No. of Posts per Page',
[277] Fix | Delete
'tab' =>'customizer',
[278] Fix | Delete
'default' =>'3',
[279] Fix | Delete
'content_type'=>'html',
[280] Fix | Delete
),
[281] Fix | Delete
array(
[282] Fix | Delete
'type' =>'text',
[283] Fix | Delete
'name' =>'posts_offset',
[284] Fix | Delete
'label' => esc_html__('Offset','accelerated-mobile-pages'),
[285] Fix | Delete
'tab' =>'customizer',
[286] Fix | Delete
'default' =>'0',
[287] Fix | Delete
'content_type'=>'html',
[288] Fix | Delete
),
[289] Fix | Delete
array(
[290] Fix | Delete
'type' =>'select',
[291] Fix | Delete
'name' =>"ampforwp_show_excerpt",
[292] Fix | Delete
'label' =>"Excerpt",
[293] Fix | Delete
'tab' =>'customizer',
[294] Fix | Delete
'default' =>'yes',
[295] Fix | Delete
'options' => '<option value="yes">Yes</option><option value="no">No</option>',
[296] Fix | Delete
'options_details'=>array('yes'=>'Yes', 'no'=>'No'),
[297] Fix | Delete
'content_type'=>'html',
[298] Fix | Delete
),
[299] Fix | Delete
array(
[300] Fix | Delete
'type' =>'text',
[301] Fix | Delete
'name' =>"ampforwp_excerpt_length",
[302] Fix | Delete
'label' =>"Excerpt Length",
[303] Fix | Delete
'tab' =>'customizer',
[304] Fix | Delete
'default' =>'15',
[305] Fix | Delete
'content_type'=>'html',
[306] Fix | Delete
'required' => array('ampforwp_show_excerpt' => 'yes'),
[307] Fix | Delete
),
[308] Fix | Delete
array(
[309] Fix | Delete
'type' =>'text',
[310] Fix | Delete
'name' =>"ampforwp_read_more",
[311] Fix | Delete
'label' =>esc_html__("Read More Text","accelerated-mobile-pages"),
[312] Fix | Delete
'tab' =>'customizer',
[313] Fix | Delete
'default' =>'Read More',
[314] Fix | Delete
'content_type'=>'html',
[315] Fix | Delete
'required' => array('ampforwp_show_excerpt' => 'yes'),
[316] Fix | Delete
),
[317] Fix | Delete
array(
[318] Fix | Delete
'type' =>'text',
[319] Fix | Delete
'name' =>"img-width-1",
[320] Fix | Delete
'label' =>'Image Width',
[321] Fix | Delete
'tab' =>'customizer',
[322] Fix | Delete
'default' =>'346',
[323] Fix | Delete
'content_type'=>'html',
[324] Fix | Delete
'required' => array('content_layout_type' => 1),
[325] Fix | Delete
),
[326] Fix | Delete
array(
[327] Fix | Delete
'type' =>'text',
[328] Fix | Delete
'name' =>"img-height-1",
[329] Fix | Delete
'label' =>'Image Height',
[330] Fix | Delete
'tab' =>'customizer',
[331] Fix | Delete
'default' =>'188',
[332] Fix | Delete
'content_type'=>'html',
[333] Fix | Delete
'required' => array('content_layout_type' => 1),
[334] Fix | Delete
),
[335] Fix | Delete
array(
[336] Fix | Delete
'type' =>'checkbox_bool',
[337] Fix | Delete
'name' =>"pagination",
[338] Fix | Delete
'tab' =>'customizer',
[339] Fix | Delete
'default' => 0,
[340] Fix | Delete
'options' =>array(
[341] Fix | Delete
array(
[342] Fix | Delete
'label'=>'Pagination',
[343] Fix | Delete
'value'=>1,
[344] Fix | Delete
),
[345] Fix | Delete
),
[346] Fix | Delete
'content_type'=>'html',
[347] Fix | Delete
),
[348] Fix | Delete
array(
[349] Fix | Delete
'type' =>'text',
[350] Fix | Delete
'name' =>"show_no_page_links",
[351] Fix | Delete
'label' =>'No. of PageLinks to Show',
[352] Fix | Delete
'tab' =>'customizer',
[353] Fix | Delete
'default' => 5,
[354] Fix | Delete
'content_type'=>'html',
[355] Fix | Delete
'required' => array('pagination' => 1),
[356] Fix | Delete
),
[357] Fix | Delete
[358] Fix | Delete
[359] Fix | Delete
),
[360] Fix | Delete
'front_template'=> $output,
[361] Fix | Delete
'front_css'=>$frontCss,
[362] Fix | Delete
'front_common_css'=>'',
[363] Fix | Delete
'front_loop_content'=>' {{if_condition_content_layout_type==1}}
[364] Fix | Delete
<li>
[365] Fix | Delete
[366] Fix | Delete
<div class="cml">
[367] Fix | Delete
<a href="{{ampforwp_post_url}}">
[368] Fix | Delete
{{if_image}}<amp-img class="ampforwp_wc_shortcode_img" src="{{image}}" width="{{width}}" height="{{height}}" srcset="{{image_srcset}}" layout="responsive" alt="{{image_alt}}"> </amp-img>{{ifend_image}}</a>
[369] Fix | Delete
</div>
[370] Fix | Delete
<div class="cmr">
[371] Fix | Delete
<a href="{{ampforwp_post_url}}">{{title}}</a>
[372] Fix | Delete
{{excerptContent}}
[373] Fix | Delete
{{loopdate}}
[374] Fix | Delete
</div>
[375] Fix | Delete
</li></a>
[376] Fix | Delete
{{ifend_condition_content_layout_type_1}}
[377] Fix | Delete
[378] Fix | Delete
[379] Fix | Delete
[380] Fix | Delete
',
[381] Fix | Delete
);
[382] Fix | Delete
function ampforwp_contentHtml($the_query,$fieldValues,$loopHtml){
[383] Fix | Delete
$contenthtml = '';
[384] Fix | Delete
$ampforwp_show_excerpt = (isset($fieldValues['ampforwp_show_excerpt'])? $fieldValues['ampforwp_show_excerpt']: 'yes');
[385] Fix | Delete
$ampforwp_excerpt_length = (isset($fieldValues['ampforwp_excerpt_length'])? $fieldValues['ampforwp_excerpt_length']: 15);
[386] Fix | Delete
$ampforwp_excerpt_length = (int) $ampforwp_excerpt_length;
[387] Fix | Delete
$mob_pres_link = false;
[388] Fix | Delete
if(function_exists('ampforwp_mobile_redirect_preseve_link')){
[389] Fix | Delete
$mob_pres_link = ampforwp_mobile_redirect_preseve_link();
[390] Fix | Delete
}
[391] Fix | Delete
if ( $the_query->have_posts() ) {
[392] Fix | Delete
while ( $the_query->have_posts() ) {
[393] Fix | Delete
$the_query->the_post();
[394] Fix | Delete
$ampforwp_post_url = get_permalink();
[395] Fix | Delete
if(ampforwp_get_setting('ampforwp-amp-takeover') == true || $mob_pres_link == true){
[396] Fix | Delete
$ampforwp_post_url = user_trailingslashit($ampforwp_post_url);
[397] Fix | Delete
}else if(true == ampforwp_get_setting('amp-core-end-point')){
[398] Fix | Delete
$ampforwp_post_url = user_trailingslashit($ampforwp_post_url);
[399] Fix | Delete
$ampforwp_post_url = add_query_arg( 'amp', '', $ampforwp_post_url);
[400] Fix | Delete
}else{
[401] Fix | Delete
$ampforwp_post_url = user_trailingslashit($ampforwp_post_url) . AMPFORWP_AMP_QUERY_VAR;
[402] Fix | Delete
$ampforwp_post_url = user_trailingslashit($ampforwp_post_url);
[403] Fix | Delete
}
[404] Fix | Delete
$image = $height = $width = $image_alt = $image_srcset = "";
[405] Fix | Delete
if ( has_post_thumbnail() ) {
[406] Fix | Delete
$thumb_id = get_post_thumbnail_id();
[407] Fix | Delete
$image_alt = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true);
[408] Fix | Delete
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'full', true);
[409] Fix | Delete
$image_srcset = wp_get_attachment_image_srcset( $thumb_id, 'full');
[410] Fix | Delete
$image = $thumb_url_array[0];
[411] Fix | Delete
$width = $thumb_url_array[1];
[412] Fix | Delete
$height = $thumb_url_array[2];
[413] Fix | Delete
}
[414] Fix | Delete
if(ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src()){
[415] Fix | Delete
$image = ampforwp_cf_featured_image_src();
[416] Fix | Delete
$width = ampforwp_cf_featured_image_src('width');
[417] Fix | Delete
$height = ampforwp_cf_featured_image_src('height');
[418] Fix | Delete
}
[419] Fix | Delete
if(!empty($image) && !empty($width) && !empty($height)){
[420] Fix | Delete
switch($fieldValues['content_layout_type']){
[421] Fix | Delete
case 1:
[422] Fix | Delete
$width = $fieldValues['img-width-1'];
[423] Fix | Delete
$height = $fieldValues['img-height-1'];
[424] Fix | Delete
break;
[425] Fix | Delete
case 2:
[426] Fix | Delete
$width = $fieldValues['img-width-2'];
[427] Fix | Delete
$height = $fieldValues['img-height-2'];
[428] Fix | Delete
break;
[429] Fix | Delete
case 3:
[430] Fix | Delete
$width = $fieldValues['img-width-3'];
[431] Fix | Delete
$height = $fieldValues['img-height-3'];
[432] Fix | Delete
break;
[433] Fix | Delete
case 4:
[434] Fix | Delete
$width = $fieldValues['img-width-4'];
[435] Fix | Delete
$height = $fieldValues['img-height-4'];
[436] Fix | Delete
break;
[437] Fix | Delete
case 5:
[438] Fix | Delete
$width = $fieldValues['img-width-5'];
[439] Fix | Delete
$height = $fieldValues['img-height-5'];
[440] Fix | Delete
break;
[441] Fix | Delete
default:
[442] Fix | Delete
break;
[443] Fix | Delete
}
[444] Fix | Delete
[445] Fix | Delete
$pb_content_width_height = apply_filters("ampforwp_pb_content_mod_set_height_width", $width, $height, $fieldValues);
[446] Fix | Delete
if(is_array($pb_content_width_height)){
[447] Fix | Delete
list($new_width, $new_height) = $pb_content_width_height;
[448] Fix | Delete
if ( !empty($new_width) && !empty($new_height) ) {
[449] Fix | Delete
$width = $new_width;
[450] Fix | Delete
$height = $new_height;
[451] Fix | Delete
}
[452] Fix | Delete
}
[453] Fix | Delete
if ( ampforwp_get_setting('ampforwp-retina-images') ) {
[454] Fix | Delete
$resolution = '';
[455] Fix | Delete
$resolution = 2;
[456] Fix | Delete
if(ampforwp_get_setting('ampforwp-retina-images-res')){
[457] Fix | Delete
$resolution = ampforwp_get_setting('ampforwp-retina-images-res');
[458] Fix | Delete
}
[459] Fix | Delete
$width = $width * $resolution;
[460] Fix | Delete
$height = $height * $resolution;
[461] Fix | Delete
}
[462] Fix | Delete
if(!is_numeric($width) && !is_numeric($height)){
[463] Fix | Delete
$width = '346';
[464] Fix | Delete
$height = '188';
[465] Fix | Delete
}
[466] Fix | Delete
}
[467] Fix | Delete
[468] Fix | Delete
$excerptContent = "";
[469] Fix | Delete
$read_more_link = "";
[470] Fix | Delete
$readMore = "";
[471] Fix | Delete
if( $ampforwp_show_excerpt == 'yes' ) {
[472] Fix | Delete
if( has_excerpt() ) {
[473] Fix | Delete
$content = get_the_excerpt();
[474] Fix | Delete
} else {
[475] Fix | Delete
$content = get_the_content();
[476] Fix | Delete
}
[477] Fix | Delete
if(isset($fieldValues['ampforwp_read_more']) && !empty($fieldValues['ampforwp_read_more']) ){
[478] Fix | Delete
$readMore = $fieldValues['ampforwp_read_more'];
[479] Fix | Delete
$read_more_link = '<a href="'.esc_url($ampforwp_post_url).'" > '.esc_html($readMore).'</a>';
[480] Fix | Delete
}
[481] Fix | Delete
$excerptContent = '<p>'.wp_trim_words( strip_tags( strip_shortcodes( $content ) ) , (int) $ampforwp_excerpt_length ).$read_more_link.'</p>';
[482] Fix | Delete
}
[483] Fix | Delete
$loopdate = "";
[484] Fix | Delete
$loopdate = human_time_diff(
[485] Fix | Delete
get_the_time('U', get_the_ID() ),
[486] Fix | Delete
current_time('timestamp') ) .' '. ampforwp_translation( ampforwp_get_setting('amp-translator-ago-date-text'),
[487] Fix | Delete
'ago');
[488] Fix | Delete
$loopdate = apply_filters('ampforwp_modify_post_date',$loopdate);
[489] Fix | Delete
$loopdate = '<p>'.esc_html($loopdate).'</p>';
[490] Fix | Delete
$title = get_the_title();
[491] Fix | Delete
$postid = get_the_ID();
[492] Fix | Delete
$author = get_the_author();
[493] Fix | Delete
$tags = get_the_tags();
[494] Fix | Delete
if(is_array($tags) && count($tags) > 0){
[495] Fix | Delete
$tags = $tags[0]->name;
[496] Fix | Delete
}
[497] Fix | Delete
// get_the_author_meta( string $field = '', int $user_id = false );
[498] Fix | Delete
$postdate = get_the_date( ' F j, Y', $postid );
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function