Skip to content

Commit ddc55db

Browse files
committed
Structure, readme, private areas demo file.
1 parent c59fbc3 commit ddc55db

File tree

18 files changed

+128
-5
lines changed

18 files changed

+128
-5
lines changed

README.md

+58-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,61 @@
1-
LifterLMS Snippets
2-
==================
1+
# Snippets Library for LifterLMS and related Add-ons
32

4-
Code snippets, tweaks, and hook examples for LifterLMS and LifterLMS add-ons
3+
We are aiming to collect all of the most useful Gists and Snippets here in one place.
54

6-
---
5+
A few of the benefits of this collection will be:
76

8-
These code snippets are shared *as is* without warranty. These snippets serve as examples and many of them are largely untested.
7+
* **Quality Assurance:** Each snippet will get code reviewed for quality and compatibility
8+
* **Access:** Easy to search via GitHub (or locally)
9+
* **Offline Access:** Easy to checkout this repo locally by the team as needed
10+
* **Maintainability:** One place to update as changes are needed going forward for any snippet (not stuck on any one GitHub user account)
11+
12+
A snippet should contain the full functionality — we should avoid having two separate snippets that rely on one another to achieve the desired result.
13+
14+
These code snippets are shared *as is* without warranty.
15+
16+
## Submitting new snippets or changes
17+
18+
1. Go to the folder (or create a new path) for where you want to add/change a snippet.
19+
2. Create a fork and submit Pull Request with your snippet work. Never use underscores in snippet file names or folder names.
20+
3. The PR will be code reviewed.
21+
4. In the mean time, you can provide customers with your own Gist URL of the snippet.
22+
5. After PR is approved, the snippet will be merged.
23+
6. Now the snippet is ready for inclusion on our site!
24+
25+
## Header Layout for snippets
26+
Please include the following header format when submitting a snippet
27+
```
28+
/**
29+
* Describe what the snippet does in one sentence. (i.e. Add a checkbox to the checkout page.)
30+
*
31+
* Learn more at: https://lifterlms.com/link-to-content-if-available-or-remove-this-line/
32+
*
33+
* You can add this recipe to your site by creating a custom plugin
34+
* or using the Code Snippets plugin available for free in the WordPress repository.
35+
* Read this companion documentation for step-by-step directions on either method.
36+
* https://lifterlms.com/docs/adding-custom-code/
37+
*/
38+
```
39+
40+
## Choosing the "Collection" and Organizing Folders
41+
42+
The snippet folder should match the plugin this code modifies. For example, if the snippet modifies a direct behavior of the LifterLMS core course catalog, place the snippet in the "lifterlms/course-catalog" folder. If the snippet modifies a setting or adds content to a LifterLMS screen in the WordPress admin, while this may affect frontend components, it belongs in the "lifterlms/admin-pages" folder.
43+
44+
Choose the folder and subfolder that your snippet integrates with directly.
45+
46+
- **Folders for Each Add On**: Anything related to an Add-on. Create a folder for the Add On that exactly matches the Add-on's folder name/slug.
47+
- **Folders for core LifterLMS**: Anything related to core LifterLMS. Use the subfolders for deeper structure.
48+
- **admin-pages**: Snippets that modify the core LifterLMS plugin's admin area under Memberships > Settings.
49+
- **blocks-shortcodes**: Snippets that adjust core LifterLMS block functionality or shortcode functionality OR snippets that add new custom block or shortcode features.
50+
- **courses-lessons**: Snippets that adjust core LifterLMS course catalog, single course pages, and single lesson pages.
51+
- **email**: Snippets that adjust how emails are sent, the email contents, adding additional emails, etc.
52+
- **frontend-pages**: Snippets that modify how the frontend pages appear and the contents on the frontend pages.
53+
- **memberships**: Snippets that adjust core LifterLMS membership features, memberships catalog, and single membership pages.
54+
- **orders**: Functionality that hooks into order updates, creation, changes, etc.
55+
- **payment-gateways**: Anything that modifies or extends payment gateway functionality. Create a subfolder for each gateway that exactly matches the gateway name in core LifterLMS.
56+
- **quizzes**: Snippets that adjust quiz functionality.
57+
- **localization**: Snippets related to translating LifterLMS terms to other languages or using translation functions to change plugin language.
58+
- **plugin-compatibility**: Basic snippets that integrate core LifterLMS with other plugins to resolve issues or bridge functionality.
59+
- **sql**: Queries that you can run in your WordPress site's MySQL database.
60+
- **theme-compatibility**: Basic snippets that support using LifterLMS and Add-ons with other themes to resolve issues or bridge functionality.
61+
- **wordpress**: This collection is general WordPress functions that don't belong into any created collections.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
/**
3+
* Customize the number of comments shown per page with LifterLMS Private Areas.
4+
*
5+
* Learn more at: https://lifterlms.com/docs/private-areas-filters/
6+
*
7+
* You can add this recipe to your site by creating a custom plugin
8+
* or using the Code Snippets plugin available for free in the WordPress repository.
9+
* Read this companion documentation for step-by-step directions on either method.
10+
* https://lifterlms.com/docs/adding-custom-code/
11+
*/
12+
function my_llms_pa_comments_per_page( $number ) {
13+
return 100;
14+
}
15+
add_filter( 'llms_pa_comments_per_page', 'my_llms_pa_comments_per_page', 10, 1 );

