Skip to content

Commit

Permalink
= 4.2.6.4 =
Browse files Browse the repository at this point in the history
~ Tweak: shortcode Profile.
  • Loading branch information
tungnxt89 committed Mar 14, 2024
1 parent 0d4f7d0 commit 0b3ec4a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions inc/Shortcodes/class-lp-shortcode-profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@ public function output() {
wp_enqueue_script( 'lp-profile' );

try {
if ( ! LP_Page_Controller::is_page_profile() ) {
$customer_message = [
'status' => 'error',
'content' => sprintf(
__( 'This shortcode LP Profile only use on the page <a href="%s">%s</a>', 'learnpress' ),
admin_url( 'admin.php?page=learn-press-settings' ),
'<strong>' . esc_html__( 'Profile', 'learnpress' ) . '</strong>'
)
];
Template::instance()->get_frontend_template( 'global/lp-message.php', compact( 'customer_message' ) );
return ob_get_clean();
}

ob_start();
if ( is_wp_error( $this->can_view_profile() ) ) {
$messages = [
Expand Down

0 comments on commit 0b3ec4a

Please sign in to comment.