芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/cepali.edu.mx/wp-content/plugins/tp-education/includes/tp-education-functions.php
ID; } $tp_event_date = get_post_meta( $post_id, 'tp_event_date_value', true ); if ( ! empty( $tp_event_date ) ) { echo '
' . esc_html__( 'Date: ', 'tp-education' ) . '
' . esc_html( $tp_event_date ) . '
'; } } endif; if( ! function_exists( 'tp_event_start_time' ) ): // Event start time function tp_event_start_time( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_event_start_time = get_post_meta( $post_id, 'tp_event_time_from_value', true ); if ( ! empty( $tp_event_start_time ) ) { echo '
' . esc_html__( 'From: ', 'tp-education' ) . '
' . esc_html( $tp_event_start_time ) . '
'; } } endif; if( ! function_exists( 'tp_event_end_time' ) ): // Event end time function tp_event_end_time( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_event_end_time = get_post_meta( $post_id, 'tp_event_time_to_value', true ); if ( ! empty( $tp_event_end_time ) ) { echo '
' . esc_html__( 'To: ', 'tp-education' ) . '
' . esc_html( $tp_event_end_time ) . '
'; } } endif; if( ! function_exists( 'tp_event_location' ) ): // Event locaton function tp_event_location( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_event_location = get_post_meta( $post_id, 'tp_event_location_value', true ); if ( ! empty( $tp_event_location ) ) { echo '
' . esc_html__( 'Location: ', 'tp-education' ) . '
' . strip_tags( htmlspecialchars_decode( $tp_event_location ) ) . '
'; } } endif; /* * Class Details */ if( ! function_exists( 'tp_class_cost' ) ): // Class Cost function tp_class_cost( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_class_cost = get_post_meta( $post_id, 'tp_class_cost_value', true ); if ( ! empty( $tp_class_cost ) ) { echo '
' . esc_html__( 'Price: ', 'tp-education' ) . '
' . esc_html( $tp_class_cost ) . '
'; } } endif; if( ! function_exists( 'tp_class_period' ) ): // Class period function tp_class_period( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_class_period = get_post_meta( $post_id, 'tp_class_period_value', true ); if ( ! empty( $tp_class_period ) ) { echo '
' . esc_html( $tp_class_period ) . '
'; } } endif; if( ! function_exists( 'tp_class_size' ) ): // Class Size function tp_class_size( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_class_size = get_post_meta( $post_id, 'tp_class_size_value', true ); if ( ! empty( $tp_class_size ) ) { echo '
' . esc_html__( 'Class Size: ', 'tp-education' ) . '
' . absint( $tp_class_size ) . '
'; } } endif; if( ! function_exists( 'tp_class_age_group' ) ): // Class Age Group function tp_class_age_group( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_class_age_group = get_post_meta( $post_id, 'tp_class_age_group_value', true ); if ( ! empty( $tp_class_age_group ) ) { echo '
' . esc_html__( 'Years Old: ', 'tp-education' ) . '
' . esc_html( $tp_class_age_group ) . '
'; } } endif; /* * Excursion Details */ if( ! function_exists( 'tp_excursion_start_date' ) ): // Excursion start date function tp_excursion_start_date( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_excursion_start_date = get_post_meta( $post_id, 'tp_excursion_start_date_value', true ); if ( ! empty( $tp_excursion_start_date ) ) { echo '
' . esc_html__( 'Start Date: ', 'tp-education' ) . '
' . esc_html( $tp_excursion_start_date ) . '
'; } } endif; if( ! function_exists( 'tp_excursion_end_date' ) ): // Excursion end date function tp_excursion_end_date( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_excursion_end_date = get_post_meta( $post_id, 'tp_excursion_end_date_value', true ); if ( ! empty( $tp_excursion_end_date ) ) { echo '
' . esc_html__( 'End Date: ', 'tp-education' ) . '
' . esc_html( $tp_excursion_end_date ) . '
'; } } endif; if( ! function_exists( 'tp_excursion_location' ) ): // Excursion location function tp_excursion_location( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_excursion_location = get_post_meta( $post_id, 'tp_excursion_location_value', true ); if ( ! empty( $tp_excursion_location ) ) { echo '
' . esc_html__( 'Location: ', 'tp-education' ) . '
' . strip_tags( htmlspecialchars_decode( $tp_excursion_location ) ) . '
'; } } endif; /* * Team Details */ if( ! function_exists( 'tp_team_designation' ) ): // Team Designation function tp_team_designation( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_team_designation = get_post_meta( $post_id, 'tp_team_designation_value', true ); if ( ! empty( $tp_team_designation ) ) { echo '
' . esc_html__( 'Designation: ', 'tp-education' ) . '
' . esc_html( $tp_team_designation ) . '
'; } } endif; if( ! function_exists( 'tp_team_email' ) ): // Team Email function tp_team_email( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_team_email = get_post_meta( $post_id, 'tp_team_email_value', true ); if ( ! empty( $tp_team_email ) ) { echo '
' . esc_html__( 'Email: ', 'tp-education' ) . '
' . esc_html( $tp_team_email ) . '
'; } } endif; if( ! function_exists( 'tp_team_phone' ) ): // Team Phone function tp_team_phone( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_team_phone = get_post_meta( $post_id, 'tp_team_phone_value', true ); if ( ! empty( $tp_team_phone ) ) { echo '
' . esc_html__( 'Phone: ', 'tp-education' ) . '
' . esc_html( $tp_team_phone ) . '
'; } } endif; if( ! function_exists( 'tp_team_skype' ) ): // Team Skype function tp_team_skype( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_team_skype = get_post_meta( $post_id, 'tp_team_skype_value', true ); if ( ! empty( $tp_team_skype ) ) { echo '
' . esc_html__( 'Skype: ', 'tp-education' ) . '
' . esc_html( $tp_team_skype ) . '
'; } } endif; if( ! function_exists( 'tp_team_website' ) ): // Team Website function tp_team_website( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_team_website = get_post_meta( $post_id, 'tp_team_website_value', true ); if ( ! empty( $tp_team_website ) ) { echo '
' . esc_html__( 'website: ', 'tp-education' ) . '
' . esc_html( $tp_team_website ) . '
'; } } endif; if( ! function_exists( 'tp_team_courses' ) ): // Team Courses function tp_team_courses( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_team_courses = get_post_meta( $post_id, 'tp_team_courses_value', true ); if ( ! empty( $tp_team_courses ) && $tp_team_courses[0] !== 0 ) { $args = array( 'post_type' => 'tp-course', 'post__in' => $tp_team_courses ); $posts = get_posts( $args ); echo '
' . esc_html__( 'Courses: ', 'tp-education' ) . '
'; foreach ( $posts as $post ) : echo '
' . esc_html( $post->post_title ) . '
'; endforeach; echo '
'; wp_reset_postdata(); } } endif; if( ! function_exists( 'tp_team_social' ) ): // Team Social function tp_team_social( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $stored_team_social = get_post_meta( $post_id, 'tp_team_social_count_value', true ); $stored_team_social = ! empty( $stored_team_social ) ? $stored_team_social : 4; for ( $i = 1; $i <= $stored_team_social; $i++ ) { $stored_social[$i] = get_post_meta( $post_id, 'tp_team_social_value_' . $i, true ); $stored_social[$i] = ! empty( $stored_social[$i] ) ? $stored_social[$i] : ''; } if ( count( $stored_social ) > 0 ) { ?>
ID; } $tp_testimonail_rating = get_post_meta( $post_id, 'tp_testimonial_rating_value', true ); for( $i=1; $i <= 5; $i++ ){ if( $i <= $tp_testimonail_rating ) { $rating_class = 'fa-star'; } else { $rating_class = 'fa-star-o'; } echo '
'; } } endif; if( ! function_exists( 'tp_testimonial_designation' ) ): // Testimonial Designation function tp_testimonial_designation( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_testimonial_designation = get_post_meta( $post_id, 'tp_testimonial_designation_value', true ); if ( ! empty( $tp_testimonial_designation ) ) { echo '
' . esc_html__( 'Designation: ', 'tp-education' ) . '
' . esc_html( $tp_testimonial_designation ) . '
'; } } endif; if( ! function_exists( 'tp_testimonial_social' ) ): // Testimonial Social function tp_testimonial_social( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $stored_testimonial_social = get_post_meta( $post_id, 'tp_testimonial_social_count_value', true ); $stored_testimonial_social = ! empty( $stored_testimonial_social ) ? $stored_testimonial_social : 4; for ( $i = 1; $i <= $stored_testimonial_social; $i++ ) { $stored_social[$i] = get_post_meta( $post_id, 'tp_testimonial_social_value_' . $i, true ); $stored_social[$i] = ! empty( $stored_social[$i] ) ? $stored_social[$i] : ''; } if ( count( $stored_social ) > 0 ) { ?>
ID; } $tp_course_type = get_post_meta( $post_id, 'tp_course_type_value', true ); if ( ! empty( $tp_course_type ) ) { echo '
' . esc_html__( 'Type: ', 'tp-education' ) . '
' . esc_html( $tp_course_type ) . '
'; } } endif; if( ! function_exists( 'tp_course_duration' ) ): // Course duration function tp_course_duration( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_course_duration = get_post_meta( $post_id, 'tp_course_duration_value', true ); if ( ! empty( $tp_course_duration ) ) { echo '
' . esc_html__( 'Duration: ', 'tp-education' ) . '
' . esc_html( $tp_course_duration ) . '
'; } } endif; if( ! function_exists( 'tp_course_price' ) ): // Course price function tp_course_price( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_course_price = get_post_meta( $post_id, 'tp_course_price_value', true ); if ( ! empty( $tp_course_price ) ) { echo '
' . esc_html__( 'Price: ', 'tp-education' ) . '
' . esc_html( $tp_course_price ) . '
'; } } endif; if( ! function_exists( 'tp_course_starting_date' ) ): // Course price function tp_course_starting_date( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_course_starting_date = get_post_meta( $post_id, 'tp_course_starting_date_value', true ); if ( ! empty( $tp_course_starting_date ) ) { echo '
' . esc_html__( 'Starts on: ', 'tp-education' ) . '
' . esc_html( $tp_course_starting_date ) . '
'; } } endif; if( ! function_exists( 'tp_course_students' ) ): // Course no of students function tp_course_students( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_course_students = get_post_meta( $post_id, 'tp_course_students_value', true ); if ( ! empty( $tp_course_students ) ) { echo '
' . esc_html__( 'Students: ', 'tp-education' ) . '
' . esc_html( $tp_course_students ) . '
'; } } endif; if( ! function_exists( 'tp_course_language' ) ): // Course language function tp_course_language( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_course_language = get_post_meta( $post_id, 'tp_course_language_value', true ); if ( ! empty( $tp_course_language ) ) { echo '
' . esc_html__( 'Language: ', 'tp-education' ) . '
' . esc_html( $tp_course_language ) . '
'; } } endif; if( ! function_exists( 'tp_course_assessment' ) ): // Course assessment function tp_course_assessment( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_course_assessment = get_post_meta( $post_id, 'tp_course_assessment_value', true ); if ( ! empty( $tp_course_assessment ) ) { echo '
' . esc_html__( 'Assessment: ', 'tp-education' ) . '
' . esc_html( $tp_course_assessment ) . '
'; } } endif; if( ! function_exists( 'tp_course_skills' ) ): // Course skills function tp_course_skills( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_course_skills = get_post_meta( $post_id, 'tp_course_skills_value', true ); if ( ! empty( $tp_course_skills ) ) { echo '
' . esc_html__( 'Skills: ', 'tp-education' ) . '
' . esc_html( $tp_course_skills ) . '
'; } } endif; if( ! function_exists( 'tp_course_professor' ) ): // Course professor function tp_course_professor( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_course_professor = get_post_meta( $post_id, 'tp_course_professor_value', true ); if ( ! empty( $tp_course_professor ) && $tp_course_professor[0] !== 0 ) { $args = array( 'post_type' => 'tp-team', 'p' => $tp_course_professor ); $posts = get_posts( $args ); foreach ( $posts as $post ) : echo '
' . esc_html__( 'Professor: ', 'tp-education' ) . '
' . esc_html( get_the_title( $post->ID ) ) . '
'; endforeach; wp_reset_postdata(); } } endif; if( ! function_exists( 'tp_course_counselors' ) ): // Course counselors function tp_course_counselors( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_course_counselors = get_post_meta( $post_id, 'tp_course_counselors_value', true ); if ( ! empty( $tp_course_counselors ) && $tp_course_counselors[0] !== 0 ) { $args = array( 'post_type' => 'tp-team', 'post__in' => $tp_course_counselors ); $posts = get_posts( $args ); echo '
' . esc_html__( 'counselors: ', 'tp-education' ) . '
'; foreach ( $posts as $post ) : echo '
' . esc_html( $post->post_title ) . '
'; endforeach; echo '
'; wp_reset_postdata(); } } endif; /* * Affiliation Details */ if( ! function_exists( 'tp_affiliation_link' ) ): // Affiliation type function tp_affiliation_link( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_affiliation_link = get_post_meta( $post_id, 'tp_affiliation_link_value', true ); if ( ! empty( $tp_affiliation_link ) ) { echo '
' . apply_filters( 'tp_affiliation_link_filter', esc_html__( 'Click to visit site', 'tp-education' ) ). '
'; } } endif; /* * Get Terms */ if( ! function_exists( 'tp_education_get_terms' ) ): // Terms name and slug function tp_education_get_terms( $taxonomy = '', $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $tp_taxonomies = wp_get_post_terms( $post_id, $taxonomy, array( "fields" => "all" ) ); foreach ( $tp_taxonomies as $tp_taxonomy ) { echo '
' . esc_html( $tp_taxonomy->name ) . '
'; } } endif; if( ! function_exists( 'tp_education_like_button' ) ): // Post like button function tp_education_like_button( $post_id = '' ) { if ( empty( $post_id ) ) { GLOBAL $post; $post_id = $post->ID; } $like_button = new TP_Education_Like_Metabox; return $like_button->tp_education_custom_like( $post_id ); } endif; if( ! function_exists( 'tp_education_posted_on' ) ): // Post Meta function tp_education_posted_on() { $time_string = '
%2$s
'; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = '
%2$s
%4$s
'; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); $year = get_the_time('Y'); $month = get_the_time('m'); $day = get_the_time('d'); $post_type = get_query_var( 'post_type' ); $like_string = tp_education_like_button(); $comment_string = get_comments_number( 0, 1, '' ); $posted_on = sprintf( esc_html_x( '%s', 'post date', 'tp-education' ), '
' . $time_string . '
' ); $output = '
' . $posted_on . '
'; $output .= '
' . esc_html__( 'Likes', 'tp-education' ) . '
' . $like_string; $output .= '
' . esc_html__( 'Comments', 'tp-education' ) . '
' . absint( $comment_string ) . '
'; // WPCS: XSS OK. echo $output; } endif; if( ! function_exists( 'tp_education_post_type_date_link' ) ): /** * This allows us to generate any archive link - plain, yearly, monthly, daily * * @param string $post_type * @param int $year * @param int $month (optional) * @param int $day (optional) * @return string */ function tp_education_post_type_date_link( $post_type, $year, $month = 0, $day = 0 ) { global $wp_rewrite; $post_type_obj = get_post_type_object( $post_type ); $post_type_slug = $post_type_obj->rewrite['slug'] ? $post_type_obj->rewrite['slug'] : $post_type_obj->name; if( $day ) { // day archive link // set to today's values if not provided if ( !$year ) $year = gmdate( 'Y', current_time( 'timestamp' ) ); if ( !$month ) $month = gmdate( 'm', current_time( 'timestamp' ) ); $link = $wp_rewrite->get_day_permastruct(); } else if ( $month ) { // month archive link if ( !$year ) $year = gmdate( 'Y', current_time( 'timestamp' ) ); $link = $wp_rewrite->get_month_permastruct(); } else { // year archive link $link = $wp_rewrite->get_year_permastruct(); } if ( !empty($link) ) { $link = str_replace( '%year%', $year, $link ); $link = str_replace( '%monthnum%', zeroise( intval( $month ), 2 ), $link ); $link = str_replace('%day%', zeroise( intval( $day ), 2 ), $link ); return home_url( "$post_type_slug$link" ); } return home_url( "$post_type_slug" ); } endif;