I'm making a small

I'm making a small change to coursepress whereby I put a popup on the units link in the submenu but I can't find where the submenu is created.

The learners we have are clicking on the units link without saving their work, so I'm adding a warning basically.

  • Luís
    • Support

    Hi Martin ,

    Hope you're doing well today!

    If I am not missing somethig, that submenu is generated by a shortcode and can be found in /wp-content/plugins/coursepress/2.0/include/coursepress/template/class-unit.php around the line 498. So, its not created via WordPress admin dashboard.

    I hope this information has been helpful. If you still need guidance in your customization or in how to achieve your goal, please let us know!

    Cheers, Luís

  • Martin
    • WPMU DEV Initiate

    Hi Luís,

    I'm doing well, hope you're having a good day too!

    Thanks for the help, this is exactly what I need for the next step, but I (think, please correct me if I'm wrong) need to edit the shortcode to add a warning the first time it's clicked and then functioning like normal on second click. So with regards to that, I'd need to find where (or first, how I guess) the shortcode is created.

    I could be way off though, I'm in no way familiar with wordpress and have only edited small bits of php rather than actually learning it. Any assistance in achieving my goal would be amazing!

    Thanks,
    Rob (on behalf of Martin)

  • Nithin
    • Support Wizard

    Hi Martin,

    So with regards to that, I'd need to find where (or first, how I guess) the shortcode is created.

    You can find that under:
    /wp-contnent/plugins/coursepress/2.0/include/coursepress/data/shortcode/class-unit.php

    Where the function on line 104:
    public static function course_unit_submenu( $atts ) {

    Is what gets called when [course_unit_submenu] shortcode is called.

    I hope this helps. Please let us know if you have any further query. Have a nice day ahead. :slight_smile:

    Regards,
    Nithin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.