PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 2.4.21
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v2.4.21
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 2.3.5 2.3.6 2.4.0 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.4.18 2.4.19 2.4.2 2.4.20 2.4.21 All 88 releases
post-carousel / includes / updates / update-2.4.13.php

update-2.4.13.php in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 2.4.21, at includes/updates/update-2.4.13.php

34 lines 1010 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 update_option( 'smart_post_show_version', '2.4.13' );
3 update_option( 'smart_post_show_db_version', '2.4.13' );
4
5 /**
6 * Update settings.
7 */
8 $args = new \WP_Query(
9 array(
10 'post_type' => array( 'page' ),
11 'post_status' => 'publish',
12 'posts_per_page' => '300',
13 )
14 );
15 $post_ids = wp_list_pluck( $args->posts, 'ID' );
16 if ( count( $post_ids ) > 0 ) {
17 add_filter( 'wp_revisions_to_keep', '__return_false' );
18 foreach ( $post_ids as $post_key => $pid ) {
19 $post_data = get_post( $pid );
20 $post_content = isset( $post_data->post_content ) ? $post_data->post_content : '';
21 if ( ! empty( $post_content ) && ( strpos( $post_content, 'wp:smart-post-show' ) !== false ) ) {
22 $post_content = preg_replace( '/wp:smart-post-show\/shortcode/i', 'wp:smart-post-show-pro/shortcode', $post_content );
23
24 $gutenberg_post = array(
25 'ID' => $pid,
26 'post_content' => $post_content,
27 );
28 // Update the post into the database.
29 $pid = wp_update_post( $gutenberg_post );
30
31 }
32 }
33 }
34