diff --git a/inc/header-functions.php b/inc/header-functions.php index 67d9eb2..10062f0 100644 --- a/inc/header-functions.php +++ b/inc/header-functions.php @@ -75,21 +75,37 @@ function accelerate_featured_image_slider() { $image_alt = get_post_meta( $attachment_post_id, '_wp_attachment_image_alt', true ); $image_alt_text = ! empty( $image_alt ) ? $image_alt : $accelerate_slider_title; + // For WPML plugin compatibility + if ( function_exists( 'icl_register_string' ) ) { + icl_register_string( 'Accelerate', 'Slider Title ' . $i, $accelerate_slider_title ); + icl_register_string( 'Accelerate', 'Slider Description ' . $i, $accelerate_slider_text ); + icl_register_string( 'Accelerate', 'Slider Button Link ' . $i, $accelerate_slider_link ); + icl_register_string( 'Accelerate', 'Slider Image Link ' . $i, $accelerate_slider_image ); + } if ( ! empty( $accelerate_header_title ) || ! empty( $accelerate_slider_text ) || ! empty( $accelerate_slider_image ) ) { if ( $i == 1 ) { - $classes = "slides displayblock"; + $classes = 'slides displayblock'; } else { - $classes = "slides displaynone"; + $classes = 'slides displaynone'; } if ( $accelerate_slide_text_position == 'left' ) { - $classes2 = "entry-container entry-container-left"; + $classes2 = 'entry-container entry-container-left'; } else { - $classes2 = "entry-container"; + $classes2 = 'entry-container'; } ?>
+
<?php echo esc_attr( $image_alt_text ); ?>
diff --git a/inc/widgets/accelerate-call-to-action-widget.php b/inc/widgets/accelerate-call-to-action-widget.php index a0193fa..b908989 100644 --- a/inc/widgets/accelerate-call-to-action-widget.php +++ b/inc/widgets/accelerate-call-to-action-widget.php @@ -5,44 +5,47 @@ class accelerate_call_to_action_widget extends WP_Widget { function __construct() { - $widget_ops = array( + $widget_ops = array( 'classname' => 'widget_call_to_action', 'description' => __( 'Use this widget to show the call to action section.', 'accelerate' ), 'customize_selective_refresh' => true, ); - $control_ops = array( 'width' => 200, 'height' =>250 ); - parent::__construct( false, $name = __( 'TG: Call To Action Widget', 'accelerate' ), $widget_ops, $control_ops); + $control_ops = array( + 'width' => 200, + 'height' => 250, + ); + parent::__construct( false, $name = __( 'TG: Call To Action Widget', 'accelerate' ), $widget_ops, $control_ops ); } function form( $instance ) { - $accelerate_defaults[ 'text_main' ] = ''; - $accelerate_defaults[ 'text_additional' ] = ''; - $accelerate_defaults[ 'button_text' ] = ''; - $accelerate_defaults[ 'button_url' ] = ''; - $accelerate_defaults[ 'new_tab' ] = '0'; - $instance = wp_parse_args( (array) $instance, $accelerate_defaults ); - $text_main = esc_textarea( $instance[ 'text_main' ] ); - $text_additional = esc_textarea( $instance[ 'text_additional' ] ); - $button_text = esc_attr( $instance[ 'button_text' ] ); - $button_url = esc_url( $instance[ 'button_url' ] ); - $new_tab = $instance['new_tab'] ? 'checked="checked"' : ''; + $accelerate_defaults['text_main'] = ''; + $accelerate_defaults['text_additional'] = ''; + $accelerate_defaults['button_text'] = ''; + $accelerate_defaults['button_url'] = ''; + $accelerate_defaults['new_tab'] = '0'; + $instance = wp_parse_args( (array) $instance, $accelerate_defaults ); + $text_main = esc_textarea( $instance['text_main'] ); + $text_additional = esc_textarea( $instance['text_additional'] ); + $button_text = esc_attr( $instance['button_text'] ); + $button_url = esc_url( $instance['button_url'] ); + $new_tab = $instance['new_tab'] ? 'checked="checked"' : ''; ?> - - - - + + + +

- - + +

- - + +

- id="get_field_id('new_tab'); ?>" name="get_field_name('new_tab'); ?>" /> + id="get_field_id( 'new_tab' ); ?>" name="get_field_name( 'new_tab' ); ?>" />

id, $text_main ); + icl_register_string( 'Accelerate', 'TG: Call to Action widget additional text' . $this->id, $text_additional ); + icl_register_string( 'Accelerate', 'TG: Call to Action widget button text' . $this->id, $button_text ); + icl_register_string( 'Accelerate', 'TG: Call to Action widget button redirect link' . $this->id, $button_url ); + } echo $before_widget; ?>
+

+ id, $text_main ); + } + echo esc_html( $text_main ); ?> -

+

+ - href="" title=""> + href="" title=""> diff --git a/inc/widgets/accelerate-recent-work-widget.php b/inc/widgets/accelerate-recent-work-widget.php index c7fd33f..5ad41ec 100644 --- a/inc/widgets/accelerate-recent-work-widget.php +++ b/inc/widgets/accelerate-recent-work-widget.php @@ -5,42 +5,53 @@ class accelerate_recent_work_widget extends WP_Widget { function __construct() { - $widget_ops = array( - 'classname' => 'widget_recent_work', - 'description' => __( 'Show your some pages as recent work. Best for Business Top or Bottom sidebar.', 'accelerate' ), + $widget_ops = array( + 'classname' => 'widget_recent_work', + 'description' => __( 'Show your some pages as recent work. Best for Business Top or Bottom sidebar.', 'accelerate' ), 'customize_selective_refresh' => true, ); - $control_ops = array( 'width' => 200, 'height' =>250 ); - parent::__construct( false, $name = __( 'TG: Featured Widget', 'accelerate' ), $widget_ops, $control_ops); + $control_ops = array( + 'width' => 200, + 'height' => 250, + ); + parent::__construct( false, $name = __( 'TG: Featured Widget', 'accelerate' ), $widget_ops, $control_ops ); } function form( $instance ) { - $defaults = array(); - $defaults[ 'title' ] = ''; - $defaults[ 'text' ] = ''; - for ( $i=0; $i<4; $i++ ) { - $var = 'page_id'.$i; - $defaults[$var] = ''; + $defaults = array(); + $defaults['title'] = ''; + $defaults['text'] = ''; + for ( $i = 0; $i < 4; $i++ ) { + $var = 'page_id' . $i; + $defaults[ $var ] = ''; } $instance = wp_parse_args( (array) $instance, $defaults ); - $title = esc_attr( $instance['title'] ); - $text = esc_textarea($instance['text']); - for ( $i=0; $i<4; $i++ ) { - $var = 'page_id'.$i; + $title = esc_attr( $instance['title'] ); + $text = esc_textarea( $instance['text'] ); + for ( $i = 0; $i < 4; $i++ ) { + $var = 'page_id' . $i; $var = absint( $instance[ $var ] ); } ?>

- - + +

- - - + + +

- - ' ','name' => $this->get_field_name( 'page_id'.$i ), 'selected' => $instance[ 'page_id'.$i ] ) ); ?> + + ' ', + 'name' => $this->get_field_name( 'page_id' . $i ), + 'selected' => $instance[ 'page_id' . $i ], + ) + ); + ?>

id, $text ); + } + $page_array = array(); - for( $i=0; $i<4; $i++ ) { - $var = 'page_id'.$i; + for ( $i = 0; $i < 4; $i++ ) { + $var = 'page_id' . $i; $page_id = isset( $instance[ $var ] ) ? $instance[ $var ] : ''; - if( !empty( $page_id ) ) + if ( ! empty( $page_id ) ) { array_push( $page_array, $page_id );// Push the page id in the array + } } - $get_featured_pages = new WP_Query( array( - 'posts_per_page' => -1, - 'post_type' => array( 'page' ), - 'post__in' => $page_array, - 'orderby' => 'post__in' - ) ); + $get_featured_pages = new WP_Query( + array( + 'posts_per_page' => -1, + 'post_type' => array( 'page' ), + 'post__in' => $page_array, + 'orderby' => 'post__in', + ) + ); echo $before_widget; - if ( !empty( $title ) ) { echo $before_title . esc_html( $title ) . $after_title; } - if ( !empty( $text ) ) { echo '

'.esc_textarea( $text ).'

'; } + if ( ! empty( $title ) ) { + echo $before_title . esc_html( $title ) . $after_title; } + if ( ! empty( $text ) ) { + ?> +

+ id, $text ); + } + echo '

' . esc_textarea( $text ) . '

'; + ?> +

+ have_posts() ):$get_featured_pages->the_post(); + while ( $get_featured_pages->have_posts() ) : + $get_featured_pages->the_post(); $page_title = get_the_title(); - if ( $i % 4 == 0 ) { $class = 'tg-one-fourth tg-one-fourth-last'.' tg-column-'.$i; } - elseif( $i % 3 == 0 ) { $class= 'tg-one-fourth tg-after-two-blocks-clearfix'.' tg-column-'.$i; } - else { $class = 'tg-one-fourth'.' tg-column-'.$i; } - ?> + if ( $i % 4 == 0 ) { + $class = 'tg-one-fourth tg-one-fourth-last' . ' tg-column-' . $i; } elseif ( $i % 3 == 0 ) { + $class = 'tg-one-fourth tg-after-two-blocks-clearfix' . ' tg-column-' . $i; } else { + $class = 'tg-one-fourth' . ' tg-column-' . $i; } + ?> '; + echo ''; } ?>
- '.$page_title.''; ?> + ' . $page_title . ''; ?>
- diff --git a/readme.txt b/readme.txt index 290dee2..710ae48 100644 --- a/readme.txt +++ b/readme.txt @@ -46,6 +46,7 @@ If you want to translate this theme to your language, Please visit:- https://tra == Changelog == = Version TBD = +* Enhancement - Make WPML/Polylang plugin compatible. * Tweak - Remove deprecate Custom CSS customize option provided via theme. = Version 1.4.7 - 2020-08-13 = diff --git a/wpml-config.xml b/wpml-config.xml new file mode 100644 index 0000000..1a26d64 --- /dev/null +++ b/wpml-config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + +