estebantoloza
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
I have done something like this:
add_action('tutor_course/archive/before_loop', 'custom_course_loop_for_enrolled_users'); function custom_course_loop_for_enrolled_users() { // Check if the user is logged in $user_id = get_current_user_id(); if ($user_id) { // Get the enrolled courses of the current user $enrolled_courses = tutor_utils()->get_enrolled_courses_by_user($user_id, array('private', 'publish')); // Check if there are enrolled courses if ($enrolled_courses && $enrolled_courses->have_posts()) { // Set the global loop variable to avoid issues with other template elements global $wp_query; $wp_query = $enrolled_courses; } else { // If the user is not enrolled in any course, set an empty query to not display any content global $wp_query; $wp_query = new WP_Query(array('post_type' => 'tutor_course', 'post_status' => 'publish', 'posts_per_page' => 0)); } } else { // If the user is not logged in, set an empty query to not display any content global $wp_query; $wp_query = new WP_Query(array('post_type' => 'tutor_course', 'post_status' => 'publish', 'posts_per_page' => 0)); } }
works fine for the initial query, but the filters don’t work. Could you guide me on how to move forward?
Thank you very much for your answer. Could you please provide me with the condition to add to get only the courses the student enrolled in?
Forum: Plugins
In reply to: [Mercado Pago payments for WooCommerce] Estado de pago no se actualizaTengo el mismo inconveniente, y revisando el historial veo que hay muchos reclamos similares de los últimos meses, por lo que entiendo que es un problema del plugin. Siendo un plugin gratuito y disponible en el repositorio público de WordPress, deberían brindar una solución por éste medio en lugar de mandar a todos a comunicarse mediante su canal cerrado de contacto.
Thank you very much for your reply! I added the snippet and it solved the problem.
Viewing 4 replies - 1 through 4 (of 4 total)