lifterlms/.DS_Store

8 KB
Binary file not shown.

lifterlms/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Snippets Library for LifterLMS - Core LifterLMS
2+
3+
Anything related to core LifterLMS. Use the subfolders for deeper structure.
4+
5+
- **admin-pages**: Snippets that modify the core LifterLMS plugin's admin area under Memberships > Settings.
6+
- **blocks-shortcodes**: Snippets that adjust core LifterLMS block functionality or shortcode functionality OR snippets that add new custom block or shortcode features.
7+
- **courses-lessons**: Snippets that adjust core LifterLMS course catalog, single course pages, and single lesson pages.
8+
- **email**: Snippets that adjust how emails are sent, the email contents, adding additional emails, etc.
9+
- **frontend-pages**: Snippets that modify how the frontend pages appear and the contents on the frontend pages.
10+
- **memberships**: Snippets that adjust core LifterLMS membership features, memberships catalog, and single membership pages.
11+
- **orders**: Functionality that hooks into order updates, creation, changes, etc.
12+
- **payment-gateways**: Anything that modifies or extends payment gateway functionality. Create a subfolder for each gateway that exactly matches the gateway name in core LifterLMS.
13+
- **quizzes**: Snippets that adjust quiz functionality.

lifterlms/admin-pages/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Snippets Library for LifterLMS - Admin Pages
2+
3+
Snippets that modify the core LifterLMS plugin's admin area under Memberships > Settings.

lifterlms/blocks-shortcodes/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Snippets Library for LifterLMS - Blocks and Shortcodes
2+
3+
Snippets that adjust core LifterLMS block functionality or shortcode functionality OR snippets that add new custom block or shortcode features.

lifterlms/courses-lessons/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Snippets Library for LifterLMS - Courses & Lessons
2+
3+
Snippets that adjust core LifterLMS course catalog, single course pages, and single lesson pages.

lifterlms/email/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Snippets Library for LifterLMS - Email
2+
3+
Snippets that adjust how emails are sent, the email contents, adding additional emails, etc.

lifterlms/frontend-pages/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Snippets Library for LifterLMS - Frontend Pages
2+
3+
Snippets that modify how the frontend pages appear and the contents on the frontend pages.

lifterlms/localization/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Snippets Library for LifterLMS - Localization
2+
3+
Snippets related to translating the core LifterLMS plugin's terms to other languages or using translation functions to change core plugin language.

lifterlms/memberships/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Snippets Library for LifterLMS - Memberships
2+
3+
Snippets that adjust core LifterLMS membership features, memberships catalog, and single membership pages.

lifterlms/orders/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Snippets Library for LifterLMS - Orders
2+
3+
Functionality that hooks into order updates, creation, changes, etc.

lifterlms/payment-gateways/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Snippets Library for LifterLMS - Payment Gateways
2+
3+
Anything that modifies or extends payment gateway functionality. Create a subfolder for each gateway that exactly matches the gateway name in core LifterLMS.

lifterlms/quizzes/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Snippets Library for LifterLMS - Quizzes
2+
3+
Snippets that adjust quiz functionality.

plugin-compatibility/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Snippets Library for LifterLMS - Plugin Integration & Compatibility
2+
3+
Basic snippets that integrate core LifterLMS with other plugins to resolve issues or bridge functionality.

sql/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Snippets Library for LifterLMS - SQL
2+
3+
Queries that you can run in your WordPress site's MySQL database.

theme-compatibility/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Snippets Library for LifterLMS - Theme Integration & Compatibility
2+
3+
Basic snippets that support using LifterLMS and Add-ons with other themes to resolve issues or bridge functionality.

wordpress/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Snippets Library for LifterLMS - General WordPress
2+
3+
This collection is general WordPress functions that don't belong into any created collections.

0 commit comments

Comments
 (0)