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 LearnDash Profile to My Account Tab in WooCommerce */ | |
/* Add Courses Link to My Account menu */ | |
add_filter ( 'woocommerce_account_menu_items', 'wc_ld_link', 40 ); | |
function wc_ld_link( $menu_links ){ | |
$menu_links = array_slice( $menu_links, 0, 5, true ) | |
+ array( 'courses' => 'My Courses' ) | |
+ array_slice( $menu_links, 5, NULL, true ); | |
return $menu_links; |
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 get_associated_rm_profile_picture_url($post_id) { | |
// Get the user object related to this residential post | |
$residential_manager = get_field('residential_manager', $post_id); | |
// Proceed if we have a residential manager defined | |
if ($residential_manager) { | |
// Check if 'residential_manager' returns a User Object and extract the user ID | |
$user_id = is_array($residential_manager) && isset($residential_manager['ID']) ? $residential_manager['ID'] : null; | |