function scholarship_details_shortcode() { if ( ! is_single() ) return ''; $post_id = get_the_ID(); $enable_scholarship = get_post_meta( $post_id, 'enable_scholarship', true ); if ( $enable_scholarship !== 'on' ) return ''; $fields = [ 'host_country' => get_post_meta( $post_id, 'host_country', true ), 'eligible_students' => get_post_meta( $post_id, 'eligible_students', true ), 'deadline' => get_post_meta( $post_id, 'deadline', true ), 'host_university' => get_post_meta( $post_id, 'host_university', true ), 'funding_type' => get_post_meta( $post_id, 'funding_type', true ), 'study_level' => get_post_meta( $post_id, 'study_level', true ), 'apply_url' => get_post_meta( $post_id, 'apply_url', true ), ]; // क्या डेडलाइन बीत चुकी है? $is_expired = false; $deadline_raw = $fields['deadline']; if ( ! empty( $deadline_raw ) ) { $deadline_date = DateTime::createFromFormat( 'Y-m-d', $deadline_raw ); if ( $deadline_date ) { $today = new DateTime(); $is_expired = $today > $deadline_date; } } $icon_map = [ 'host_country' => 'fa-globe-americas', 'eligible_students' => 'fa-user-graduate', 'deadline' => 'fa-calendar-alt', 'host_university' => 'fa-university', 'funding_type' => 'fa-hand-holding-usd', 'study_level' => 'fa-book-open', ]; $label_map = [ 'host_country' => 'Host Country', 'eligible_students' => 'Eligible Students', 'deadline' => 'Deadline', 'host_university' => 'Host University', 'funding_type' => 'Funding Type', 'study_level' => 'Study Level', ]; $left_keys = [ 'host_country', 'eligible_students', 'deadline' ]; $right_keys = [ 'host_university', 'funding_type', 'study_level' ]; $render_column = function( $keys ) use ( $fields, $icon_map, $label_map, $is_expired ) { $output = ''; foreach ( $keys as $key ) { $value = $fields[ $key ]; if ( empty( $value ) ) continue; $icon = $icon_map[ $key ]; $label = $label_map[ $key ]; // 🔴 यहाँ बदलाव – डेडलाइन के लिए सिर्फ "Expired" दिखाएँ $display_value = $value; if ( $key === 'deadline' && $is_expired ) { $display_value = 'Expired'; } $output .= '
'; $output .= ''; $output .= '' . esc_html( $label ) . ''; $output .= '' . $display_value . ''; $output .= '
'; } return $output; }; // HTML बिल्ड $html = '
'; // हेडर $html .= '
'; $html .= ''; $html .= '

Scholarship Details

'; $html .= '
'; $html .= '
'; // Host Country if ( ! empty( $fields['host_country'] ) ) { $html .= '
'; $html .= 'Host Country'; $html .= '
' . esc_html( $fields['host_country'] ) . '
'; $html .= '
'; } // Funding Type if ( ! empty( $fields['funding_type'] ) ) { $html .= '
'; $html .= ''; $html .= esc_html( $fields['funding_type'] ); $html .= '
'; } // ग्रिड $html .= '
'; $html .= '
' . $render_column( $left_keys ) . '
'; $html .= '
' . $render_column( $right_keys ) . '
'; $html .= '
'; // Apply Now – हमेशा एक्टिव if ( ! empty( $fields['apply_url'] ) ) { $html .= '
'; $html .= ''; $html .= ' Apply Now'; $html .= ''; $html .= '
'; } $html .= '
'; $html .= ''; // रिस्पॉन्सिव CSS (पहले जैसा) $html .= ''; return $html; } https://browsescholarships.com/post-sitemap.xml 2026-07-11T12:36:33+00:00 https://browsescholarships.com/page-sitemap.xml 2026-07-11T10:51:30+00:00 https://browsescholarships.com/category-sitemap.xml 2026-07-11T12:36:33+00:00