@@ -6,11 +6,11 @@ discard block |
||
| 6 | 6 | * @subpackage the-events-calendar |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 9 | +if ( ! defined('ABSPATH')) { |
|
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | -if ( ! function_exists( 'lsx_tec_scripts_add_styles' ) ) : |
|
| 13 | +if ( ! function_exists('lsx_tec_scripts_add_styles')) : |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * The Events Calendar enqueue styles. |
@@ -22,26 +22,26 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | // Get plugin version. |
| 24 | 24 | $plugin = 'the-events-calendar/the-events-calendar.php'; |
| 25 | - $data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); |
|
| 25 | + $data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin); |
|
| 26 | 26 | $version = $data['Version']; |
| 27 | 27 | |
| 28 | - if ( substr( $version, 0, 1 ) >= '5' ) { |
|
| 28 | + if (substr($version, 0, 1) >= '5') { |
|
| 29 | 29 | // New Version 5.0 and up. |
| 30 | - wp_enqueue_style( 'the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar-5.css', array( 'lsx_main' ), LSX_VERSION ); |
|
| 30 | + wp_enqueue_style('the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar-5.css', array('lsx_main'), LSX_VERSION); |
|
| 31 | 31 | } else { |
| 32 | 32 | // Old Version. |
| 33 | - wp_enqueue_style( 'the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar.css', array( 'lsx_main' ), LSX_VERSION ); |
|
| 33 | + wp_enqueue_style('the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar.css', array('lsx_main'), LSX_VERSION); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - wp_enqueue_style( 'the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar.css', array( 'lsx_main' ), LSX_VERSION ); |
|
| 37 | - wp_style_add_data( 'the-events-calendar-lsx', 'rtl', 'replace' ); |
|
| 36 | + wp_enqueue_style('the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar.css', array('lsx_main'), LSX_VERSION); |
|
| 37 | + wp_style_add_data('the-events-calendar-lsx', 'rtl', 'replace'); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - add_action( 'wp_enqueue_scripts', 'lsx_tec_scripts_add_styles' ); |
|
| 40 | + add_action('wp_enqueue_scripts', 'lsx_tec_scripts_add_styles'); |
|
| 41 | 41 | |
| 42 | 42 | endif; |
| 43 | 43 | |
| 44 | -if ( ! function_exists( 'lsx_tec_theme_wrapper_start' ) ) : |
|
| 44 | +if ( ! function_exists('lsx_tec_theme_wrapper_start')) : |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * The Events Calendar wrapper start. |
@@ -51,17 +51,17 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | function lsx_tec_theme_wrapper_start() { |
| 53 | 53 | lsx_content_wrap_before(); |
| 54 | - echo '<div id="primary" class="content-area ' . esc_attr( lsx_main_class() ) . '">'; |
|
| 54 | + echo '<div id="primary" class="content-area ' . esc_attr(lsx_main_class()) . '">'; |
|
| 55 | 55 | lsx_content_before(); |
| 56 | 56 | echo '<main id="main" class="site-main" role="main">'; |
| 57 | 57 | lsx_content_top(); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - add_action( 'tribe_events_before_html', 'lsx_tec_theme_wrapper_start', 9 ); |
|
| 60 | + add_action('tribe_events_before_html', 'lsx_tec_theme_wrapper_start', 9); |
|
| 61 | 61 | |
| 62 | 62 | endif; |
| 63 | 63 | |
| 64 | -if ( ! function_exists( 'lsx_tec_theme_wrapper_end' ) ) : |
|
| 64 | +if ( ! function_exists('lsx_tec_theme_wrapper_end')) : |
|
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | 67 | * The Events Calendar wrapper end. |
@@ -77,11 +77,11 @@ discard block |
||
| 77 | 77 | lsx_content_wrap_after(); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - add_action( 'tribe_events_after_html', 'lsx_tec_theme_wrapper_end', 11 ); |
|
| 80 | + add_action('tribe_events_after_html', 'lsx_tec_theme_wrapper_end', 11); |
|
| 81 | 81 | |
| 82 | 82 | endif; |
| 83 | 83 | |
| 84 | -if ( ! function_exists( 'lsx_tec_global_header_title' ) ) : |
|
| 84 | +if ( ! function_exists('lsx_tec_global_header_title')) : |
|
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | 87 | * Move the events title into the global header |
@@ -89,107 +89,107 @@ discard block |
||
| 89 | 89 | * @package lsx |
| 90 | 90 | * @subpackage the-events-calendar |
| 91 | 91 | */ |
| 92 | - function lsx_tec_global_header_title( $title ) { |
|
| 92 | + function lsx_tec_global_header_title($title) { |
|
| 93 | 93 | |
| 94 | - if ( tribe_is_community_edit_event_page() ) { |
|
| 94 | + if (tribe_is_community_edit_event_page()) { |
|
| 95 | 95 | |
| 96 | - $is_route = get_query_var( 'WP_Route' ); |
|
| 97 | - switch ( $is_route ) { |
|
| 96 | + $is_route = get_query_var('WP_Route'); |
|
| 97 | + switch ($is_route) { |
|
| 98 | 98 | case 'ce-edit-route': |
| 99 | - $title = apply_filters( 'tribe_ce_edit_event_page_title', __( 'Edit an Event', 'lsx' ) ); |
|
| 99 | + $title = apply_filters('tribe_ce_edit_event_page_title', __('Edit an Event', 'lsx')); |
|
| 100 | 100 | break; |
| 101 | 101 | |
| 102 | 102 | case 'ce-edit-organizer-route': |
| 103 | - $title = __( 'Edit an Organizer', 'lsx' ); |
|
| 103 | + $title = __('Edit an Organizer', 'lsx'); |
|
| 104 | 104 | break; |
| 105 | 105 | |
| 106 | 106 | case 'ce-edit-venue-route': |
| 107 | - $title = __( 'Edit a Venue', 'lsx' ); |
|
| 107 | + $title = __('Edit a Venue', 'lsx'); |
|
| 108 | 108 | break; |
| 109 | 109 | |
| 110 | 110 | default: |
| 111 | - $title = apply_filters( 'tribe_ce_submit_event_page_title', __( 'Submit an Event', 'lsx' ) ); |
|
| 111 | + $title = apply_filters('tribe_ce_submit_event_page_title', __('Submit an Event', 'lsx')); |
|
| 112 | 112 | break; |
| 113 | 113 | } |
| 114 | - } elseif ( tribe_is_community_my_events_page() ) { |
|
| 115 | - $title = apply_filters( 'tribe_ce_submit_event_page_title', __( 'My Events', 'lsx' ) ); |
|
| 116 | - } elseif ( tribe_is_event() ) { |
|
| 114 | + } elseif (tribe_is_community_my_events_page()) { |
|
| 115 | + $title = apply_filters('tribe_ce_submit_event_page_title', __('My Events', 'lsx')); |
|
| 116 | + } elseif (tribe_is_event()) { |
|
| 117 | 117 | $title = tribe_get_events_title(); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | // Only disable the title after we have retrieved it. |
| 121 | - add_filter( 'tribe_get_events_title', 'lsx_text_disable_body_title', 200, 1 ); |
|
| 121 | + add_filter('tribe_get_events_title', 'lsx_text_disable_body_title', 200, 1); |
|
| 122 | 122 | |
| 123 | - if ( is_singular( 'tribe_events' ) ) { |
|
| 124 | - add_filter( 'the_title', 'lsx_text_disable_body_title', 200, 1 ); |
|
| 123 | + if (is_singular('tribe_events')) { |
|
| 124 | + add_filter('the_title', 'lsx_text_disable_body_title', 200, 1); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - if ( class_exists( 'LSX_Banners' ) ) { |
|
| 128 | - $options = get_option( '_lsx_settings', false ); |
|
| 129 | - if ( is_array( $options ) && isset( $options['tribe_events'] ) && isset( $options['tribe_events']['title'] ) && '' !== $options['tribe_events']['title'] ) { |
|
| 127 | + if (class_exists('LSX_Banners')) { |
|
| 128 | + $options = get_option('_lsx_settings', false); |
|
| 129 | + if (is_array($options) && isset($options['tribe_events']) && isset($options['tribe_events']['title']) && '' !== $options['tribe_events']['title']) { |
|
| 130 | 130 | $title = $options['tribe_events']['title']; |
| 131 | 131 | } |
| 132 | 132 | $title = '<h1 class="page-title">' . $title . '</h1>'; |
| 133 | 133 | } |
| 134 | 134 | return $title; |
| 135 | 135 | } |
| 136 | - add_filter( 'lsx_banner_title', 'lsx_tec_global_header_title', 200, 1 ); |
|
| 137 | - add_filter( 'lsx_global_header_title', 'lsx_tec_global_header_title', 200, 1 ); |
|
| 136 | + add_filter('lsx_banner_title', 'lsx_tec_global_header_title', 200, 1); |
|
| 137 | + add_filter('lsx_global_header_title', 'lsx_tec_global_header_title', 200, 1); |
|
| 138 | 138 | |
| 139 | 139 | endif; |
| 140 | 140 | |
| 141 | -if ( ! function_exists( 'lsx_text_disable_body_title' ) ) : |
|
| 141 | +if ( ! function_exists('lsx_text_disable_body_title')) : |
|
| 142 | 142 | /** |
| 143 | 143 | * Disable the events title for the post archive if the dynamic setting is active. |
| 144 | 144 | * |
| 145 | 145 | * @param $title |
| 146 | 146 | * @return string |
| 147 | 147 | */ |
| 148 | - function lsx_text_disable_body_title( $title ) { |
|
| 148 | + function lsx_text_disable_body_title($title) { |
|
| 149 | 149 | $title = ''; |
| 150 | - remove_filter( 'the_title', 'lsx_text_disable_body_title', 200, 1 ); |
|
| 150 | + remove_filter('the_title', 'lsx_text_disable_body_title', 200, 1); |
|
| 151 | 151 | return $title; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | endif; |
| 155 | 155 | |
| 156 | -if ( ! function_exists( 'lsx_tec_breadcrumb_filter' ) ) : |
|
| 156 | +if ( ! function_exists('lsx_tec_breadcrumb_filter')) : |
|
| 157 | 157 | /** |
| 158 | 158 | * Fixes the community events breadcrumb |
| 159 | 159 | * |
| 160 | 160 | * @package lsx |
| 161 | 161 | * @subpackage the-events-calendar |
| 162 | 162 | */ |
| 163 | - function lsx_tec_breadcrumb_filter( $crumbs ) { |
|
| 163 | + function lsx_tec_breadcrumb_filter($crumbs) { |
|
| 164 | 164 | |
| 165 | - if ( tribe_is_venue() || tribe_is_organizer() || tribe_is_community_edit_event_page() || tribe_is_community_my_events_page() ) { |
|
| 165 | + if (tribe_is_venue() || tribe_is_organizer() || tribe_is_community_edit_event_page() || tribe_is_community_my_events_page()) { |
|
| 166 | 166 | $new_crumbs = array(); |
| 167 | 167 | $new_crumbs[0] = $crumbs[0]; |
| 168 | 168 | |
| 169 | - if ( function_exists( 'woocommerce_breadcrumb' ) ) { |
|
| 169 | + if (function_exists('woocommerce_breadcrumb')) { |
|
| 170 | 170 | $new_crumbs[1] = array( |
| 171 | - 0 => __( 'Events', 'lsx' ), |
|
| 172 | - 1 => get_post_type_archive_link( 'tribe_events' ), |
|
| 171 | + 0 => __('Events', 'lsx'), |
|
| 172 | + 1 => get_post_type_archive_link('tribe_events'), |
|
| 173 | 173 | ); |
| 174 | 174 | } else { |
| 175 | 175 | $new_crumbs[1] = array( |
| 176 | - 'text' => __( 'Events', 'lsx' ), |
|
| 177 | - 'url' => get_post_type_archive_link( 'tribe_events' ), |
|
| 176 | + 'text' => __('Events', 'lsx'), |
|
| 177 | + 'url' => get_post_type_archive_link('tribe_events'), |
|
| 178 | 178 | ); |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - if ( tribe_is_community_my_events_page() ) { |
|
| 181 | + if (tribe_is_community_my_events_page()) { |
|
| 182 | 182 | $new_crumbs[2] = $crumbs[2]; |
| 183 | - } elseif ( tribe_is_community_edit_event_page() ) { |
|
| 183 | + } elseif (tribe_is_community_edit_event_page()) { |
|
| 184 | 184 | |
| 185 | - if ( function_exists( 'woocommerce_breadcrumb' ) ) { |
|
| 185 | + if (function_exists('woocommerce_breadcrumb')) { |
|
| 186 | 186 | $new_crumbs[2] = array( |
| 187 | - 0 => apply_filters( 'tribe_ce_submit_event_page_title', __( 'My Events', 'lsx' ) ), |
|
| 187 | + 0 => apply_filters('tribe_ce_submit_event_page_title', __('My Events', 'lsx')), |
|
| 188 | 188 | 1 => tribe_community_events_list_events_link(), |
| 189 | 189 | ); |
| 190 | 190 | } else { |
| 191 | 191 | $new_crumbs[2] = array( |
| 192 | - 'text' => apply_filters( 'tribe_ce_submit_event_page_title', __( 'My Events', 'lsx' ) ), |
|
| 192 | + 'text' => apply_filters('tribe_ce_submit_event_page_title', __('My Events', 'lsx')), |
|
| 193 | 193 | 'url' => tribe_community_events_list_events_link(), |
| 194 | 194 | ); |
| 195 | 195 | } |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | } |
| 203 | 203 | return $crumbs; |
| 204 | 204 | } |
| 205 | - add_filter( 'wpseo_breadcrumb_links', 'lsx_tec_breadcrumb_filter', 30, 1 ); |
|
| 206 | - add_filter( 'woocommerce_get_breadcrumb', 'lsx_tec_breadcrumb_filter', 30, 1 ); |
|
| 205 | + add_filter('wpseo_breadcrumb_links', 'lsx_tec_breadcrumb_filter', 30, 1); |
|
| 206 | + add_filter('woocommerce_get_breadcrumb', 'lsx_tec_breadcrumb_filter', 30, 1); |
|
| 207 | 207 | |
| 208 | 208 | endif; |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * @subpackage sensei |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 9 | +if ( ! defined('ABSPATH')) { |
|
| 10 | 10 | exit; // Exit if accessed directly. |
| 11 | 11 | } |
| 12 | 12 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * Constructor. |
| 27 | 27 | */ |
| 28 | 28 | public function __construct() { |
| 29 | - add_action( 'init', array( $this, 'init' ) ); |
|
| 29 | + add_action('init', array($this, 'init')); |
|
| 30 | 30 | } // End __construct() |
| 31 | 31 | |
| 32 | 32 | /** |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @return self |
| 36 | 36 | */ |
| 37 | 37 | public static function instance() { |
| 38 | - if ( ! self::$instance ) { |
|
| 38 | + if ( ! self::$instance) { |
|
| 39 | 39 | self::$instance = new self(); |
| 40 | 40 | } |
| 41 | 41 | return self::$instance; |
@@ -49,32 +49,32 @@ discard block |
||
| 49 | 49 | global $woothemes_sensei; |
| 50 | 50 | |
| 51 | 51 | // Switching the course filters and the headers around. |
| 52 | - remove_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 10, 0 ); |
|
| 53 | - remove_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_sorting' ) ); |
|
| 54 | - remove_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_filters' ) ); |
|
| 55 | - add_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 11, 0 ); |
|
| 56 | - add_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_sorting' ), 12 ); |
|
| 57 | - add_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_filters' ), 12 ); |
|
| 52 | + remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 10, 0); |
|
| 53 | + remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting')); |
|
| 54 | + remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters')); |
|
| 55 | + add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 11, 0); |
|
| 56 | + add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting'), 12); |
|
| 57 | + add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters'), 12); |
|
| 58 | 58 | |
| 59 | 59 | // First add the thumbnail. |
| 60 | - add_action( 'sensei_course_content_inside_before', array( $this, 'get_course_thumbnail' ), 1 ); |
|
| 60 | + add_action('sensei_course_content_inside_before', array($this, 'get_course_thumbnail'), 1); |
|
| 61 | 61 | |
| 62 | 62 | // This is for our wrapper, we run it on 2, after the thumbnail we added. |
| 63 | - add_action( 'sensei_course_content_inside_before', array( $this, 'course_body_div_open' ), 1 ); |
|
| 64 | - add_action( 'sensei_course_content_inside_after', array( $this, 'course_body_div_close' ), 50 ); |
|
| 63 | + add_action('sensei_course_content_inside_before', array($this, 'course_body_div_open'), 1); |
|
| 64 | + add_action('sensei_course_content_inside_after', array($this, 'course_body_div_close'), 50); |
|
| 65 | 65 | |
| 66 | 66 | // This is for our wrapper, we run it on 2, after the thumbnail we added. |
| 67 | - add_action( 'sensei_course_content_inside_before', array( $this, 'course_body_div_results_open' ), 20 ); |
|
| 68 | - add_action( 'sensei_course_content_inside_after', array( $this, 'course_body_div_results_close' ), 49 ); |
|
| 67 | + add_action('sensei_course_content_inside_before', array($this, 'course_body_div_results_open'), 20); |
|
| 68 | + add_action('sensei_course_content_inside_after', array($this, 'course_body_div_results_close'), 49); |
|
| 69 | 69 | |
| 70 | - add_action( 'sensei_single_course_content_inside_before', array( $this, 'display_course_amount' ), 20 ); |
|
| 70 | + add_action('sensei_single_course_content_inside_before', array($this, 'display_course_amount'), 20); |
|
| 71 | 71 | |
| 72 | 72 | // removes the course image above the content. |
| 73 | - remove_action( 'sensei_course_content_inside_before', array( $woothemes_sensei->course, 'course_image' ), 30, 1 ); |
|
| 73 | + remove_action('sensei_course_content_inside_before', array($woothemes_sensei->course, 'course_image'), 30, 1); |
|
| 74 | 74 | // add the course image to the left of the content. |
| 75 | - add_action( 'lsx_sensei_course_content_inside_before', array( $woothemes_sensei->course, 'course_image' ), 30, 1 ); |
|
| 75 | + add_action('lsx_sensei_course_content_inside_before', array($woothemes_sensei->course, 'course_image'), 30, 1); |
|
| 76 | 76 | |
| 77 | - add_filter( 'attach_shortcode_hooks', 'lsx_attach_shortcode_hooks', 10, 1 ); |
|
| 77 | + add_filter('attach_shortcode_hooks', 'lsx_attach_shortcode_hooks', 10, 1); |
|
| 78 | 78 | |
| 79 | 79 | } |
| 80 | 80 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | public function get_course_thumbnail() { |
| 87 | 87 | ?> |
| 88 | 88 | <div class="course-thumbnail"> |
| 89 | - <?php do_action( 'lsx_sensei_course_content_inside_before', get_the_ID() ); ?> |
|
| 89 | + <?php do_action('lsx_sensei_course_content_inside_before', get_the_ID()); ?> |
|
| 90 | 90 | </div> |
| 91 | 91 | <?php |
| 92 | 92 | } |
@@ -98,13 +98,13 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | public function course_body_div_open() { |
| 100 | 100 | global $post, $current_user; |
| 101 | - $is_user_taking_course = Sensei_Utils::user_started_course( $post->ID, $current_user->ID ); |
|
| 101 | + $is_user_taking_course = Sensei_Utils::user_started_course($post->ID, $current_user->ID); |
|
| 102 | 102 | $user_taking_course_class = ''; |
| 103 | - if ( ! empty( $is_user_taking_course ) ) { |
|
| 103 | + if ( ! empty($is_user_taking_course)) { |
|
| 104 | 104 | $user_taking_course_class = 'currently-in-course'; |
| 105 | 105 | } |
| 106 | 106 | ?> |
| 107 | - <div class="course-body <?php echo esc_html( $user_taking_course_class ); ?>"> |
|
| 107 | + <div class="course-body <?php echo esc_html($user_taking_course_class); ?>"> |
|
| 108 | 108 | <?php |
| 109 | 109 | } |
| 110 | 110 | |
@@ -148,17 +148,17 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | public function display_course_amount() { |
| 150 | 150 | global $post, $current_user; |
| 151 | - $is_user_taking_course = Sensei_Utils::user_started_course( $post->ID, $current_user->ID ); |
|
| 152 | - $wc_post_id = absint( get_post_meta( $post->ID, '_course_woocommerce_product', true ) ); |
|
| 151 | + $is_user_taking_course = Sensei_Utils::user_started_course($post->ID, $current_user->ID); |
|
| 152 | + $wc_post_id = absint(get_post_meta($post->ID, '_course_woocommerce_product', true)); |
|
| 153 | 153 | $course_purchasable = ''; |
| 154 | - if ( class_exists( 'Sensei_WC' ) ) { |
|
| 155 | - $course_purchasable = Sensei_WC::is_course_purchasable( $post->ID ); |
|
| 154 | + if (class_exists('Sensei_WC')) { |
|
| 155 | + $course_purchasable = Sensei_WC::is_course_purchasable($post->ID); |
|
| 156 | 156 | $currency = get_woocommerce_currency_symbol(); |
| 157 | - $product = new WC_Product( $wc_post_id ); |
|
| 158 | - if ( ( ! empty( $product->get_price() ) ) && ( ! $is_user_taking_course ) ) { |
|
| 159 | - echo '<span class="course-product-price price"><span>' . esc_html( $currency ) . ' </span>' . sprintf( '%0.2f', esc_html( $product->get_price() ) ) . '</span>'; |
|
| 160 | - } elseif ( ( '' === $product->get_price() || 0 == $product->get_price() ) && $course_purchasable ) { |
|
| 161 | - echo '<span class="course-product-price price">' . wp_kses_post( 'Free!', 'lsx' ) . '</span>'; |
|
| 157 | + $product = new WC_Product($wc_post_id); |
|
| 158 | + if (( ! empty($product->get_price())) && ( ! $is_user_taking_course)) { |
|
| 159 | + echo '<span class="course-product-price price"><span>' . esc_html($currency) . ' </span>' . sprintf('%0.2f', esc_html($product->get_price())) . '</span>'; |
|
| 160 | + } elseif (('' === $product->get_price() || 0 == $product->get_price()) && $course_purchasable) { |
|
| 161 | + echo '<span class="course-product-price price">' . wp_kses_post('Free!', 'lsx') . '</span>'; |
|
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | } |