Forked from andrewlimaza/move-pmpro-content-higher.php
Last active
July 31, 2025 09:59
-
-
Save dwanjuki/a9e1e28dfd168a454eac0fedb667b24b to your computer and use it in GitHub Desktop.
Move the content restricted message higher up the course content for LifterLMS
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
| <?php | |
| /** | |
| * Move the Paid Memberships Pro content restricted message higher up in LifterLMS course content. | |
| * This requires "Course Information" block to be on the page and shown before this using jQuery. | |
| * Tweak this jQuery code to fit your needs and move the content higher up. | |
| * | |
| * To add the code to your site you may follow this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_move_pmpro_div_with_jquery_llms() { | |
| ?> | |
| <script type="text/javascript"> | |
| jQuery(document).ready(function ($) { | |
| if ($('article').hasClass('course')) { | |
| console.log('has class'); | |
| if ($('.entry-title').length && $('.pmpro').length) { | |
| console.log('length passed'); | |
| $('.pmpro').insertBefore('.wp-block-llms-course-syllabus'); | |
| } | |
| } | |
| }); | |
| </script> | |
| <?php | |
| } | |
| add_action('wp_footer', 'my_move_pmpro_div_with_jquery_llms'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment