Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Show content conditionally based on course type
- add_shortcode( 'ld_display_course_content', 'ld_shortcode_display_course_content' );
- function ld_shortcode_display_course_content( $atts , $content = null ) {
- global $post;
- if( is_admin() || !$post || !$post->post_type == 'sfwd-courses' || !isset( $atts['course_type'] ) ) {
- return;
- }
- $course_meta = get_post_meta($post->ID, '_sfwd-courses', true);
- if($course_meta['sfwd-courses_course_price_type'] == $atts['course_type']) {
- return $content;
- } else {
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement