diff --git a/classes/Instructor.php b/classes/Instructor.php index b6806f64f9..9163617865 100644 --- a/classes/Instructor.php +++ b/classes/Instructor.php @@ -677,7 +677,7 @@ function ( $course ) { return array( 'name' => $course->course_title, 'url' => get_permalink( $course->course_id ), - 'revenue' => wp_kses_post( tutor_utils()->tutor_price( $course->total_revenue ?? 0, false ) ), + 'revenue' => tutor_utils()->tutor_price( $course->total_revenue ?? 0 ), 'students' => $course->total_student ?? 0, ); }, diff --git a/classes/Utils.php b/classes/Utils.php index 6bb896fb7a..f8477a43c7 100644 --- a/classes/Utils.php +++ b/classes/Utils.php @@ -6441,21 +6441,20 @@ public function get_earning_statements( $user_id = 0, $filter_data = array() ) { * Get the price format * * @since 1.1.2 - * @since 4.0.0 Condition added for different monetizations and also added $html_markup for woocommece + * @since 4.0.0 Condition added for different monetizations. * * @param int $price price. - * @param bool $html_markup Whether to include HTML markup ( Only for woocommerce as it returns html markup ). * * @return int|string */ - public function tutor_price( $price = 0, $html_markup = true ) { + public function tutor_price( $price = 0 ) { $monetize_by = $this->get_option( 'monetize_by' ); if ( Ecommerce::MONETIZE_BY === $monetize_by ) { return tutor_get_formatted_price( $price ); } elseif ( function_exists( 'wc_price' ) && 'wc' === $monetize_by ) { - return wc_price( $price, array( 'in_span' => $html_markup ) ); + return wc_price( $price ); } elseif ( function_exists( 'edd_currency_filter' ) && 'edd' === $monetize_by ) { return edd_currency_filter( edd_format_amount( $price ) ); } elseif ( function_exists( 'pmpro_formatPrice' ) && 'pmpro' === $monetize_by ) { diff --git a/includes/tutor-general-functions.php b/includes/tutor-general-functions.php index f69da2e56c..044feeb335 100644 --- a/includes/tutor-general-functions.php +++ b/includes/tutor-general-functions.php @@ -1635,14 +1635,12 @@ function tutor_get_course_formatted_price_html( $course_id, $echo = true ) { * Formatting as per ecommerce price settings * * @since 3.0.0 - * @since 4.0.0 Added $html_markup for wooCommerce * * @param mixed $price Raw price. - * @param bool $html_markup Whether to include HTML markup ( Only for wooCommerce as it returns html markup ). * * @return string|void */ - function tutor_get_formatted_price( $price, $html_markup = true ) { + function tutor_get_formatted_price( $price ) { $price = floatval( Input::sanitize( $price ) ); $monetize_by = tutor_utils()->get_option( 'monetize_by' ); if ( Ecommerce::MONETIZE_BY === $monetize_by ) { @@ -1655,7 +1653,7 @@ function tutor_get_formatted_price( $price, $html_markup = true ) { $price = number_format( $price, $no_of_decimal, $decimal_separator, $thousand_separator ); $price = 'left' === $currency_position ? $currency_symbol . $price : $price . $currency_symbol; } elseif ( 'wc' === $monetize_by ) { - $price = wc_price( $price, array( 'in_span' => $html_markup ) ); + $price = wc_price( $price ); } elseif ( 'edd' === $monetize_by ) { $price = edd_currency_filter( edd_format_amount( $price ) ); } diff --git a/templates/dashboard/account/billing/order-history-card.php b/templates/dashboard/account/billing/order-history-card.php index 4ddc20d603..4077d2c020 100644 --- a/templates/dashboard/account/billing/order-history-card.php +++ b/templates/dashboard/account/billing/order-history-card.php @@ -15,10 +15,8 @@ use Tutor\Helpers\DateTimeHelper; use Tutor\Models\OrderModel; -$monetize_by = tutor_utils()->get_option( 'monetize_by' ); -$html_markup = 'wc' !== $monetize_by; -$titles = OrderModel::get_order_history_titles( $order ); -$pay_link = OrderModel::get_order_history_pay_link( $order ); +$titles = OrderModel::get_order_history_titles( $order ); +$pay_link = OrderModel::get_order_history_pay_link( $order ); ?>