Skip to content
View multiselect-field.php
<?php wp_enqueue_script( 'wp-job-manager-multiselect' ); ?>
<select multiple="multiple" name="<?php echo esc_attr( isset($field['name']) ? $field['name'] : $key ); ?>[]" id="<?php echo esc_attr( $key ); ?>" class="job-manager-multiselect" <?php if( ! empty($field['required']) ) echo 'required'; ?> data-no_results_text="<?php _e( 'No results match' ); ?>" data-multiple_text="<?php _e( 'Select Some Options' ); ?>">
<?php
$no_values = isset( $field['value'] ) ? false : true;
foreach ( $field['options'] as $key => $value ) :
$key = str_replace( '*', '', $key, $replace_default );
$key = str_replace( '~', '', $key, $replace_disabled );
$field_value = isset( $field['value'] ) ? $field['value'] : array();
if( $no_values && $replace_default > 0) $field[ 'value' ][ ] = $key;
View term-multiselect-field.php
<?php
// You need to use this file as a template override for this to work,
// for more details please see the wpjobmanager.com documentation:
// https://wpjobmanager.com/document/template-overrides/
// Get selected value
if ( isset( $field['value'] ) ) {
$selected = $field['value'];
} elseif ( ! empty( $field['default'] ) && is_int( $field['default'] ) ) {
$selected = $field['default'];
View functions.php
<?php
// ^ the <?php above should only be in your functions.php file ONCE, at the top
//
// This code is provided for educational purposes only
//
// Executing shortcodes from user input is not support or recommended as this will
// allow users to input any shortcode even ones you may not want them to use.
// I do not support this and will not be held liable for anything done to your site
// as a result of executing shortcodes from user input. Use at your own risk.
View functions.php
<?php
// ^ the <?php above should only be in your functions.php file ONCE, at the top
// The filter is field_editor_output_as_value_METAKEY
// where you need to replace METAKEY with the actual meta key you want to filter the output for
// .... as you can see below you can also add multiple filters using the same function.
add_filter( 'field_editor_output_as_value_listing_askprice', 'my_custom_format_value_as_currency' );
add_filter( 'field_editor_output_as_value_listing_gross_sales', 'my_custom_format_value_as_currency' );
/**
View functions.php
<?php
add_filter( 'job_manager_chosen_multiselect_args', 'set_term_multiselect_max_opts' );
function set_term_multiselect_max_opts( $args ){
$args['max_selected_options'] = 5;
return $args;
}
View functions.php
<?php
// Register our jQuery MaskMoney script in WordPress (does not output, only register)
add_action( 'wp_enqueue_scripts', 'my_custom_register_currency_script' );
// Call our function to output jQuery when the submit listing page is loaded
add_action( 'submit_job_form_job_fields_end', 'my_custom_output_currency_js' );
function my_custom_register_currency_script(){
// Register the script in WP .. does not output, only register
wp_register_script( 'custom-currency-field', '//cdnjs.cloudflare.com/ajax/libs/jquery-maskmoney/3.0.2/jquery.maskMoney.min.js', array( 'jquery' ) );
}
View content-single-job_listing.php
<?php
// You should only use this code below if the field is an "admin only" field.
// Using a field that is not admin only will allow any user to execute shortcodes from your site, and can cause security issues
$list_related_products = get_custom_field( 'list_related_products' );
echo do_shortcode( $list_related_products );
View functions.php
<?php
// Add filter to call our custom function when setting up dropdown of output locations
add_filter( 'field_editor_output_options', 'my_custom_output_options', 10, 2 );
/**
* Add Custom Auto Output Locations for WPJM
*
* This custom function will add to the end of an array, a new set of output locations
* that will be visible in the WP Job Manager Field Editor auto output dropdown.
View functions.php
<?php
add_filter( 'job_manager_field_editor_date_args', 'my_custom_date_args' );
function my_custom_date_args( $args ){
$args['maxDate'] = '+30D';
return $args;
}
View functions.php
<?php
add_filter( 'submit_job_steps', 'my_custom_remove_preview_step' );
function my_custom_remove_preview_step( $steps ){
if( isset( $steps['preview'] ) ) unset( $steps['preview'] );
return $steps;
Something went wrong with that request. Please try again.