LearnPress profile tab menu add LearnPress plugin

To add a new tab to the LearnPress profile menu, you can use the learn-press/override-lp-profile-tabs filter hook. Follow these steps:

Step 1: Add a Custom Tab

Add the following code to your theme’s functions.php file:

function custom_learnpress_profile_tab( $tabs ) {
    $tabs['custom-tab'] = array(
        'title'    => __( 'Custom Tab', 'learnpress' ),
        'slug'     => 'custom-tab',
        'callback' => 'custom_learnpress_profile_content'
    );
    return $tabs;
}
add_filter( 'learn-press/profile-tabs', 'custom_learnpress_profile_tab' );

function custom_learnpress_profile_content() {
    echo '<h2>Custom Tab Content</h2>';
    echo '<p>This is the content of the custom tab.</p>';
}

Step 2: Refresh Permalinks

After adding the code:

  1. Go to Settings → Permalinks in WordPress.
  2. Click Save Changes to refresh the permalink structure.

Now, a new “Custom Tab” will appear in the LearnPress Profile Menu, and it will display the custom content.

Let me know if you need modifications! 🚀

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x