This file contains hidden or 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_filter( 'tribe_get_event_website_link_label', function() { | |
return "Change website link label here"; | |
}, 11 ); |
This file contains hidden or 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 | |
// Assuming 75 is the WordPress post ID | |
// Assuming 80 is the ticket ID | |
add_action( 'tribe_events_single_meta_details_section_end', function() { | |
if ( is_single( 75 ) ) { | |
$url_in_person = tribe_ext_tickets_additional_fields_get_meta( 80, 'url_in_person' ); | |
$url_virtual = tribe_ext_tickets_additional_fields_get_meta( 80, 'url_virtual' ); | |
echo '<dd class="url-in-person"><a href="' . esc_url( $url_in_person ) . '" target="_self" rel="external">In-Person Event Link</a>'; |
This file contains hidden or 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_filter( 'tribe_rest_organizer_data', function( $data ) { | |
if ( isset( $data["phone"] ) ) { | |
unset( $data["phone"] ); | |
} | |
if ( isset( $data["json_ld"]->telephone ) ) { | |
unset( $data["json_ld"]->telephone ); | |
} |
This file contains hidden or 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
// https://developer.wordpress.org/reference/functions/add_post_type_support/ | |
add_action( 'init', 'lelandf_custom_fields_support_learndash' ); | |
function lelandf_custom_fields_support_learndash() { | |
$post_types = [ | |
'sfwd-courses', | |
'sfwd-lessons', | |
'sfwd-topic', | |
]; | |
This file contains hidden or 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_filter( 'learndash_courseinfo', function( $return, $shortcode_atts ) { | |
if ( 'completed_on' === $shortcode_atts['show'] ) { | |
$time_string = learndash_user_get_course_completed_date( $shortcode_atts['user_id'], $shortcode_atts['course_id'] ); | |
return date( $shortcode_atts['format'], $time_string );; | |
} | |
return $return; | |
}, 10, 2 ); |
This file contains hidden or 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_filter( 'body_class', 'leland_remove_tag_body_class' ); | |
function leland_remove_tag_body_class( $classes ) { | |
$class_to_remove = 'tag'; | |
$remove = array_search( $class_to_remove, $classes ); | |
if ( $remove ) { | |
unset( $classes[$remove] ); | |
} |
This file contains hidden or 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 | |
/* | |
* Snippet provided as-is with no warranty and no support. | |
* Not an ironclad way of preventing license key exposure. Note word "obscure." | |
* Test on staging/development environment to ensure needs are met prior to applying to production | |
* Inspired by https://gist.github.com/rali14/3407a1b3efe149cfa3f17caff8743eda | |
*/ | |
function leland_learndash_obscure_license_key() { | |
?> |
This file contains hidden or 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_filter( 'post_class', 'themetry_woocommerce_spatial_search_fix' ); | |
function themetry_woocommerce_spatial_search_fix( $classes ) { | |
// Check if we are on a search results page, and check if post is a Woo product | |
if ( is_search() && in_array( 'type-product', $classes, true ) ) { | |
$classes[] = 'hentry'; | |
} | |
// Return the array | |
return $classes; | |
} |
This file contains hidden or 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( 'learndash_lesson_completed', function( $lesson_data ) { | |
error_log( 'course id: ' . $lesson_data["course"]->ID ); | |
error_log( 'course title: ' . $lesson_data["course"]->post_title ); | |
error_log( 'lesson id: ' . $lesson_data["lesson"]->ID ); | |
error_log( 'lesson title: ' . $lesson_data["lesson"]->post_title ); | |
} ); |
This file contains hidden or 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
function leland_add_excerpt_support_for_learndash_post_types() { | |
add_post_type_support( 'sfwd-courses', 'excerpt' ); | |
} | |
add_action( 'init', 'leland_add_excerpt_support_for_learndash_post_types' ); |