%s', $agree_text, $agree_label ) : $agree_label; $text = ( 'txt' == $agree_type ) ? nl2br( $agree_text ) : ''; printf( '
'; if( ! empty( $post_meta['address'][0] ) ) { echo ''.$post_meta['address'][0].''; } $pieces = array(); $country = end( $locations ); if( count( $locations ) > 1 ) { array_pop( $locations ); foreach( $locations as $region ) { $term = get_term( $region, 'acadp_locations' ); $pieces[] = ''.$term->name.''; } } $term = get_term( $country, 'acadp_locations' ); $pieces[] = ''.$term->name.''; if( ! empty( $post_meta['zipcode'][0] ) ) { $pieces[] = $post_meta['zipcode'][0]; } echo implode( ',', $pieces ); if( ! empty( $post_meta['phone'][0] ) ) { echo ' '.$post_meta['phone'][0].''; } if( ! empty( $post_meta['email'][0] ) ) { $email_settings = get_option( 'acadp_email_settings' ); $show_email_address_publicly = ! empty( $email_settings['show_email_address_publicly'] ) ? 1 : 0; if( $show_email_address_publicly || is_user_logged_in() ) { echo ' '.$post_meta['email'][0].''; } else { echo ' *****'; } } if( ! empty( $post_meta['website'][0] ) ) { echo ' '.$post_meta['website'][0].''; } echo '
'; } /** * Get activated payment gateways. * * @since 1.0.0 */ function the_acadp_payment_gateways() { $gateways = acadp_get_payment_gateways(); $settings = get_option( 'acadp_gateway_settings' ); $list = array(); if( isset( $settings['gateways'] ) ) { foreach( $gateways as $key => $label ) { if( in_array( $key, $settings['gateways'] ) ) { $gateway_settings = get_option( 'acadp_gateway_'.$key.'_settings' ); $label = ! empty( $gateway_settings['label'] ) ? $gateway_settings['label'] : $label; $html = ''.$gateway_settings['description'].'
'; } $html .= '' . nl2br( $settings['instructions'] ) . '
'; } /** * Retrieve paginated link for listing pages. * * @since 1.5.4 * * @param int $numpages The total amount of pages. * @param int $pagerange How many numbers to either side of current page. * @param int $paged The current page number. */ function the_acadp_pagination( $numpages = '', $pagerange = '', $paged = '' ) { if( is_front_page() && is_home() ) { return; } if( empty( $pagerange ) ) { $pagerange = 2; } /** * This first part of our function is a fallback * for custom pagination inside a regular loop that * uses the global $paged and global $wp_query variables. * * It's good because we can now override default pagination * in our theme, and use this function in default quries * and custom queries. */ if( empty( $paged ) ) { $paged = acadp_get_page_number(); } if( $numpages == '' ) { global $wp_query; $numpages = $wp_query->max_num_pages; if( ! $numpages ) { $numpages = 1; } } /** * We construct the pagination arguments to enter into our paginate_links * function. */ $arr_params = array( 'order', 'sort', 'view' ); $base = acadp_remove_query_arg( $arr_params, get_pagenum_link( 1 ) ) . '%_%'; if( ! get_option('permalink_structure') || isset( $_GET['q'] ) ) { $prefix = strpos( $base, '?' ) ? '&' : '?'; $format = $prefix.'paged=%#%'; } else { $prefix = ( '/' == substr( $base, -1 ) ) ? '' : '/'; $format = $prefix.'page/%#%'; } $pagination_args = array( 'base' => $base, 'format' => $format, 'total' => $numpages, 'current' => $paged, 'show_all' => false, 'end_size' => 1, 'mid_size' => $pagerange, 'prev_next' => true, 'prev_text' => __( '«' ), 'next_text' => __( '»' ), 'type' => 'array', 'add_args' => false, 'add_fragment' => '' ); $paginate_links = paginate_links( $pagination_args ); if( $paginate_links ) { echo "