Skip to content

Commit

Permalink
= 4.2.3 =
Browse files Browse the repository at this point in the history
~ Added: param bool $include on method "get_template" of class LP_Addon
  • Loading branch information
tungnxt89 committed Apr 18, 2023
1 parent a95617b commit bd62667
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
23 changes: 20 additions & 3 deletions inc/abstracts/abstract-addon.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,13 @@ public function get_template_path() {
* Get content template of addon.
*
* @param string $template_name
* @param mixed $args
* @param array $args
* @param bool $include
*
* @since 3.0.0
* @version 1.0.1
*/
public function get_template( string $template_name = '', $args = [] ) {
public function get_template( string $template_name = '', array $args = [], bool $include = true ) {
// Check path file not extension php, will add extension .php
if ( ! preg_match( '/\.php$/', $template_name ) ) {
$template_name .= '.php';
Expand Down Expand Up @@ -460,7 +462,22 @@ public function get_template( string $template_name = '', $args = [] ) {
} elseif ( file_exists( $from_theme_path ) ) {
$path_load = $from_theme_path;
}
Template::instance()->get_template( $path_load, $args );
Template::instance( $include )->get_template( $path_load, $args );
}

/**
* Get multiple templates.
*
* @param array $templates
* @param array $args
* @param bool $include
*
* @return void
*/
public function get_templates( array $templates = [], array $args = [], bool $include = true ) {
foreach ( $templates as $template ) {
$this->get_template( $template, $args, $include );
}
}

/**
Expand Down
6 changes: 3 additions & 3 deletions inc/course/abstract-course.php
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,10 @@ public function get_price() {
*
* @author tungnx
* @since 4.1.5
* @version 1.0.0
* @return mixed|void
* @version 1.0.1
* @return string
*/
public function get_course_price_html() {
public function get_course_price_html(): string {
$price_html = '';

if ( $this->is_free() ) {
Expand Down
1 change: 0 additions & 1 deletion inc/user-item/class-lp-user-item-course.php
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,6 @@ public function get_items( $refresh = false ) {
* Check course is completed or not.
*
* @return bool
* @throws Exception
* @editor tungnx
* @modify 4.1.3
*/
Expand Down

0 comments on commit bd62667

Please sign in to comment.