|
| 1 | +# Custom Template for LearnDash |
| 2 | + |
| 3 | +## Project Overview |
| 4 | + |
| 5 | +Custom Template for LearnDash is a WordPress plugin by Brainstorm Force. Replace default LearnDash course template for non-enrolled students with a custom page-builder template. |
| 6 | + |
| 7 | +- **Version:** 1.0.7 |
| 8 | +- **Text Domain:** custom-template-learndash |
| 9 | +- **Main File:** custom-template-learndash.php |
| 10 | +- **Requires:** WordPress, PHP 5.6+ |
| 11 | + |
| 12 | +## Tech Stack |
| 13 | + |
| 14 | +- **Language:** PHP |
| 15 | +- **Platform:** WordPress |
| 16 | +- **Build:** Grunt (i18n, readme conversion) |
| 17 | +- **Coding Standards:** PHPCS with WordPress standards |
| 18 | + |
| 19 | +## Commands |
| 20 | + |
| 21 | +```bash |
| 22 | +# Install dependencies |
| 23 | +npm install |
| 24 | +composer install |
| 25 | + |
| 26 | +# Build (i18n + readme) |
| 27 | +npx grunt |
| 28 | + |
| 29 | +# Generate translations |
| 30 | +npx grunt i18n |
| 31 | + |
| 32 | +# Convert readme.txt to README.md |
| 33 | +npx grunt readme |
| 34 | + |
| 35 | +# Run PHPCS |
| 36 | +./vendor/bin/phpcs . |
| 37 | +``` |
| 38 | + |
| 39 | +## Architecture |
| 40 | + |
| 41 | +This is a WordPress plugin following standard WordPress patterns: |
| 42 | +- Entry point: `custom-template-learndash.php` |
| 43 | +- Constants defined for version, file path, base, dir, and URI |
| 44 | +- Classes loaded via `after_setup_theme` or `plugins_loaded` hook |
| 45 | +- Follows WordPress Coding Standards (WPCS) |
| 46 | + |
| 47 | +## Conventions |
| 48 | + |
| 49 | +- Use WordPress hooks (`add_action`, `add_filter`) for extensibility |
| 50 | +- Prefix all functions and classes to avoid conflicts |
| 51 | +- Use `custom-template-learndash` text domain for all translatable strings |
| 52 | +- Escape all output (`esc_html`, `esc_attr`, `esc_url`, `wp_kses`) |
| 53 | +- Sanitize all input (`sanitize_text_field`, `absint`, etc.) |
| 54 | +- Use nonces for form submissions and AJAX requests |
| 55 | +- Follow WordPress PHP coding standards |
0 commit comments