Learn in WordPress
Just a demo of an idea: A learning platform framework for WordPress that allows plugins to register interactive lessons and tracks user progress
★ 3stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/akirk/learn-in-wordpress/archive/refs/heads/main.zipA learning platform framework for WordPress that allows plugins to register interactive lessons and tracks user progress.
Try it in WordPress Playground
Features
- Lesson Registration API - Plugins can register lessons with custom content and verification callbacks
- Progress Tracking - Tracks completed lessons per user in a dedicated database table
- Admin Interface - Built-in admin page under "Learn" menu for browsing and completing lessons
- Task Verification - Lessons can include verification callbacks to validate user completion
Screenshots
Usage
Registering a Lesson
Plugins can register lessons using the learn_in_wp_register_lessons action:
add_action( 'learn_in_wp_register_lessons', function( $learn_in_wp ) {
$learn_in_wp->register_lesson( array(
'id' => 'my-lesson',
'title' => 'My Lesson Title',
'description' => 'A brief description of the lesson.',
'content' => '<p>The full lesson content with HTML.</p>',
'plugin' => 'my-plugin',
'category' => 'general',
'order' => 10,
'verify' => 'my_verification_callback',
) );
} );
Verification Callback
The verification callback should return an array with success (boolean) and message (string):
function my_verification_callback() {
// Check if the user completed the task
$completed = /* your verification logic */;
return array(
'success' => $completed,
'message' => $completed
? 'Great job! You completed the lesson.'
: 'Not quite. Please try again.',
);
}
Requirements
- WordPress 5.0+
- PHP 7.0+
License
GPL-2.0+