Premium Addons Pro.', 'premium-addons-for-elementor' );
echo wp_kses_post( $message );
?>
get_id();
$settings['widget_id'] = $id;
$settings['widget_type'] = 'premium-post-ticker';
$source = $settings['post_type_filter'];
if ( 'stock' === $source ) {
$api_key = apply_filters( 'pa_stock_api', $settings['api_key'] );
if ( empty( $api_key ) ) {
$notice = __( 'Please enter a valid API key.', 'premium-addons-for-elementor' );
?>
get_render_attribute_string( 'outer-wrapper' ) ); ?>>
render_ticker_title( $settings );
}
?>
get_render_attribute_string( 'inner-wrapper' ) ); ?>>
render_detailed_stock_element( $req_data, $settings );
} elseif ( 'text' === $source ) {
$this->render_ticker_text_content( $text_content, $settings );
} else {
$this->render_ticker_post( $query, $settings, $posts_helper );
}
?>
render_ticker_arrows( $settings );
}
?>
render_ticker_date( $settings );
}
?>
get_render_attribute_string( 'inner-wrapper' ) ); ?>>
render_detailed_stock_element( $req_data, $settings );
} elseif ( 'text' === $source ) {
$this->render_ticker_text_content( $text_content, $settings );
} else {
$this->render_ticker_post( $query, $settings, $posts_helper );
}
?>
render_ticker_arrows( $settings );
}
?>
get_render_attribute_string( 'inner-wrapper' ) ); ?>>
render_detailed_stock_element( $req_data, $settings );
} elseif ( 'text' === $source ) {
$this->render_ticker_text_content( $text_content, $settings );
} else {
$this->render_ticker_post( $query, $settings, $posts_helper );
}
?>
render_ticker_arrows( $settings );
}
?>
get_render_attribute_string( 'inner-wrapper' ) ); ?>>
render_detailed_stock_element( $req_data, $settings );
} elseif ( 'text' === $source ) {
$this->render_ticker_text_content( $text_content, $settings );
} else {
$this->render_ticker_post( $query, $settings, $posts_helper );
}
?>
extract_stock_symbols( $settings['symbol_name'] );
}
if ( 'yes' !== $settings['show_symbol'] ) {
$show_symbol = false;
}
}
if ( $is_stock_element && 'CURRENCY_EXCHANGE_RATE' === $function ) {
if ( 'yes' !== $settings['curr_change'] ) {
$show_change = false;
$show_change_per = false;
}
}
if ( $show_price || $show_change || $show_change_per ) {
$change_indicator = $settings['change_indicator'];
$decimal_places = empty( $settings['decimal_places'] ) ? 0 : $settings['decimal_places'];
}
foreach ( $stock_symbols as $symbol => $data ) {
$name = false;
if ( $show_change || $show_change_per ) {
$dir_cls = '';
if ( 0 < $data['change'] ) {
$dir_cls = 'up';
} elseif ( 0 > $data['change'] ) {
$dir_cls = 'down';
}
}
if ( $show_price || $show_change || $show_change_per ) {
if ( $show_price ) {
$price = number_format( (float) $data['price'], $decimal_places, '.', ',' );
if ( $is_equity ) {
$price = '$' . $price;
}
}
if ( $show_change ) {
$change = 'sign' === $change_indicator ? $data['change'] : abs( $data['change'] );
$change = number_format( (float) $change, $decimal_places, '.', ',' );
}
if ( $show_change_per ) {
$percent_change = str_replace( '%', '', $data['percent_change'] );
$change_percent = 'sign' === $change_indicator ? $percent_change : abs( $percent_change );
$change_percent = number_format( (float) str_replace( '%', '', $change_percent ), $decimal_places, '.', ',' );
}
}
if ( false !== $symbols_names && isset( $symbols_names[ $symbol ] ) ) {
$name = $symbols_names[ $symbol ];
}
if ( 'yes' === $settings['show_symbol_icon'] ) {
$icons_repeater = $settings['symbol_icons_repeater'];
$currency_symbol = 'CURRENCY_EXCHANGE_RATE' === $function ? substr( $data['symbol'], 0, 3 ) : $data['symbol'];
$custom_icon = '';
if ( count( $icons_repeater ) > 0 ) {
array_map(
function ( $repeater_item ) use ( $currency_symbol, &$custom_icon ) {
if ( $repeater_item['symbol_name'] === $currency_symbol ) {
$custom_icon = $repeater_item['symbol_img']['url'];
}},
$icons_repeater
);
}
if ( ! empty( $custom_icon ) ) {
$data['icon_src'] = $custom_icon;
} else {
$currency_symbol = strtolower( $currency_symbol );
if ( 'CURRENCY_EXCHANGE_RATE' === $function ) {
$data['icon_src'] = sprintf( 'https://assets.coincap.io/assets/icons/%s@2x.png', $currency_symbol );
$data['icon_alternative'] = $data['icon_src'];
} else {
$data['icon_src'] = sprintf( 'https://eodhistoricaldata.com/img/logos/US/%s.png', $data['symbol'] );
$data['icon_alternative'] = sprintf( 'https://eodhistoricaldata.com/img/logos/US/%s.png', $currency_symbol );
}
}
}
?>
get_render_attribute_string( 'title' ) ); ?>>
render_ticker_icon( $settings );
}
?>
< class="premium-post-ticker__title"> >
add_render_attribute( 'date', 'class', $date_classes );
?>
array( 'premium-svg-nodraw', 'premium-drawable-icon' ),
'aria-hidden' => 'true',
)
);
} else {
$this->add_render_attribute( 'icon' . $index, 'class', 'premium-drawable-icon' );
if ( 'yes' === $settings['draw_svg'] ) {
$this->add_render_attribute( 'outer-wrapper' . $index, 'class', 'elementor-invisible' );
if ( 'icon' === $icon_type ) {
$this->add_render_attribute( 'icon' . $index, 'class', $settings['pa_ticker_icon']['value'] );
}
$this->add_render_attribute(
'icon' . $index,
array(
'class' => 'premium-svg-drawer',
'data-svg-reverse' => $is_repeater_item ? 'false' : $settings['lottie_reverse'],
'data-svg-loop' => $settings['lottie_loop'],
'data-svg-sync' => $is_repeater_item ? 'true' : $settings['svg_sync'],
'data-svg-fill' => $is_repeater_item ? $settings['text_icon_color'] : $settings['title_icon_color'],
'data-svg-frames' => $is_repeater_item ? '5' : $settings['frames'],
'data-svg-yoyo' => $is_repeater_item ? 'false' : $settings['svg_yoyo'],
)
);
if ( $is_repeater_item ) {
$this->add_render_attribute( 'icon' . $index, 'data-svg-point', '0' );
} else {
$this->add_render_attribute( 'icon' . $index, 'data-svg-point', $settings['lottie_reverse'] ? $settings['end_point']['size'] : $settings['start_point']['size'] );
}
} else {
$this->add_render_attribute( 'icon' . $index, 'class', 'premium-svg-nodraw' );
}
if ( 'icon' === $icon_type ) {
?>
get_render_attribute_string( 'icon' . $index ) ); ?>>
get_render_attribute_string( 'icon' . $index ) ); ?>>
print_unescaped_setting( 'custom_svg', 'text_content', $settings['index'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
$this->print_unescaped_setting( 'custom_svg' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
add_render_attribute(
'pa_ticker_lottie',
array(
'class' => array(
'premium-lottie-animation',
),
'data-lottie-url' => $settings['lottie_url'],
'data-lottie-loop' => $settings['lottie_loop'],
'data-lottie-reverse' => $is_repeater_item ? false : $settings['lottie_reverse'],
)
);
?>
get_render_attribute_string( 'pa_ticker_lottie' ) ); ?>>
posts;
global $post;
foreach ( $posts as $post ) {
setup_postdata( $post );
$this->get_ticker_post_layout( $settings );
}
wp_reset_postdata();
}
/**
* Render Ticker Text Content.
*
* @access private
* @since 2.8.22
*
* @param object $content text content.
* @param array $settings widget settings.
*/
private function render_ticker_text_content( $content, $settings ) {
$typing_enabled = 'yes' === $settings['typing'] && 'layout-4' !== $settings['layout'] ? true : false;
foreach ( $content as $index => $item ) {
$txt_id = $item['_id'];
$this->add_render_attribute( 'post-title' . $txt_id, 'class', 'premium-post-ticker__post-title' );
$this->add_render_attribute( 'post-wrapper' . $txt_id, 'class', array( 'premium-post-ticker__post-wrapper', 'elementor-repeater-item-' . $txt_id ) );
$this->add_link_attributes( 'post-link' . $txt_id, $item['item_link'] );
if ( $typing_enabled ) {
$this->add_render_attribute( 'post-link' . $txt_id, 'data-typing', esc_attr( $item['text'] ) );
}
if ( '' !== $settings['entrance_animation'] ) {
$this->add_render_attribute( 'post-wrapper' . $txt_id, 'class', 'animated ' . $settings['entrance_animation'] );
}
?>