Fix parsing arguments in shortcode

This commit is contained in:
Champ Camba
2018-01-15 19:27:30 +08:00
parent 9da2a73bb9
commit 854a0b77f7
+12 -8
View File
@@ -141,22 +141,26 @@ if ( ! class_exists( 'Shortcodes' ) ) {
/***
*** @load a compatible template
*/
function load_template($tpl) {
$loop = ($this->loop) ? $this->loop : array();
function load_template( $tpl ) {
$loop = ( $this->loop ) ? $this->loop : array();
if (isset($this->set_args) && is_array($this->set_args)) {
if ( isset( $this->set_args ) && is_array( $this->set_args ) ) {
$args = $this->set_args;
extract($args);
unset( $args['file'] );
unset( $args['theme-file'] );
extract( $args );
}
$file = um_path . 'templates/' . $tpl . '.php';
$theme_file = get_stylesheet_directory() . '/ultimate-member/templates/' . $tpl . '.php';
$file = um_path . "templates/{$tpl}.php";
$theme_file = get_stylesheet_directory() . "/ultimate-member/templates/{$tpl}.php";
if (file_exists($theme_file)) {
if ( file_exists( $theme_file ) ) {
$file = $theme_file;
}
if (file_exists($file)) {
if ( file_exists( $file ) ) {
include $file;
}