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; }
Remove preview step from WP Job Manager (only for suggestion, code is untested)
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; }
Set max categories to 5
term-multiselect.min.jsjQuery(function(){ jQuery( ‘.job-manager-category-dropdown’ ).chosen({ search_contains: true, max_selected_options: 5 }); });
Example action hook field type to output shortcode
functions.php<?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 );
Method for WordPress to get theme name based on parent theme
get_theme_name.php<?php /** * Get current site Theme Name * * This method will get the theme name by default from parent theme, and * if not set it will return the textdomain. * * * @since 1.3.5 * * @param bool|TRUE $parent Whether or not to use the parent theme if current theme is child […]
tunlr!
tunlr#!/usr/bin/env node /* tunlr – simple SSH tunnel management usage: tunlr [options] [command] options: -q quiet. suppress console output. -c [filename] use [filename] as config. defaults to look for ~/.tunnelrc commands: list list available tunnel configs start [name?] start a tunnel (or tunnels). if no [name] start all tunnels. stop [name?] stop a tunnel (or […]
[Listify Theme] – Change field editor display style to match Listify (circles with checks)
style.css#jmfe-wrap-METAKEY { list-style: none; display: inline-block; margin-right: 8px; } #jmfe-custom-METAKEY:before { display: inline-block; font-family: Ionicons; speak: none; font-style: normal; font-weight: 400; font-variant: normal; text-transform: none; text-rendering: auto; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; content: ‘f120’; margin-right: 4px; color: #f59119; }
Remove a specific span tag from HTML while preserving/keeping the inside content using PHP and DOMDocument
remove-span-tags-from-html.php<?php $content = ‘<span style="font-family: helvetica; font-size: 12pt;"><div>asdf</div><span>TWO</span>Business owners are fearful of leading. They would rather follow the leader than embrace a bold move that challenges their confidence. </span>’; $dom = new DOMDocument(); // Use LIBXML for preventing output of doctype, <html>, and <body> tags $dom->loadHTML($content, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($dom); foreach ($xpath->query(‘//span[@style="font-family: […]
Show image based on field selection
image.php<?php $is_veteran = get_custom_field( ‘is_veteran’ ); // Assuming the full URL to the image is //domain.com/banners/veteran.png // if the value of the selection is "veteran" then it would form that full URL if( ! empty( $is_veteran ) ){ echo "<img src="//domain.com/banners/{$is_veteran}.png"></a>"; }
How to remove default company fields from WP Job Manager (this example for Listify)
functions.php<?php // Add your own function to filter the fields add_filter( ‘submit_job_form_fields’, ‘remove_listify_submit_job_form_fields’, 9999999999 ); // This is your function which takes the fields, modifies them, and returns them // You can see the fields which can be changed here: https://github.com/mikejolley/WP-Job-Manager/blob/master/includes/forms/class-wp-job-manager-form-submit-job.php function remove_listify_submit_job_form_fields( $fields ) { if( ! isset( $fields[‘company’] ) ) return $fields; // […]