| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template for displaying user profile content. |
| 4 |
* |
| 5 |
* This template can be overridden by copying it to yourtheme/learnpress/profile/content.php. |
| 6 |
* |
| 7 |
* @author ThimPress |
| 8 |
* @package Learnpress/Templates |
| 9 |
* @version 4.0.1 |
| 10 |
*/ |
| 11 |
|
| 12 |
defined( 'ABSPATH' ) || exit(); |
| 13 |
|
| 14 |
/** |
| 15 |
* @var LP_Profile_Tab $profile_tab |
| 16 |
*/ |
| 17 |
if ( ! isset( $user ) || ! isset( $tab_key ) || ! isset( $profile ) || ! isset( $profile_tab ) ) { |
| 18 |
return; |
| 19 |
} |
| 20 |
?> |
| 21 |
|
| 22 |
<article id="profile-content" class="lp-profile-content"> |
| 23 |
<?php learn_press_print_messages( true ); ?> |
| 24 |
<div id="profile-content-<?php echo esc_attr( $tab_key ); ?>"> |
| 25 |
<?php do_action( 'learn-press/before-profile-content', $tab_key, $profile_tab, $user ); ?> |
| 26 |
|
| 27 |
<?php |
| 28 |
if ( empty( $profile_tab->get( 'sections' ) ) ) { |
| 29 |
if ( $profile_tab->get( 'callback' ) && is_callable( $profile_tab->get( 'callback' ) ) ) { |
| 30 |
echo call_user_func_array( $profile_tab->get( 'callback' ), array( $tab_key, $profile_tab, $user ) ); |
| 31 |
} else { |
| 32 |
do_action( 'learn-press/profile-content', $tab_key, $profile_tab, $user ); |
| 33 |
} |
| 34 |
} else { |
| 35 |
foreach ( $profile_tab->get( 'sections' ) as $key => $section ) { |
| 36 |
if ( $profile->get_current_section( '', false, false ) === $section['slug'] ) { |
| 37 |
if ( isset( $section['callback'] ) && is_callable( $section['callback'] ) ) { |
| 38 |
echo call_user_func_array( $section['callback'], array( $key, $section, $user ) ); |
| 39 |
} else { |
| 40 |
do_action( 'learn-press/profile-section-content', $key, $section, $user ); |
| 41 |
} |
| 42 |
} |
| 43 |
} |
| 44 |
} |
| 45 |
?> |
| 46 |
|
| 47 |
<?php do_action( 'learn-press/after-profile-content' ); ?> |
| 48 |
</div> |
| 49 |
</article> |
| 50 |
|