Created
January 7, 2025 05:20
-
-
Save vapvarun/9782a66e3bf7be6b4b4b3e2a4e05470e to your computer and use it in GitHub Desktop.
ld_dashboard_add_nav_menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function ld_dashboard_add_nav_menu( $menu_items ) { | |
| $menu_items['all']['hello-world'] = array( | |
| 'url' => get_the_permalink() . '?tab=hello-world', | |
| 'icon' => '<img src="https://via.placeholder.com/24" alt="Hello World Icon">', | |
| 'label' => 'Hello World', | |
| ); | |
| return $menu_items; | |
| } | |
| add_filter( 'learndash_dashboard_nav_menu', 'ld_dashboard_add_nav_menu', 10, 1 ); | |
| function ld_dashboard_after_content_callback() { | |
| if ( isset( $_GET['tab'] ) && 'hello-world' === $_GET['tab'] ) { | |
| echo '<h2>Hello, World!</h2>'; | |
| } | |
| } | |
| add_action( 'ld_dashboard_after_content', 'ld_dashboard_after_content_callback' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment