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
/** | |
* Enrolled Course Shortcode | |
*/ | |
function tutor_enrolled_course_register_shortcodes() { | |
add_shortcode( 'enrolled-course', 'shortcode_tutor_enrolled_course' ); | |
} | |
add_action( 'init', 'tutor_enrolled_course_register_shortcodes' ); | |
/** |
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
//***Need to override tutor-course.php file from plugins-> tutor->templates-> shortcode | |
<?php | |
/** | |
* @package TutorLMS/Templates | |
* @version 1.4.3 | |
*/ | |
$column_per_row = $GLOBALS['tutor_shortcode_arg']['column_per_row']; |
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
//need to replace 262-263 line with this code in the templates->course-course-list.php file | |
<div class="tutor-course-loop-price"> | |
<?php | |
$course_id = get_the_ID(); | |
$is_public = get_post_meta( $course_id, '_tutor_is_public_course', true )=='yes'; | |
$enroll_btn = '<div class="tutor-public-course-start-learning">' . apply_filters( 'tutor_course_restrict_new_entry', '<a href="'. get_the_permalink(). '">' . __('Get Enrolled', 'tutor') . '</a>' ) . '</div>'; | |
$default_price = apply_filters('tutor-loop-default-price', ($is_public ? '' : __('Free', 'tutor') )); | |
$free_html = '<div class="price"> '.$default_price.$enroll_btn. '</div>'; | |
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 | |
/** | |
* Class Ajax | |
* | |
* @package Tutor\Certificate\Builder | |
* @author Themeum <[email protected]> | |
* @license GPLv2 or later | |
* @link https://www.themeum.com/product/tutor-lms/ | |
* @since 1.0.0 |
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
add_action('after_setup_theme', 'remove_admin_bar'); | |
function remove_admin_bar() { | |
if (!current_user_can('administrator') && !is_admin()) { | |
show_admin_bar(false); | |
} | |
} | |
add_action( 'init', 'blockusers_init' ); function blockusers_init() { if ( is_admin() && ! current_user_can( 'administrator' ) && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { wp_redirect( home_url() ); exit; } } |
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 | |
$filter_object = new \TUTOR\Course_Filter(); | |
// $filter_levels = array( | |
// 'beginner' => __('Beginner', 'tutor'), | |
// 'intermediate' => __('Intermediate', 'tutor'), | |
// 'expert' => __('Expert', 'tutor') | |
// ); | |
$filter_prices = array( | |
'free' => __('Free', 'tutor'), | |
'paid' => __('Paid', 'tutor'), |
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
function my_custom_css() { | |
echo '<style> | |
.post-type-product #ovaem_sectionid { | |
display: none !important; | |
} | |
</style>'; | |
} | |
add_action('admin_head', 'my_custom_css' ); |
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
## ---- 1. Backend ---- ## | |
// Adding a custom Meta container to admin products pages | |
add_action('add_meta_boxes', 'create_custom_meta_box'); | |
if (!function_exists('create_custom_meta_box')) { | |
function create_custom_meta_box() | |
{ | |
add_meta_box( | |
'custom_product_meta_box', | |
__(' Product Main URL <em>(orginal)</em>', 'cmb'), |
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
function custom_scripts_method() { | |
/* CSS */ | |
wp_enqueue_style( 'custom-style', home_url('/wp-content/plugins/qubely/assets/css/qubely.bundle.min.css')); | |
} | |
add_action( 'wp_enqueue_scripts', 'custom_scripts_method' ); |