Skip to content

Instantly share code, notes, and snippets.

View codeiscode-dev's full-sized avatar

codeiscode-dev

View GitHub Profile
@codeiscode-dev
codeiscode-dev / Redirect to custom URL
Last active October 3, 2018 22:07
Redirect upon Login / Logout
add_action('wp_logout','auto_redirect_external_after_logout');
function auto_redirect_external_after_logout(){
wp_redirect( 'https://www.growlearnteach.com' );
exit();
}
<?php
/* WPEP Assessment User Data
* The same concept for Settings as Key -> Value, will be used by WPEP, but different, to optimize data queries.
* This event does not trigger if the previous $value has not changed during a save.
* STRING $key <- the key, explained bellow
* STRING|INT $value <- the value, explained bellow
* INT $post_id <- the Assessment ID for which this data belongs ( always present )
* INT $question_id <- the question id for which this data belongs ( sometimes available )
* INT $question_answer_id <- the question answer id, for example checkbox / select / radio field types ( sometimes available )
@codeiscode-dev
codeiscode-dev / wpep-frontend-course-events-list.php
Created February 12, 2018 20:24
WPEP Frontend Course Events List
<?php
/* Course Lesson Completed
* $lesson_id <- Lesson ID, from the WPEP Lesson Table
* $is_completed <- true/false
* $user_id <- the User that has completed the lesson, this is also triggered if it's 0
*/
do_action( "wpep_user_activity_lesson_status", $lesson_id, $is_completed, $user_id );
// How to Get The Course ID From the Lesson ID
@codeiscode-dev
codeiscode-dev / wpep-content-library-integration-administration.php
Created February 12, 2018 19:48
WPEP Content Library Integration Administration
<?php
class WPEP_Integration_Content_Library_Coordinator_Administration {
/**
* @var WPEP_Content_Library_Integration
*/
protected $_controller;
public function init( $controller ) {
@codeiscode-dev
codeiscode-dev / wpep-content-library-integration.php
Created February 12, 2018 19:45
WPEP_Content_Library_Integration
<?php
require_once( WPEP_BASE_PATH . "/lib/integrations/Content_Library/Administration.php" );
abstract class WPEP_Content_Library_Integration {
public $control_access_based_display = [];
public $meta_box_active = false;
public $meta_box_title = "";
body.single-courses .sidebar-right .wf-container-main {
grid-template-columns : 100% !important;
}
@codeiscode-dev
codeiscode-dev / creating_your_first_addon.php
Last active January 24, 2018 12:20
Creating your first addon
<?php
class WPEPAddOnExample extends WPEP_AddOn_Integration {
protected static $_instance;
/**
* @return WPEP_AddOn_Integration
*/
public static function instance() {
if( self::$_instance === null )
<?php
$meta_boxes = apply_filters( "wpep_administration_course_metaboxes", $meta_boxes );
$meta_boxes = apply_filters( "wpep_administration_ebook_metaboxes", $meta_boxes );
$meta_boxes = apply_filters( "wpep_administration_video_metaboxes", $meta_boxes );
@codeiscode-dev
codeiscode-dev / wpep_before_template_part.php
Last active January 24, 2018 12:22
wpep_before_template_part
<?php
do_action( 'wpep_before_template_part', $template_name, $template_path, $located, $args );
@codeiscode-dev
codeiscode-dev / wpep_after_template_part.php
Last active January 25, 2018 07:11
wpep_after_template_part
<?php
do_action( 'wpep_after_template_part', $template_name, $template_path, $located, $args );