This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sample_gallery_images = get_custom_field( 'sample_gallery_images' ); | |
// If field value is empty don't output anything | |
if( ! empty( $sample_gallery_images ) ){ | |
// If it's an array that means there are multiple images | |
if( is_array( $sample_gallery_images ) ){ | |
foreach( $sample_gallery_images as $gallery_image ){ | |
// This outputs an image with a link to the image itself with a line break after each image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function(a){a(".jmfe-phone").intlTelInput({ defaultCountry: "za" })}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sample_gallery_images = get_custom_field( 'sample_gallery_images' ); | |
// If field value is empty don't output anything | |
if( ! empty( $sample_gallery_images ) && function_exists( 'job_manager_get_resized_image' ) ){ | |
// If it's an array that means there are multiple images | |
if( is_array( $sample_gallery_images ) ){ | |
foreach( $sample_gallery_images as $gallery_image ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( ! function_exists( 'wp_date_format_php_to_js') ){ | |
/** | |
* Convert a date format to a jQuery UI DatePicker format | |
* | |
* @param string $dateFormat a date format | |
* | |
* @return string | |
*/ | |
function wp_date_format_php_to_js( $dateFormat ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$some_field = get_job_field( 'some_meta_key' ); | |
if( ! empty( $some_field ) ) { | |
echo "<h3>Some Field:</h3>"; | |
echo $some_field; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$jmfe = WP_Job_Manager_Field_Editor_Fields::get_instance(); | |
$job_fields = $jmfe->get_fields( 'job', 'custom' ); | |
$company_fields = $jmfe->get_fields( 'company', 'custom' ); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Job Submission Form | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; | |
global $job_manager; | |
?> | |
<form action="<?php echo $action; ?>" method="post" id="submit-job-form" class="job-manager-form" enctype="multipart/form-data"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('submit_job_form_validate_fields', 'check_price_job_field'); | |
function check_price_job_field( $has_error, $fields, $values ){ | |
// Return true if this field doesn't exist (to prevent errors if you dont have field created) | |
if( ! isset( $values['job']['price'] ) ) return true; | |
if( empty( $values['job']['price'] ) || ! is_float( $values['job']['price'] ) ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( ! function_exists( 'get_attachment_id_from_url' ) ){ | |
function get_attachment_id_from_url( $attachment_url = '' ) { | |
global $wpdb; | |
$attachment_id = FALSE; | |
// If there is no url, return. | |
if ( '' == $attachment_url ) return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$images = get_custom_field( 'job_multifile' ); | |
if ( is_array( $images ) && ! empty( $images ) ){ | |
foreach( $images as $image ){ | |
$thumbnail_id = get_attachment_id_from_url( $image ); | |
$thumbnail = wp_get_attachment_thumb_url( $thumbnail_id ); | |
echo "<a href=\"{$image}\"><img src=\"{$thumbnail}\"></a>"; | |
} |