function epl_get_shortcode_page_permalink() { return get_permalink(epl_get_shortcode_page_id()); }
function get_the_attendee_list_link($anchor = '', $url_only = false) { global $post, $event_details, $epl_current_step; //ok to show the list //where to show if (epl_get_element('_epl_show_attendee_list_link', $event_details, 0) == 0) { return null; } $link_location = epl_get_element('_epl_show_attendee_list_button_location', $event_details); if ($link_location != $epl_current_step) { return null; } //$button_text = epl_nz( epl_get_setting( 'epl_event_options', 'epl_register_button_text' ), epl__( 'Register' ) ); $button_text = $anchor != '' ? $anchor : epl__('Attendees'); //The shortcode page id. Everythng goes through the shortcode static $page_id = null; // get_option( 'epl_shortcode_page_id' ); $page_id = epl_get_shortcode_page_id(); if (is_null($page_id)) { //'post_status' => 'publish' $pages = get_pages(); foreach ($pages as $page) { if (!$page_id && stripos($page->post_content, '[events_planner') !== false) { $page_id = $page->ID; } } } $url_vars = array('page_id' => $page_id, 'epl_action' => 'show_attendee_list', 'event_id' => $event_details['ID'], 'epl_event' => false); $url = add_query_arg($url_vars, epl_get_sortcode_url()); //epl_get_url() ); if ($url_only) { return $url; } return "<a id='attendee_list_link-{$event_details['ID']}' class='attendee_list_link' href='" . $url . "'>{$button_text}</a>"; }