Skip to content

Instantly share code, notes, and snippets.

@rali14
rali14 / praytimes.js
Created November 18, 2020 21:44
PrayTimes
//--------------------- Copyright Block ----------------------
/*
PrayTimes.js: Prayer Times Calculator (ver 2.3)
Copyright (C) 2007-2011 PrayTimes.org
Developer: Hamid Zarrabi-Zadeh
License: GNU LGPL v3.0
TERMS OF USE:
@rali14
rali14 / functions.php
Last active August 5, 2020 19:08
Redirect user to a specific URL if logged in from another specific URL
/**
* Redirect user to a specific URL if logged in from another specific URL
*
* @param string $redirect_to URL to redirect to.
* @param string $request URL the user is coming from.
* @param object $user Logged user's data.
* @return string
*
* Author: Rashid - https://w3plus.ca
*/
@rali14
rali14 / functions.php
Last active April 4, 2020 00:11
Shortcode to display Course Tags - LearnDash
function ld_display_course_tags ($atts) {
$terms = get_the_terms( get_the_ID() , 'ld_course_tags' );
if (!$terms) {
// No terms, so just quit.
return false;
}
$tags= "";
foreach ( $terms as $term ) {
@rali14
rali14 / functions.php
Last active August 14, 2023 04:16
Shortcode to Display Course Categories
function ld_display_course_categories ($atts) {
$terms = get_the_terms( get_the_ID() , 'ld_course_category' );
if (!$terms) {
// No terms, so just quit.
return false;
}
$categories= "";
foreach ( $terms as $term ) {
@rali14
rali14 / style.css
Created March 26, 2020 16:31
Hide Certificates and Points from LearnDash Profile
/*
* Custom CSS
* Added by: LearnDash Customer Support
*
*/
/* Remove points */
.learndash-wrapper .ld-profile-summary .ld-profile-stats .ld-profile-stat:last-child {
display: none;
}
@rali14
rali14 / style.css
Created March 26, 2020 16:27
Hide graded disclaimer
/*
* Custom CSS
* Added by: LearnDash Customer Support
*
*/
.graded-disclaimer {
display: none;
}
@rali14
rali14 / gist:4aa8bcc569126cf1509d5d5fce5edaf5
Created March 18, 2020 17:12
Hide notices from WP-Admin
add_action('admin_head', 'my_custom_fonts');
function my_custom_fonts() {
echo '<style>
.notice-error {
display: none;
}
</style>';
}
@rali14
rali14 / style.css
Created March 4, 2020 02:54
Hide the scoring columns from the quiz (appropriate for Survey type questions) in LearnDash
#wpProQuiz_user_content tr.categoryTr {
display: none;
}
#wpProQuiz_user_content tr > th, #wpProQuiz_user_content thead th {
display:none;
}
#wpProQuiz_user_content thead th:nth-child(1), #wpProQuiz_user_content thead th:nth-child(2) {
display: table-cell;
@rali14
rali14 / profile.php
Created February 13, 2020 19:29
Change the order of first name and last name in LearnDash Profile
<?php
/**
* Displays a user's profile.
*
* Available Variables:
*
* $user_id : Current User ID
* $current_user : (object) Currently logged in user object
* $user_courses : Array of course ID's of the current user
* $quiz_attempts : Array of quiz attempts of the current user
@rali14
rali14 / quiz.php
Created September 26, 2019 01:49
Display the number of quiz attempts left on the quiz page.
<?php
/**
* Displays a quiz.
*
* Available Variables:
*
* $course_id : (int) ID of the course
* $course : (object) Post object of the course
* $course_settings : (array) Settings specific to current course
* $course_status : Course Status