Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Need to create a hook for Sensei WordPress


I'm using Sensei from WooThemes, and trying to figure out how to create a hook. The groundwork details:

My site WP version: 3.9.2
Theme: My own theme built on the Roots starter theme
Sense Plugin: latest version (1.6.4 I think)

Issue: There is a link to ask a teacher a question. It's being pulled into the right column of the single course page in Sensei. I want to move it to the left content area. Sensei staff told me the following:

<blockquote>"That button is hooked onto the sensei_course_single_lessons action, so you'd need to unhook it using remove_action, and hook it onto a different action wherever you want it to appear.

See here for more information on available action hooks"</blockquote>

I took a look at the link they gave me, but it's over my head. Can someone create the hook they are talking about for me, and tell me where to place it? And I know you're going to ask "where do you want it to appear?" but I don't know the area in the code, just on the page.

I've attached an image showing where I want the section moved on the screen, in case that helps. The screenshot is of the Sensei Single Course view.

Answers (3)


Remy answers:

Since it's a paid product, I don't have access to the code, so I'm missing a part, but it should go something like this. You can add this code in your functions.php in your theme :

remove_action( 'sensei_course_single_lessons', 'name_of_function_for_button' );
add_action( 'the_content', 'name_of_function_for_button' );

This depends a lot on the name of the function used to display the button, and if sensei really use the_content to display to text you have on your screenshot.


zebra webdesigns answers:

Hello Kyler Just sent PM to you


Arnav Joy answers:

what's url of your site?