This file contains hidden or 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 | |
| // There should only be one <?php at the top of your file, do not add this if it already exists | |
| function custom_N01_Price_action( $field, $key ) { | |
| echo do_shortcode('[table id=1]'); | |
| } | |
| // Here the meta key is N01_Price, so the action would be job_manager_field_actionhook_N01_Price | |
| add_action( 'job_manager_field_actionhook_N01_Price', 'custom_N01_Price_action', 10, 2 ); |
This file contains hidden or 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(){ | |
| jQuery( '.job-manager-category-dropdown' ).chosen({ search_contains: true, max_selected_options: 5 }); | |
| }); |
This file contains hidden or 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_steps', 'my_custom_remove_preview_step' ); | |
| function my_custom_remove_preview_step( $steps ){ | |
| if( isset( $steps['preview'] ) ) unset( $steps['preview'] ); | |
| return $steps; |
This file contains hidden or 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( 'job_manager_field_editor_date_args', 'my_custom_date_args' ); | |
| function my_custom_date_args( $args ){ | |
| $args['maxDate'] = '+30D'; | |
| return $args; | |
| } |
This file contains hidden or 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 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. |
This file contains hidden or 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 | |
| // 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 ); |
This file contains hidden or 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 | |
| // ^ the <?php above should only be in your functions.php file ONCE, at the top ... do not include <?php if you're adding this to the end of your functions.php file | |
| // 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 |
This file contains hidden or 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( 'job_manager_chosen_multiselect_args', 'set_term_multiselect_max_opts' ); | |
| function set_term_multiselect_max_opts( $args ){ | |
| $args['max_selected_options'] = 5; | |
| return $args; | |
| } |
This file contains hidden or 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 | |
| // ^ 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_METAKEY', 'my_custom_format_value_as_currency' ); | |
| // Just uncomment the code below to use same handling for a different meta key | |
| //add_filter( 'field_editor_output_as_value_ANOTHERMETAKEY', 'my_custom_format_value_as_currency' ); |
This file contains hidden or 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 | |
| // ^ 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. |