Edit File by line
/home/barbar84/www/wp-conte.../themes/Divi/includes/builder/module
File: Blog.php
: '';
[1000] Fix | Delete
[1001] Fix | Delete
printf(
[1002] Fix | Delete
'<p class="post-meta">%1$s %2$s %3$s %4$s %5$s %6$s %7$s</p>',
[1003] Fix | Delete
et_core_esc_previously( $author ),
[1004] Fix | Delete
et_core_intentionally_unescaped( $author_separator, 'fixed_string' ),
[1005] Fix | Delete
et_core_esc_previously( $date ),
[1006] Fix | Delete
et_core_intentionally_unescaped( $date_separator, 'fixed_string' ),
[1007] Fix | Delete
et_core_esc_wp( $categories ),
[1008] Fix | Delete
et_core_intentionally_unescaped( $categories_separator, 'fixed_string' ),
[1009] Fix | Delete
et_core_esc_previously( $comments )
[1010] Fix | Delete
);
[1011] Fix | Delete
}
[1012] Fix | Delete
[1013] Fix | Delete
$post_content = et_strip_shortcodes( et_delete_post_first_video( get_the_content() ), true );
[1014] Fix | Delete
[1015] Fix | Delete
// reset the fb processing flag
[1016] Fix | Delete
$et_fb_processing_shortcode_object = false;
[1017] Fix | Delete
// set the flag to indicate that we're processing internal content
[1018] Fix | Delete
$et_pb_rendering_column_content = true;
[1019] Fix | Delete
// reset all the attributes required to properly generate the internal styles
[1020] Fix | Delete
ET_Builder_Element::clean_internal_modules_styles();
[1021] Fix | Delete
[1022] Fix | Delete
echo '<div class="post-content">';
[1023] Fix | Delete
[1024] Fix | Delete
if ( 'on' === $args['show_content'] ) {
[1025] Fix | Delete
global $more;
[1026] Fix | Delete
[1027] Fix | Delete
// page builder doesn't support more tag, so display the_content() in case of post made with page builder
[1028] Fix | Delete
if ( et_pb_is_pagebuilder_used( get_the_ID() ) ) {
[1029] Fix | Delete
$more = 1; // phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited
[1030] Fix | Delete
[1031] Fix | Delete
echo et_core_intentionally_unescaped( apply_filters( 'the_content', $post_content ), 'html' );
[1032] Fix | Delete
[1033] Fix | Delete
} else {
[1034] Fix | Delete
$more = null; // phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited
[1035] Fix | Delete
echo et_core_intentionally_unescaped( apply_filters( 'the_content', et_delete_post_first_video( get_the_content( esc_html__( 'read more...', 'et_builder' ) ) ) ), 'html' );
[1036] Fix | Delete
}
[1037] Fix | Delete
} elseif ( 'on' === $args['show_excerpt'] ) {
[1038] Fix | Delete
if ( has_excerpt() && 'off' !== $args['use_manual_excerpt'] ) {
[1039] Fix | Delete
the_excerpt();
[1040] Fix | Delete
} else {
[1041] Fix | Delete
if ( '' !== $post_content ) {
[1042] Fix | Delete
// set the $et_fb_processing_shortcode_object to false, to retrieve the content inside truncate_post() correctly
[1043] Fix | Delete
$et_fb_processing_shortcode_object = false;
[1044] Fix | Delete
echo et_core_intentionally_unescaped( wpautop( et_delete_post_first_video( strip_shortcodes( truncate_post( $excerpt_length, false, '', true ) ) ) ), 'html' );
[1045] Fix | Delete
// reset the $et_fb_processing_shortcode_object to its original value
[1046] Fix | Delete
$et_fb_processing_shortcode_object = $global_processing_original_value;
[1047] Fix | Delete
} else {
[1048] Fix | Delete
echo '';
[1049] Fix | Delete
}
[1050] Fix | Delete
}
[1051] Fix | Delete
}
[1052] Fix | Delete
[1053] Fix | Delete
$et_fb_processing_shortcode_object = $global_processing_original_value;
[1054] Fix | Delete
// retrieve the styles for the modules inside Blog content
[1055] Fix | Delete
$internal_style = ET_Builder_Element::get_style( true );
[1056] Fix | Delete
// reset all the attributes after we retrieved styles
[1057] Fix | Delete
ET_Builder_Element::clean_internal_modules_styles( false );
[1058] Fix | Delete
$et_pb_rendering_column_content = false;
[1059] Fix | Delete
// append styles to the blog content
[1060] Fix | Delete
if ( $internal_style ) {
[1061] Fix | Delete
printf(
[1062] Fix | Delete
'<style type="text/css" class="et_fb_blog_inner_content_styles">
[1063] Fix | Delete
%1$s
[1064] Fix | Delete
</style>',
[1065] Fix | Delete
et_core_esc_previously( $internal_style )
[1066] Fix | Delete
);
[1067] Fix | Delete
}
[1068] Fix | Delete
[1069] Fix | Delete
if ( 'on' !== $args['show_content'] ) {
[1070] Fix | Delete
$more = 'on' === $args['show_more'] ? sprintf( ' <a href="%1$s" class="more-link" >%2$s</a>', esc_url( get_permalink() ), esc_html__( 'read more', 'et_builder' ) ) : ''; //phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited
[1071] Fix | Delete
echo et_core_esc_previously( $more );
[1072] Fix | Delete
}
[1073] Fix | Delete
[1074] Fix | Delete
echo '</div>';
[1075] Fix | Delete
?>
[1076] Fix | Delete
<?php } // 'off' === $fullwidth || ! in_array( $post_format, array( 'link', 'audio', 'quote', 'gallery' ?>
[1077] Fix | Delete
</article>
[1078] Fix | Delete
<?php
[1079] Fix | Delete
[1080] Fix | Delete
$et_fb_processing_shortcode_object = $global_processing_original_value;
[1081] Fix | Delete
ET_Post_Stack::pop();
[1082] Fix | Delete
} // endwhile
[1083] Fix | Delete
ET_Post_Stack::reset();
[1084] Fix | Delete
[1085] Fix | Delete
if ( 'on' !== $args['fullwidth'] ) {
[1086] Fix | Delete
echo '</div>';
[1087] Fix | Delete
}
[1088] Fix | Delete
[1089] Fix | Delete
if ( 'on' === $args['show_pagination'] ) {
[1090] Fix | Delete
// echo '</div> <!-- .et_pb_posts -->'; // @todo this causes closing tag issue
[1091] Fix | Delete
[1092] Fix | Delete
$container_is_closed = true;
[1093] Fix | Delete
[1094] Fix | Delete
if ( function_exists( 'wp_pagenavi' ) ) {
[1095] Fix | Delete
wp_pagenavi(
[1096] Fix | Delete
array(
[1097] Fix | Delete
'query' => $query,
[1098] Fix | Delete
)
[1099] Fix | Delete
);
[1100] Fix | Delete
} else {
[1101] Fix | Delete
if ( $et_is_builder_plugin_active ) {
[1102] Fix | Delete
include ET_BUILDER_PLUGIN_DIR . 'includes/navigation.php';
[1103] Fix | Delete
} else {
[1104] Fix | Delete
get_template_part( 'includes/navigation', 'index' );
[1105] Fix | Delete
}
[1106] Fix | Delete
}
[1107] Fix | Delete
}
[1108] Fix | Delete
}
[1109] Fix | Delete
[1110] Fix | Delete
unset( $wp_query->et_pb_blog_query );
[1111] Fix | Delete
[1112] Fix | Delete
// Reset $wp_query to its origin
[1113] Fix | Delete
$wp_query = $wp_query_page; // phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited
[1114] Fix | Delete
[1115] Fix | Delete
if ( ! $posts = ob_get_clean() ) {
[1116] Fix | Delete
$posts = self::get_no_results_template( et_core_esc_previously( $processed_header_level ) );
[1117] Fix | Delete
}
[1118] Fix | Delete
[1119] Fix | Delete
self::$rendering = false;
[1120] Fix | Delete
[1121] Fix | Delete
return $posts;
[1122] Fix | Delete
}
[1123] Fix | Delete
[1124] Fix | Delete
/**
[1125] Fix | Delete
* Render pagination element
[1126] Fix | Delete
*
[1127] Fix | Delete
* @since 3.27.1
[1128] Fix | Delete
*
[1129] Fix | Delete
* @param bool $echo Wether to print the output or return it.
[1130] Fix | Delete
*
[1131] Fix | Delete
* @return (void|string)
[1132] Fix | Delete
*/
[1133] Fix | Delete
function render_pagination( $echo = true ) {
[1134] Fix | Delete
if ( ! $echo ) {
[1135] Fix | Delete
ob_start();
[1136] Fix | Delete
}
[1137] Fix | Delete
[1138] Fix | Delete
add_filter( 'get_pagenum_link', array( 'ET_Builder_Module_Blog', 'filter_pagination_url' ) );
[1139] Fix | Delete
[1140] Fix | Delete
if ( function_exists( 'wp_pagenavi' ) ) {
[1141] Fix | Delete
wp_pagenavi();
[1142] Fix | Delete
} else {
[1143] Fix | Delete
if ( et_is_builder_plugin_active() ) {
[1144] Fix | Delete
include ET_BUILDER_PLUGIN_DIR . 'includes/navigation.php';
[1145] Fix | Delete
} else {
[1146] Fix | Delete
get_template_part( 'includes/navigation', 'index' );
[1147] Fix | Delete
}
[1148] Fix | Delete
}
[1149] Fix | Delete
[1150] Fix | Delete
remove_filter( 'get_pagenum_link', array( 'ET_Builder_Module_Blog', 'filter_pagination_url' ) );
[1151] Fix | Delete
[1152] Fix | Delete
if ( ! $echo ) {
[1153] Fix | Delete
$output = ob_get_contents();
[1154] Fix | Delete
ob_end_clean();
[1155] Fix | Delete
[1156] Fix | Delete
return $output;
[1157] Fix | Delete
}
[1158] Fix | Delete
}
[1159] Fix | Delete
[1160] Fix | Delete
/**
[1161] Fix | Delete
* Filter the pagination url to add a flag so it can be filtered to avoid pagination clashes with the main query.
[1162] Fix | Delete
*
[1163] Fix | Delete
* @since 4.0
[1164] Fix | Delete
*
[1165] Fix | Delete
* @param string $result
[1166] Fix | Delete
* @param integer $pagenum
[1167] Fix | Delete
*
[1168] Fix | Delete
* @return string
[1169] Fix | Delete
*/
[1170] Fix | Delete
public static function filter_pagination_url( $result ) {
[1171] Fix | Delete
return add_query_arg( 'et_blog', '', $result );
[1172] Fix | Delete
}
[1173] Fix | Delete
[1174] Fix | Delete
/**
[1175] Fix | Delete
* Renders the module output.
[1176] Fix | Delete
*
[1177] Fix | Delete
* @param array $attrs List of attributes.
[1178] Fix | Delete
* @param string $content Content being processed.
[1179] Fix | Delete
* @param string $render_slug Slug of module that is used for rendering output.
[1180] Fix | Delete
*
[1181] Fix | Delete
* @return string
[1182] Fix | Delete
*/
[1183] Fix | Delete
public function render( $attrs, $content, $render_slug ) {
[1184] Fix | Delete
global $post, $paged, $wp_query, $wp_the_query, $wp_filter, $__et_blog_module_paged;
[1185] Fix | Delete
[1186] Fix | Delete
if ( self::$rendering ) {
[1187] Fix | Delete
// We are trying to render a Blog module while a Blog module is already being rendered
[1188] Fix | Delete
// which means we have most probably hit an infinite recursion. While not necessarily
[1189] Fix | Delete
// the case, rendering a post which renders a Blog module which renders a post
[1190] Fix | Delete
// which renders a Blog module is not a sensible use-case.
[1191] Fix | Delete
return '';
[1192] Fix | Delete
}
[1193] Fix | Delete
[1194] Fix | Delete
// Keep a reference to the real main query to restore from later.
[1195] Fix | Delete
$main_query = $wp_the_query;
[1196] Fix | Delete
[1197] Fix | Delete
// Stored current global post as variable so global $post variable can be restored
[1198] Fix | Delete
// to its original state when et_pb_blog shortcode ends to avoid incorrect global $post
[1199] Fix | Delete
// being used on the page (i.e. blog + shop module in backend builder)
[1200] Fix | Delete
$post_cache = $post;
[1201] Fix | Delete
[1202] Fix | Delete
/**
[1203] Fix | Delete
* Cached $wp_filter so it can be restored at the end of the callback.
[1204] Fix | Delete
* This is needed because this callback uses the_content filter / calls a function
[1205] Fix | Delete
* which uses the_content filter. WordPress doesn't support nested filter
[1206] Fix | Delete
*/
[1207] Fix | Delete
$wp_filter_cache = $wp_filter;
[1208] Fix | Delete
[1209] Fix | Delete
// Helpers.
[1210] Fix | Delete
$sticky = et_pb_sticky_options();
[1211] Fix | Delete
[1212] Fix | Delete
$multi_view = et_pb_multi_view_options( $this );
[1213] Fix | Delete
$use_current_loop = isset( $this->props['use_current_loop'] ) ? $this->props['use_current_loop'] : 'off';
[1214] Fix | Delete
$post_type = isset( $this->props['post_type'] ) ? $this->props['post_type'] : 'post';
[1215] Fix | Delete
$fullwidth = $this->props['fullwidth'];
[1216] Fix | Delete
$posts_number = $this->props['posts_number'];
[1217] Fix | Delete
$include_categories = $this->props['include_categories'];
[1218] Fix | Delete
$meta_date = $this->props['meta_date'];
[1219] Fix | Delete
$show_thumbnail = $this->props['show_thumbnail'];
[1220] Fix | Delete
$show_content = $this->props['show_content'];
[1221] Fix | Delete
$show_author = $this->props['show_author'];
[1222] Fix | Delete
$show_date = $this->props['show_date'];
[1223] Fix | Delete
$show_categories = $this->props['show_categories'];
[1224] Fix | Delete
$show_comments = $this->props['show_comments'];
[1225] Fix | Delete
$show_excerpt = $this->props['show_excerpt'];
[1226] Fix | Delete
$use_manual_excerpt = $this->props['use_manual_excerpt'];
[1227] Fix | Delete
$excerpt_length = $this->props['excerpt_length'];
[1228] Fix | Delete
$show_pagination = $this->props['show_pagination'];
[1229] Fix | Delete
$show_more = $this->props['show_more'];
[1230] Fix | Delete
$offset_number = $this->props['offset_number'];
[1231] Fix | Delete
$use_overlay = $this->props['use_overlay'];
[1232] Fix | Delete
$header_level = $this->props['header_level'];
[1233] Fix | Delete
[1234] Fix | Delete
$background_layout = $this->props['background_layout'];
[1235] Fix | Delete
$background_layout_hover = et_pb_hover_options()->get_value( 'background_layout', $this->props, 'light' );
[1236] Fix | Delete
$background_layout_hover_enabled = et_pb_hover_options()->is_enabled( 'background_layout', $this->props );
[1237] Fix | Delete
$background_layout_values = et_pb_responsive_options()->get_property_values( $this->props, 'background_layout' );
[1238] Fix | Delete
$background_layout_tablet = isset( $background_layout_values['tablet'] ) ? $background_layout_values['tablet'] : '';
[1239] Fix | Delete
$background_layout_phone = isset( $background_layout_values['phone'] ) ? $background_layout_values['phone'] : '';
[1240] Fix | Delete
[1241] Fix | Delete
$hover_icon = $this->props['hover_icon'];
[1242] Fix | Delete
$hover_icon_values = et_pb_responsive_options()->get_property_values( $this->props, 'hover_icon' );
[1243] Fix | Delete
$hover_icon_tablet = isset( $hover_icon_values['tablet'] ) ? $hover_icon_values['tablet'] : '';
[1244] Fix | Delete
$hover_icon_phone = isset( $hover_icon_values['phone'] ) ? $hover_icon_values['phone'] : '';
[1245] Fix | Delete
$hover_icon_sticky = $sticky->get_value( 'hover_icon', $this->props );
[1246] Fix | Delete
[1247] Fix | Delete
$video_background = $this->video_background();
[1248] Fix | Delete
$parallax_image_background = $this->get_parallax_image_background();
[1249] Fix | Delete
[1250] Fix | Delete
$container_is_closed = false;
[1251] Fix | Delete
[1252] Fix | Delete
$processed_header_level = et_pb_process_header_level( $header_level, 'h2' );
[1253] Fix | Delete
[1254] Fix | Delete
// some themes do not include these styles/scripts so we need to enqueue them in this module to support audio post format
[1255] Fix | Delete
wp_enqueue_style( 'wp-mediaelement' );
[1256] Fix | Delete
wp_enqueue_script( 'wp-mediaelement' );
[1257] Fix | Delete
[1258] Fix | Delete
// include easyPieChart which is required for loading Blog module content via ajax correctly
[1259] Fix | Delete
wp_enqueue_script( 'easypiechart' );
[1260] Fix | Delete
[1261] Fix | Delete
// include ET Shortcode scripts
[1262] Fix | Delete
wp_enqueue_script( 'et-shortcodes-js' );
[1263] Fix | Delete
[1264] Fix | Delete
// remove all filters from WP audio shortcode to make sure current theme doesn't add any elements into audio module
[1265] Fix | Delete
remove_all_filters( 'wp_audio_shortcode_library' );
[1266] Fix | Delete
remove_all_filters( 'wp_audio_shortcode' );
[1267] Fix | Delete
remove_all_filters( 'wp_audio_shortcode_class' );
[1268] Fix | Delete
[1269] Fix | Delete
// Masonry Tile Background color.
[1270] Fix | Delete
$this->generate_styles(
[1271] Fix | Delete
array(
[1272] Fix | Delete
'base_attr_name' => 'masonry_tile_background_color',
[1273] Fix | Delete
'selector' => '%%order_class%% .et_pb_blog_grid .et_pb_post',
[1274] Fix | Delete
'css_property' => 'background-color',
[1275] Fix | Delete
'render_slug' => $render_slug,
[1276] Fix | Delete
'type' => 'color',
[1277] Fix | Delete
)
[1278] Fix | Delete
);
[1279] Fix | Delete
[1280] Fix | Delete
// Overlay Icon Color.
[1281] Fix | Delete
$this->generate_styles(
[1282] Fix | Delete
array(
[1283] Fix | Delete
'hover' => false,
[1284] Fix | Delete
'base_attr_name' => 'overlay_icon_color',
[1285] Fix | Delete
'selector' => '%%order_class%% .et_overlay:before',
[1286] Fix | Delete
'css_property' => 'color',
[1287] Fix | Delete
'render_slug' => $render_slug,
[1288] Fix | Delete
'type' => 'color',
[1289] Fix | Delete
)
[1290] Fix | Delete
);
[1291] Fix | Delete
[1292] Fix | Delete
// Hover Overlay Color.
[1293] Fix | Delete
$this->generate_styles(
[1294] Fix | Delete
array(
[1295] Fix | Delete
'hover' => false,
[1296] Fix | Delete
'base_attr_name' => 'hover_overlay_color',
[1297] Fix | Delete
'selector' => '%%order_class%% .et_overlay',
[1298] Fix | Delete
'css_property' => 'background-color',
[1299] Fix | Delete
'render_slug' => $render_slug,
[1300] Fix | Delete
'type' => 'color',
[1301] Fix | Delete
)
[1302] Fix | Delete
);
[1303] Fix | Delete
[1304] Fix | Delete
$overlay_output = '';
[1305] Fix | Delete
[1306] Fix | Delete
if ( 'on' === $use_overlay ) {
[1307] Fix | Delete
$overlay_output = ET_Builder_Module_Helper_Overlay::render(
[1308] Fix | Delete
array(
[1309] Fix | Delete
'icon' => $hover_icon,
[1310] Fix | Delete
'icon_tablet' => $hover_icon_tablet,
[1311] Fix | Delete
'icon_phone' => $hover_icon_phone,
[1312] Fix | Delete
'icon_sticky' => $hover_icon_sticky,
[1313] Fix | Delete
)
[1314] Fix | Delete
);
[1315] Fix | Delete
}
[1316] Fix | Delete
[1317] Fix | Delete
$overlay_class = 'on' === $use_overlay ? ' et_pb_has_overlay' : '';
[1318] Fix | Delete
[1319] Fix | Delete
if ( 'on' !== $fullwidth ) {
[1320] Fix | Delete
wp_enqueue_script( 'salvattore' );
[1321] Fix | Delete
[1322] Fix | Delete
$background_layout = 'light';
[1323] Fix | Delete
$background_layout_tablet = ! empty( $background_layout_tablet ) ? 'light' : '';
[1324] Fix | Delete
$background_layout_phone = ! empty( $background_layout_phone ) ? 'light' : '';
[1325] Fix | Delete
}
[1326] Fix | Delete
[1327] Fix | Delete
$args = array(
[1328] Fix | Delete
'posts_per_page' => (int) $posts_number,
[1329] Fix | Delete
'post_status' => array( 'publish', 'private' ),
[1330] Fix | Delete
'perm' => 'readable',
[1331] Fix | Delete
'post_type' => $post_type,
[1332] Fix | Delete
);
[1333] Fix | Delete
[1334] Fix | Delete
$et_paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' );
[1335] Fix | Delete
[1336] Fix | Delete
if ( $__et_blog_module_paged > 1 ) {
[1337] Fix | Delete
$et_paged = $__et_blog_module_paged;
[1338] Fix | Delete
$paged = $__et_blog_module_paged; //phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited
[1339] Fix | Delete
$args['paged'] = $__et_blog_module_paged;
[1340] Fix | Delete
}
[1341] Fix | Delete
[1342] Fix | Delete
if ( is_front_page() ) {
[1343] Fix | Delete
$paged = $et_paged; //phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited
[1344] Fix | Delete
}
[1345] Fix | Delete
[1346] Fix | Delete
$args['cat'] = implode( ',', self::filter_include_categories( $include_categories ) );
[1347] Fix | Delete
[1348] Fix | Delete
$args['paged'] = $et_paged;
[1349] Fix | Delete
[1350] Fix | Delete
if ( '' !== $offset_number && ! empty( $offset_number ) ) {
[1351] Fix | Delete
/**
[1352] Fix | Delete
* Offset + pagination don't play well. Manual offset calculation required
[1353] Fix | Delete
*
[1354] Fix | Delete
* @see: https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination
[1355] Fix | Delete
*/
[1356] Fix | Delete
if ( $paged > 1 ) {
[1357] Fix | Delete
$args['offset'] = ( ( $et_paged - 1 ) * intval( $posts_number ) ) + intval( $offset_number );
[1358] Fix | Delete
} else {
[1359] Fix | Delete
$args['offset'] = intval( $offset_number );
[1360] Fix | Delete
}
[1361] Fix | Delete
}
[1362] Fix | Delete
[1363] Fix | Delete
$main_query_post = ET_Post_Stack::get_main_post();
[1364] Fix | Delete
[1365] Fix | Delete
if ( $main_query_post && is_singular( $main_query_post->post_type ) && ! isset( $args['post__not_in'] ) ) {
[1366] Fix | Delete
$args['post__not_in'] = array( $main_query_post->ID );
[1367] Fix | Delete
}
[1368] Fix | Delete
[1369] Fix | Delete
// Images: Add CSS Filters and Mix Blend Mode rules (if set)
[1370] Fix | Delete
if ( array_key_exists( 'image', $this->advanced_fields ) && array_key_exists( 'css', $this->advanced_fields['image'] ) ) {
[1371] Fix | Delete
$this->add_classname(
[1372] Fix | Delete
$this->generate_css_filters(
[1373] Fix | Delete
$render_slug,
[1374] Fix | Delete
'child_',
[1375] Fix | Delete
self::$data_utils->array_get( $this->advanced_fields['image']['css'], 'main', '%%order_class%%' )
[1376] Fix | Delete
)
[1377] Fix | Delete
);
[1378] Fix | Delete
}
[1379] Fix | Delete
[1380] Fix | Delete
self::$rendering = true;
[1381] Fix | Delete
[1382] Fix | Delete
$post_meta_remove_keys = array(
[1383] Fix | Delete
'show_author',
[1384] Fix | Delete
'show_date',
[1385] Fix | Delete
'show_categories',
[1386] Fix | Delete
'show_comments',
[1387] Fix | Delete
);
[1388] Fix | Delete
[1389] Fix | Delete
$post_meta_removes = array(
[1390] Fix | Delete
'desktop' => array(
[1391] Fix | Delete
'none' => 'none',
[1392] Fix | Delete
),
[1393] Fix | Delete
'tablet' => array(
[1394] Fix | Delete
'none' => 'none',
[1395] Fix | Delete
),
[1396] Fix | Delete
'phone' => array(
[1397] Fix | Delete
'none' => 'none',
[1398] Fix | Delete
),
[1399] Fix | Delete
'hover' => array(
[1400] Fix | Delete
'none' => 'none',
[1401] Fix | Delete
),
[1402] Fix | Delete
);
[1403] Fix | Delete
[1404] Fix | Delete
foreach ( $post_meta_removes as $mode => $post_meta_remove ) {
[1405] Fix | Delete
foreach ( $post_meta_remove_keys as $post_meta_remove_key ) {
[1406] Fix | Delete
if ( $multi_view->has_value( $post_meta_remove_key, 'on', $mode, true ) ) {
[1407] Fix | Delete
continue;
[1408] Fix | Delete
}
[1409] Fix | Delete
[1410] Fix | Delete
$post_meta_remove[ $post_meta_remove_key ] = $post_meta_remove_key;
[1411] Fix | Delete
}
[1412] Fix | Delete
[1413] Fix | Delete
$post_meta_removes[ $mode ] = implode( ',', $post_meta_remove );
[1414] Fix | Delete
}
[1415] Fix | Delete
[1416] Fix | Delete
$multi_view->set_custom_prop( 'post_meta_removes', $post_meta_removes );
[1417] Fix | Delete
$multi_view->set_custom_prop( 'post_content', $multi_view->get_values( 'show_content' ) );
[1418] Fix | Delete
[1419] Fix | Delete
$show_thumbnail = $multi_view->has_value( 'show_thumbnail', 'on' );
[1420] Fix | Delete
[1421] Fix | Delete
ob_start();
[1422] Fix | Delete
[1423] Fix | Delete
// Stash properties that will not be the same after wp_reset_query().
[1424] Fix | Delete
$wp_query_props = array(
[1425] Fix | Delete
'current_post' => $wp_query->current_post,
[1426] Fix | Delete
'in_the_loop' => $wp_query->in_the_loop,
[1427] Fix | Delete
);
[1428] Fix | Delete
[1429] Fix | Delete
$show_no_results_template = true;
[1430] Fix | Delete
[1431] Fix | Delete
if ( 'off' === $use_current_loop ) {
[1432] Fix | Delete
query_posts( $args );
[1433] Fix | Delete
} elseif ( is_singular() ) {
[1434] Fix | Delete
// Force an empty result set in order to avoid loops over the current post.
[1435] Fix | Delete
query_posts( array( 'post__in' => array( 0 ) ) );
[1436] Fix | Delete
$show_no_results_template = false;
[1437] Fix | Delete
} else {
[1438] Fix | Delete
// Only allow certain args when `Posts For Current Page` is set.
[1439] Fix | Delete
$original = $wp_query->query_vars;
[1440] Fix | Delete
$custom = array_intersect_key( $args, array_flip( array( 'posts_per_page', 'offset', 'paged' ) ) );
[1441] Fix | Delete
[1442] Fix | Delete
// Trick WP into reporting this query as the main query so third party filters
[1443] Fix | Delete
// that check for is_main_query() are applied.
[1444] Fix | Delete
$wp_the_query = $wp_query = new WP_Query( array_merge( $original, $custom ) );
[1445] Fix | Delete
}
[1446] Fix | Delete
[1447] Fix | Delete
/**
[1448] Fix | Delete
* Filters Blog module's main query.
[1449] Fix | Delete
*
[1450] Fix | Delete
* @since 4.7.0
[1451] Fix | Delete
*
[1452] Fix | Delete
* @param WP_Query $wp_query
[1453] Fix | Delete
*/
[1454] Fix | Delete
$wp_query = apply_filters( 'et_builder_blog_query', $wp_query ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- We intend to override $wp_query for blog module.
[1455] Fix | Delete
[1456] Fix | Delete
// Manually set the max_num_pages to make the `next_posts_link` work
[1457] Fix | Delete
if ( '' !== $offset_number && ! empty( $offset_number ) ) {
[1458] Fix | Delete
global $wp_query;
[1459] Fix | Delete
$wp_query->found_posts = max( 0, $wp_query->found_posts - intval( $offset_number ) );
[1460] Fix | Delete
$posts_number = intval( $posts_number );
[1461] Fix | Delete
$wp_query->max_num_pages = $posts_number > 1 ? ceil( $wp_query->found_posts / $posts_number ) : 1;
[1462] Fix | Delete
}
[1463] Fix | Delete
[1464] Fix | Delete
$blog_order = self::_get_index( array( self::INDEX_MODULE_ORDER, $render_slug ) );
[1465] Fix | Delete
$items_count = 0;
[1466] Fix | Delete
$wp_query->et_pb_blog_query = true;
[1467] Fix | Delete
[1468] Fix | Delete
if ( have_posts() ) {
[1469] Fix | Delete
if ( 'off' === $fullwidth ) {
[1470] Fix | Delete
$attribute = et_core_is_fb_enabled() ? 'data-et-vb-columns' : 'data-columns';
[1471] Fix | Delete
echo '<div class="et_pb_salvattore_content" ' . et_core_intentionally_unescaped( $attribute, 'fixed_string' ) . '>';
[1472] Fix | Delete
}
[1473] Fix | Delete
[1474] Fix | Delete
while ( have_posts() ) {
[1475] Fix | Delete
the_post();
[1476] Fix | Delete
ET_Post_Stack::replace( $post );
[1477] Fix | Delete
[1478] Fix | Delete
$post_format = et_pb_post_format();
[1479] Fix | Delete
[1480] Fix | Delete
$thumb = '';
[1481] Fix | Delete
[1482] Fix | Delete
$width = 'on' === $fullwidth ? 1080 : 400;
[1483] Fix | Delete
$width = (int) apply_filters( 'et_pb_blog_image_width', $width );
[1484] Fix | Delete
[1485] Fix | Delete
$height = 'on' === $fullwidth ? 675 : 250;
[1486] Fix | Delete
$height = (int) apply_filters( 'et_pb_blog_image_height', $height );
[1487] Fix | Delete
$classtext = 'on' === $fullwidth ? 'et_pb_post_main_image' : '';
[1488] Fix | Delete
$titletext = get_the_title();
[1489] Fix | Delete
$alttext = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );
[1490] Fix | Delete
$thumbnail = get_thumbnail( $width, $height, $classtext, $alttext, $titletext, false, 'Blogimage' );
[1491] Fix | Delete
$thumb = $thumbnail['thumb'];
[1492] Fix | Delete
[1493] Fix | Delete
$no_thumb_class = '' === $thumb || ! $show_thumbnail ? ' et_pb_no_thumb' : '';
[1494] Fix | Delete
[1495] Fix | Delete
if ( in_array( $post_format, array( 'video', 'gallery' ) ) ) {
[1496] Fix | Delete
$no_thumb_class = '';
[1497] Fix | Delete
}
[1498] Fix | Delete
[1499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function