PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.1
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.1
4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 4.2.1 All 138 releases
learnpress / templates / global / message.php

message.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.1, at templates/global/message.php

62 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Template for displaying global message.
4 *
5 * This template can be overridden by copying it to yourtheme/learnpress/global/message.php.
6 *
7 * @author ThimPress
8 * @package Learnpress/Templates
9 * @version 3.0.0
10 */
11
12
13 defined( 'ABSPATH' ) || exit();
14
15 if ( ! isset( $messages ) ) {
16 return;
17 }
18 ?>
19
20 <?php foreach ( $messages as $type => $message ) { ?>
21 <?php if ( $message ) { ?>
22 <?php foreach ( $message as $content ) { ?>
23 <?php
24 $options = array();
25
26 if ( is_array( $content ) ) {
27 $options = $content['options'];
28 $content = $content['content'];
29 $options = wp_parse_args(
30 $options,
31 array(
32 'position' => '',
33 'delay-in' => 0,
34 'delay-out' => 0,
35 )
36 );
37 }
38
39 $classes = array( 'learn-press-message', esc_attr( $type ) );
40 $data = array();
41
42 if ( ! empty( $options['position'] ) ) {
43 $classes[] = $options['position'];
44 if ( ! empty( $options['delay-in'] ) ) {
45 $data[] = sprintf( 'data-delay-in="%s"', $options['delay-in'] );
46 }
47
48 if ( ! empty( $options['delay-in'] ) ) {
49 $data[] = sprintf( 'data-delay-out="%s"', $options['delay-out'] );
50 }
51 }
52 ?>
53 <div class="<?php echo esc_attr( join( ' ', $classes ) ); ?>" <?php echo esc_attr( $data ? join( ' ', $data ) : '' ); ?>>
54 <?php echo apply_filters( 'learn-press/message', wp_kses_post( $content ), $content ); ?>
55 </div>
56
57 <?php } ?>
58
59 <?php } ?>
60
61 <?php } ?>
62