Title: Call functions via shortcode
Last modified: May 17, 2022

---

# Call functions via shortcode

 *  Resolved [bbua97](https://wordpress.org/support/users/bbua97/)
 * (@bbua97)
 * [4 years ago](https://wordpress.org/support/topic/call-functions-via-shortcode/)
 * Hey there,
 * I want do adjust the course (single) page a little bit. There are some functions
   in your plugin for example [this one](https://automattic.github.io/sensei/includes_class-sensei-lesson.php.html#line3345).
   Can I call this function via my functions.php file to use it then in a shortcode
   anywhere on the template?

Viewing 1 replies (of 1 total)

 *  Plugin Support [Jay](https://wordpress.org/support/users/bluejay77/)
 * (@bluejay77)
 * [4 years ago](https://wordpress.org/support/topic/call-functions-via-shortcode/#post-15661701)
 * Hi [@bbua97](https://wordpress.org/support/users/bbua97/),
 * Please note that our support policy does not include assistance with customizations,
   so we will be unable to assist with modifying or debugging custom code, as noted
   here:
 * [https://senseilms.com/documentation/theming-customization/](https://senseilms.com/documentation/theming-customization/)
 * That said, a short answer is yes, you could call any public function and use 
   it to your needs.
 * I can see that the link you provided is pointing to the `Sensei_Lesson class`,
   so that could be accessed using `Sensei()->lesson`. For example if you want to
   call the `Sensei_Lesson::lesson_count` method, you should do it like this: `Sensei()-
   >lesson->lesson_count()`.
 * I hope that helps!

Viewing 1 replies (of 1 total)

The topic ‘Call functions via shortcode’ is closed to new replies.

 * ![](https://ps.w.org/sensei-lms/assets/icon-128x128.gif?rev=2914239)
 * [Sensei LMS - Online Courses, Quizzes, & Learning](https://wordpress.org/plugins/sensei-lms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/sensei-lms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/sensei-lms/)
 * [Active Topics](https://wordpress.org/support/plugin/sensei-lms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sensei-lms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sensei-lms/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Jay](https://wordpress.org/support/users/bluejay77/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/call-functions-via-shortcode/#post-15661701)
 * Status: resolved