__( 'Primary Menu', 'busiprof' ) ) ); } // busiporf_setup endif; add_action( 'after_setup_theme', 'busiporf_setup' ); function busiprof_inline_style() { $custom_css = ''; $busiprof_service_content = get_theme_mod( 'busiprof_service_content', json_encode( array( array( 'color' => '#e91e63', ), array( 'color' => '#00bcd4', ), array( 'color' => '#4caf50', ), ) ) ); if ( ! empty( $busiprof_service_content ) ) { $busiprof_service_content = json_decode( $busiprof_service_content ); foreach ( $busiprof_service_content as $key => $features_item ) { $box_nb = $key + 1; if ( ! empty( $features_item->color ) ) { $color = ! empty( $features_item->color ) ? apply_filters( 'busiprof_translate_single_string', $features_item->color, 'Features section' ) : ''; $custom_css .= '.service-box:nth-child(' . esc_attr( $box_nb ) . ') .service-icon { color: ' . esc_attr( $color ) . '; }'; } } } wp_add_inline_style( 'style', $custom_css ); } add_action( 'wp_enqueue_scripts', 'busiprof_inline_style' ); add_action( 'after_switch_theme', 'import_busiprof_child_theme_data_in_busiprof_theme' ); /** * Import theme mods when switching from Busiprof child theme to Busiprof */ function import_busiprof_child_theme_data_in_busiprof_theme() { // Get the name of the previously active theme. $previous_theme = strtolower( get_option( 'theme_switched' ) ); if ( ! in_array( $previous_theme, array( 'vdequator', 'vdperanto', 'arzine', 'lazyprof', ) ) ) { return; } // Get the theme mods from the previous theme. $previous_theme_content = get_option( 'theme_mods_' . $previous_theme ); if ( ! empty( $previous_theme_content ) ) { foreach ( $previous_theme_content as $previous_theme_mod_k => $previous_theme_mod_v ) { set_theme_mod( $previous_theme_mod_k, $previous_theme_mod_v ); } } } ?>