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
wp_embed_register_handler( | |
'github-gist', | |
'/https:\/\/gist\.github\.com\/([^\/]+)\/([^\/]+)/', | |
function($matches, $attr, $url, $rawattr) { | |
$embed = "<script src=\"{$url}.js\"></script>"; | |
return apply_filters( | |
'embed_github_gist', | |
$embed, | |
$matches, |
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
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"defaultParams": false, // enable default function parameters | |
"forOf": false, // enable for-of loops | |
"generators": false, // enable generators | |
"objectLiteralComputedProperties": false, // enable computed object literal property names |
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 | |
// Add user to LearnDash Group if purchases specific WooCommerce product | |
function jsforwp_add_user_to_group( $order_id ) { | |
// Add group ID from LearnDash here | |
$ld_group_id = XXXX; | |
// Add product ID from WooCommerce here | |
$wc_product_id = XXXX; | |
$order = new WC_Order( $order_id ); | |
$items = $order->get_items(); | |
foreach ( $items as $item ) { |
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 | |
$parent_lesson_id = learndash_get_setting( $post, 'lesson' ); | |
$parent_lesson = get_post( $parent_lesson_id ); | |
?> |
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 custom_course_completed_redirect($link, $course_id) { | |
$link = get_post_field( 'post_name', $course_id ); | |
//You can change the link here | |
return '/congrats/' . $link; | |
} | |
add_filter("learndash_course_completion_url", custom_course_completed_redirect, 5, 2); |
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 | |
add_action( 'woocommerce_customer_save_address', 'jsforwp_update_address_for_orders', 10, 2 ); | |
function jsforwp_update_address_for_orders( $user_id ) { | |
$customer_meta = get_user_meta( $user_id ); | |
$customer_orders = get_posts( array( | |
'numberposts' => -1, | |
'meta_key' => '_customer_user', |
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
// What I'm calling in my router | |
await Page.render( slug ); | |
Gallery.render(); | |
// The Page.render() code | |
export default class Page { | |
/** | |
* render - Display pages on the Page |
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
sudo apachectl -k stop | |
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist |