| @@ -202,11 +202,11 @@ | ||
| 202 | 202 | if ( $lp_course_item ) { |
| 203 | 203 | $post_type_object = get_post_type_object( $lp_course_item->get_item_type() ); |
| 204 | 204 | |
| 205 | 205 | if ( $post_type_object && current_user_can( |
| 206 | - 'edit_post', | |
| 207 | - $lp_course_item->get_id() | |
| 208 | - ) && $post_type_object->show_in_admin_bar && get_edit_post_link( $lp_course_item->get_id() ) ) { | |
| 206 | + 'edit_post', | |
| 207 | + $lp_course_item->get_id() | |
| 208 | + ) && $post_type_object->show_in_admin_bar && get_edit_post_link( $lp_course_item->get_id() ) ) { | |
| 209 | 209 | $type = get_post_type( $lp_course_item->get_id() ); |
| 210 | 210 | |
| 211 | 211 | if ( apply_filters( 'learn-press/edit-admin-bar-button', true, $lp_course_item ) ) { |
| 212 | 212 | $wp_admin_bar->add_menu( |
| @@ -227,11 +227,11 @@ | ||
| 227 | 227 | $post_type_object = get_post_type_object( $lp_quiz_question->get_item_type() ); |
| 228 | 228 | $edit_post_link = get_edit_post_link( $lp_quiz_question->get_id() ); |
| 229 | 229 | |
| 230 | 230 | if ( $post_type_object && current_user_can( |
| 231 | - 'edit_post', | |
| 232 | - $lp_quiz_question->get_id() | |
| 233 | - ) && $post_type_object->show_in_admin_bar && $edit_post_link ) { | |
| 231 | + 'edit_post', | |
| 232 | + $lp_quiz_question->get_id() | |
| 233 | + ) && $post_type_object->show_in_admin_bar && $edit_post_link ) { | |
| 234 | 234 | $type = get_post_type( $lp_quiz_question->get_id() ); |
| 235 | 235 | $wp_admin_bar->add_menu( |
| 236 | 236 | array( |
| 237 | 237 | 'id' => 'edit-' . $type, |
| @@ -640,9 +640,9 @@ | ||
| 640 | 640 | |
| 641 | 641 | /** |
| 642 | 642 | * Show message only one time. |
| 643 | 643 | * @return void |
| 644 | - * @version 1.0.0 | |
| 644 | + * @version 1.0.1 | |
| 645 | 645 | * @since 4.2.0 |
| 646 | 646 | */ |
| 647 | 647 | function learn_press_show_message() { |
| 648 | 648 | try { |
| @@ -655,9 +655,13 @@ | ||
| 655 | 655 | |
| 656 | 656 | unset( $message_data[ $customer_id ] ); |
| 657 | 657 | update_option( 'lp-customer-message', $message_data ); |
| 658 | 658 | //delete_option( 'lp-message' ); |
| 659 | - Template::instance()->get_frontend_template( 'global/lp-message.php', compact( 'customer_message' ) ); | |
| 659 | + //Template::instance()->get_frontend_template( 'global/lp-message.php', compact( 'customer_message' ) ); | |
| 660 | + Template::print_message( | |
| 661 | + $customer_message['content'] ?? '', | |
| 662 | + $customer_message['status'] ?? '' | |
| 663 | + ); | |
| 660 | 664 | } catch ( Throwable $e ) { |
| 661 | 665 | error_log( $e->getMessage() ); |
| 662 | 666 | } |
| 663 | 667 | } |
| @@ -1550,9 +1554,9 @@ | ||
| 1550 | 1554 | function lp_get_email_content( $format, $meta = array(), $field = array() ) { |
| 1551 | 1555 | if ( $meta && isset( $meta[ $format ] ) ) { |
| 1552 | 1556 | $content = stripslashes( $meta[ $format ] ); |
| 1553 | 1557 | } else { |
| 1554 | - $template = ! empty( $field["template_{$format}"] ) ? $field["template_{$format}"] : null; | |
| 1558 | + $template = ! empty( $field[ "template_{$format}" ] ) ? $field[ "template_{$format}" ] : null; | |
| 1555 | 1559 | $template_file = $field['template_base'] . $template; |
| 1556 | 1560 | $content = LP_WP_Filesystem::instance()->file_get_contents( $template_file ); |
| 1557 | 1561 | } |
| 1558 | 1562 | |