Created
April 25, 2014 14:16
-
-
Save pascallaliberte/d86ef047f2c064f3717d to your computer and use it in GitHub Desktop.
Creating a Wordpress admin dashboard widget to embed a WaxLRS report
This file contains 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
<?php | |
/** | |
* Add a widget to the admin dashboard. | |
* | |
* This function is hooked into the 'wp_dashboard_setup' action below. | |
* Add this to your theme's functions.php | |
*/ | |
function lrs_most_popular_widgets() { | |
wp_add_dashboard_widget( | |
'lrs_most_popular', // Widget slug. | |
'Most Popular Courses', // Title. | |
'lrs_most_popular_function' // Display function. | |
); | |
} | |
add_action( 'wp_dashboard_setup', 'lrs_most_popular_widgets' ); | |
/** | |
* Create the function to output the contents of our Dashboard Widget. | |
*/ | |
function lrs_most_popular_function() { | |
echo do_shortcode( | |
"[lti-launch consumer_key=REMOVED secret_key=REMOVED display=iframe launch_url=https://uomed.waxlrs.com/embed/mostpopular resource_link_id=lrs_most_popular]" | |
); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment