Server IP : 192.64.112.168 / Your IP : 18.188.211.246 Web Server : Apache System : Linux nc-ph-2300-85.bluforrest.com 4.18.0-513.9.1.el8_9.x86_64 #1 SMP Sat Dec 2 05:23:44 EST 2023 x86_64 User : expressoneac ( 1128) PHP Version : 8.0.30 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/expressoneac/www/wp-content/themes/woodmart/inc/shortcodes/ |
Upload File : |
<?php if ( ! defined( 'WOODMART_THEME_DIR' ) ) { exit( 'No direct script access allowed' );} /** * ------------------------------------------------------------------------------------------------ * Woodmart responsive text block shortcode * ------------------------------------------------------------------------------------------------ */ if ( ! function_exists( 'woodmart_shortcode_responsive_text_block' ) ) { function woodmart_shortcode_responsive_text_block( $atts, $content ) { $text_wrapper_class = apply_filters( 'vc_shortcodes_css_class', '', '', $atts ); $atts = shortcode_atts( array( 'text' => 'Title', 'font' => 'primary', 'font_weight' => '', 'content_width' => '100', 'color_scheme' => '', 'color' => '', 'size' => 'default', 'align' => 'center', 'text_font_size' => '', 'inline' => 'no', // Old size 'desktop_text_size' => '', 'tablet_text_size' => '', 'mobile_text_size' => '', 'woodmart_css_id' => '', 'css_animation' => 'none', 'el_class' => '', 'css' => '', ), $atts ); extract( $atts ); if ( ! $woodmart_css_id ) { $woodmart_css_id = uniqid(); } $text_id = 'wd-' . $woodmart_css_id; $style_attr = ''; $text_wrapper_class .= ' color-scheme-' . $color_scheme; $text_wrapper_class .= ' text-' . $align; $text_wrapper_class .= $inline == 'yes' ? ' inline-element' : ''; $text_wrapper_class .= woodmart_get_css_animation( $css_animation ); if ( $content_width && 'custom' !== $content_width && '100' !== $content_width ) { $style_attr .= ' style="--wd-max-width: ' . $content_width . '%;"'; $text_wrapper_class .= ' wd-width-enabled'; } elseif ( 'custom' === $content_width ) { $text_wrapper_class .= ' wd-width-custom'; } $text_class = ' font-' . $font; $text_class .= ' wd-font-weight-' . $font_weight; $text_class .= ' ' . woodmart_get_new_size_classes( 'text', $size, 'title' ); if ( function_exists( 'vc_shortcode_custom_css_class' ) ) { $text_wrapper_class .= ' ' . vc_shortcode_custom_css_class( $css ); } if ( $el_class != '' ) { $text_wrapper_class .= ' ' . $el_class; } ob_start(); woodmart_enqueue_inline_style( 'responsive-text' ); ?> <div id="<?php echo esc_attr( $text_id ); ?>" class="wd-text-block-wrapper wd-wpb<?php echo esc_attr( $text_wrapper_class ); ?>"<?php echo wp_kses( $style_attr, true ); ?>> <div class="woodmart-title-container woodmart-text-block reset-last-child<?php echo esc_attr( $text_class ); ?>"> <?php echo do_shortcode( $content ); ?> </div> <?php if ( ( $size == 'custom' && ! $text_font_size ) || ( $color_scheme == 'custom' && ! woodmart_is_css_encode( $color ) ) ) { $css = ''; if ( $desktop_text_size || $color ) { $css .= '#' . esc_attr( $text_id ) . ' .woodmart-text-block {'; if ( $desktop_text_size ) { $css .= 'font-size: ' . esc_attr( $desktop_text_size ) . 'px;'; $css .= 'line-height: ' . esc_attr( (int) $desktop_text_size + 10 ) . 'px;'; } if ( $color ) { $css .= 'color: ' . esc_attr( $color ) . ';'; } $css .= '}'; } if ( $tablet_text_size ) { $css .= '@media (max-width: 1199px) {'; $css .= woodmart_responsive_text_size_css( $text_id, 'woodmart-text-block', $tablet_text_size, 'return' ); $css .= '}'; } if ( $mobile_text_size ) { $css .= '@media (max-width: 767px) {'; $css .= woodmart_responsive_text_size_css( $text_id, 'woodmart-text-block', $mobile_text_size, 'return' ); $css .= '}'; } wp_add_inline_style( 'woodmart-inline-css', $css ); } ?> </div> <?php $output = ob_get_contents(); ob_end_clean(); return $output; } }