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 | |
/** | |
* This is free and unencumbered software released into the public domain. | |
* | |
* Anyone is free to copy, modify, publish, use, compile, sell, or | |
* distribute this software, either in source code form or as a compiled | |
* binary, for any purpose, commercial or non-commercial, and by any | |
* means. | |
* |
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 | |
global $wpdb; | |
global $woothemes_sensei; | |
$current_uid = $_GET['uid']; | |
$all_lessons = $wpdb->get_results("SELECT * FROM `wp_posts` WHERE `post_type` = 'lesson'"); |
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 | |
session_start(); | |
// Start the session | |
//header file | |
$language = $_GET['lang']; | |
$languagestart = '?lang='; | |
$newlanguage = $languagestart.$language; |
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 json_response($message = null, $code = 200) | |
{ | |
// clear the old headers | |
header_remove(); | |
// set the actual code | |
http_response_code($code); | |
// set the header to make sure cache is forced | |
header("Cache-Control: no-transform,public,max-age=300,s-maxage=900"); |
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 | |
// Load WordPress | |
require_once 'path/to/www/wp-load.php'; | |
require_once ABSPATH . '/wp-admin/includes/taxonomy.php'; | |
// Set the timezone so times are calculated correctly | |
date_default_timezone_set('Europe/London'); | |
// Create post |
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 | |
//DELETE SCRIPT CUSTOM TABLE | |
//CERTIFICATE UPLOADS | |
$uid = $_GET['uid']; | |
$cert = $_GET['cert']; | |
$table = 'wp_certdatabase'; | |
$wpdb->delete( $table, array( 'filename' => $cert ) ); | |
echo "Delete successful!"; |
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
add_action( 'sensei_before_main_content', 'senseiBeforeMainContent', 10 ); | |
function senseiBeforeMainContent() { | |
if( !is_singular('quiz') ) return; | |
global $post, $current_user; | |
if(isset($post->post_parent) && $post->post_parent != 0) { | |
$lessonPost = get_post($post->post_parent); | |
$courseID = get_post_meta($lessonPost->ID, '_lesson_course', true); |
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 | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly | |
if ( ! class_exists( 'WooThemes_Sensei_Email_Learner_Graded_Quiz' ) ) : | |
/** | |
* Learner Graded Quiz | |
* | |
* An email sent to the learner when their quiz has been graded (auto or manual). |
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 | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly | |
if ( ! class_exists( 'WooThemes_Sensei_Email_Learner_Completed_Course' ) ) : | |
/** | |
* Learner Completed Course | |
* | |
* An email sent to the learner when they complete a course. |
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
jQuery(document).ready(function(){ | |
jQuery('input[name=hidden_email_field]').attr('id', 'hidden_email_field'); // matches exactly 'hidden_email_field' | |
jQuery('#username, #first_name, #last_name, #company, #other_company, #password, #hidden_email_field, #lang, #language').bind('keypress blur', function() { | |
jQuery('#first_name, #last_name').keyup(function () { | |
this.value = this.value.replace(/ /g, "_"); | |
}); | |
jQuery('#user_email').val(jQuery('#first_name').val() + '' + | |
jQuery('#last_name').val() + '' + | |
jQuery('#company').val() + '' + | |
jQuery('#password').val() + '' + |