AI Verified

Name

Learndash 'my courses' tab on woocommerce my account page

About

Add a short cut to the customers courses from his Woocommerce my acount dashboard.

Language

PHP

Rating

Voted: 0 by 0 user(s)

How to Setup Snippet

just past in.save and activate. After activating flush the permalinks by going to Settings-> permalinks and just press save. This beautiful piece of code i got from @wpsimplehacks on youtube.

Link for further information:

The author has provided the following URL that may be helpful to setting up or using this snippet:

https://youtu.be/Ea-CTqJB8P0

Codevault

sophiemulders

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: 6.1

Our AI bot has checked this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

Website/ Profile URL:

https://sophiemulders.com

Snippet Source:

https://youtu.be/Ea-CTqJB8P0

History

Last modified:

16/04/2023

Important Note

This snippet has the following status:

AI Verified

This snippet has been tested by our AI bot, see any comments below.

AI Bot Comments:

Found 0 vulnerabilities

Learndash 'my courses' tab on woocommerce my account page

 
                    
1// Add new tab to My Account menu - take notice of the language of the site the endpoints can be named differently
2//let op als site op nederlands staat dan zijn de endpoints anders van naam!
3//credit goes to @wpsimplehacks on youtube for the code. check out his amazing challenge.
4 
5 
6// NB! In order to make it work you need to go to Settings > Permalinks and just push "Save Changes" button.
7add_filter ( 'woocommerce_account_menu_items', 'wpsh_custom_endpoint', 40 );
8function wpsh_custom_endpoint( $menu_links ){
9 
10 $menu_links = array_slice( $menu_links, 0, 5, true )
11 // Add your own slug (support, for example) and tab title here below
12 + array( 'my-courses' => 'My courses' )
13 + array_slice( $menu_links, 5, NULL, true );
14 
15 return $menu_links;
16 
17}
18// Let’s register this new endpoint permalink
19 
20add_action( 'init', 'wpsh_new_endpoint' );
21function wpsh_new_endpoint() {
22 add_rewrite_endpoint( 'my-courses', EP_PAGES ); // Don’t forget to change the slug here
23}
24 
25// Now let’s add some content inside your endpoint
26 
27add_action( 'woocommerce_account_my-courses_endpoint', 'wpsh_endpoint_content' ); // If you change your slug above then don’t foget to chagne it alse inside this function
28function wpsh_endpoint_content() {
29 
30 // At the moment I will add Learndash profile with the shordcode
31 echo (
32 '<h3>Here are your courses</h3>
33 <p>Lorem ipsum dolor sit amet consectetur adipiscing elit facilisis tincidunt, nisi sociosqu lacinia auctor inceptos libero conubia accumsan</p>'
34 );
35 echo do_shortcode('[ld_profile]');
36}

0

Related Snippets

Please see some snippets below related to this snippet..

WooCommerce

AI Verified

0

Display All Products Purchased by User

Added: 1 year ago

Last Updated: 1 year ago

WooCommerce

AI Verified

0

Display the Remaining Amount for Free Shipping in the Cart

Added: 10 months ago

Last Updated: 10 months ago

Display the remaining amount for free shipping in the cart.

WooCommerce

AI Verified

0

WooCommerce Subscribe To Emails Checkbox On Checkout

Added: 1 year ago

Last Updated: 1 year ago

Asking users to subscribe to your emails on the checkout page is the perfect place to begin remarketing your store and products to advocates. A paying customer doesn’t need as much convincing to buy a...

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

WooCommerce

AI Verified

1

merge Woocommerce cart with woocommerce checkout

Added: 1 year ago

Last Updated: 1 year ago

Merging the Woocommerce cart with the woocommerce checkout page in 4 steps. Much more userfriendly! Credit goes to @wpsimplehacks on youtube. Brilliant channel

WooCommerce

AI Verified

0

Learndash 'my courses' tab on woocommerce my account page

Added: 1 year ago

Last Updated: 1 year ago

Add a short cut to the customers courses from his Woocommerce my acount dashboard.