View function.php
This file contains 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 | |
/** | |
* Check if a lesson contains a quiz | |
* | |
* @param integer $lesson_id ID of lesson | |
* @return boolean True if lesson contains a quiz, false if not | |
*/ | |
if( ! function_exists( 'sensei_lesson_has_quiz' ) ) { | |
function sensei_lesson_has_quiz( $lesson_id = 0 ) { |
View filter.php
This file contains 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 | |
add_filter( 'sensei_question_image_size', 'custom_sensei_question_image_size', 10, 2 ); | |
function custom_sensei_question_image_size( $size, $question_id ) { | |
$size = 'large'; | |
return $size; | |
} | |
?> |
View function.php
This file contains 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 | |
function sensei_reset_activity( $user_id = 0 ) { | |
// Get all Sensei activities | |
$token = 'sensei_'; | |
$activities = array( 'course_start', 'course_end', 'lesson_start', 'lesson_end', 'quiz_grade', 'quiz_answers', 'quiz_asked' ); | |
if( 0 < intval( $user_id ) ) { | |
$args['user_id'] = intval( $user_id ); | |
} |
View function.php
This file contains 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 | |
add_action( 'init', 'sensei_disable_pass_required_all_lessons' ); | |
function sensei_disable_pass_required_all_lessons() { | |
if( is_admin() ) { | |
return; | |
} | |
global $woothemes_sensei; | |
View function.php
This file contains 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 | |
function prevent_text_link( $str ) { | |
// Get total length of string | |
$strlen = strlen( $str ); | |
// Get number of middle character in string | |
$middle = round( intval( $strlen ) / 2 ); | |
// Loop through each character in the string and add an empty HTML tag in the middle |
View functions.php
This file contains 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 | |
add_filter( 'woocommerce_order_barcodes_do_nonce_check', 'disable_woocommerce_order_barcodes_nonce_check' ); | |
function disable_woocommerce_order_barcodes_nonce_check( $do_check ) { | |
// Do any required pressing here | |
$do_check = false; | |
return $do_check; | |
} | |
?> |
View functions.php
This file contains 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 | |
add_filter( 'sensei_all_access', 'sensei_editor_access' ); | |
function sensei_editor_access( $access ) { | |
if( current_user_can( 'editor' ) ) { | |
$access = true; | |
} | |
return $access; | |
} | |
?> |
View functions.php
This file contains 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 | |
add_filter( 'pre_get_posts', 'sensei_lessons_use_menu_order' ); | |
function sensei_lessons_use_menu_order( $query ) { | |
if( is_admin() || 'lesson' != $query->query_vars['post_type'] ) { | |
return; | |
} | |
$query->set( 'orderby', 'menu_order date' ); | |
} |
View admin.css
This file contains 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
body #menu-posts-forum div.wp-menu-image:before { | |
content: "\f325" !important; | |
} | |
body #menu-posts-topic div.wp-menu-image:before { | |
content: "\f348" !important; | |
} | |
body #menu-posts-reply div.wp-menu-image:before { | |
content: "\f125" !important; | |
} |
View function1.php
This file contains 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 | |
function shortcode_function( $params ) { | |
return "Shortcode content"; | |
} | |
add_shortcode( 'shortcode_name', 'shortcode_function' ); | |
?> |
OlderNewer