View functions.php
<?php
add_filter( 'submit_job_form_wp_editor_args', 'smyles_submit_job_form_wp_editor_args' );
function submit_job_form_wp_editor_args( $args ){
// @see https://github.com/Automattic/WP-Job-Manager/blob/master/templates/form-fields/wp-editor-field.php#L2
// change quicktags to true
$args['quicktags'] = true;
// change rows to 10 (default is 8)
$args['textarea_rows'] = 10;
View functions.php
<?php
// Requires WordPress 4.4+
add_filter( 'register_taxonomy_args', 'smyles_set_job_tags_hierarchical', 10, 3);
function smyles_set_job_tags_hierarchical( $args, $taxonomy, $object_type ){
if( $taxonomy === 'job_listing_tag' ){
$args['hierarchical'] = true;
}
View functions.php
<?php
// Return data in correct format to be used with text field
add_action( 'submit_job_form_fields_get_job_data', 'smyles_get_custom_user_add_tax_data', 10, 2 );
function smyles_get_custom_user_add_tax_data( $data, $job ) {
// Update job_metakey with correct metakey, and job_metakey_tax with the taxonomy name for that metakey
$data[ 'job' ][ 'job_metakey' ]['value'] = implode( ', ', wp_get_object_terms( $job->ID, 'job_metakey_tax', array( 'fields' => 'names' ) ) );
return $data;
}
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
//
// Below the example meta key used is "candidate_dob"
add_filter( 'field_editor_output_as_value_candidate_dob', 'smyles_output_age_from_dob' );
function smyles_output_age_from_dob( $value ){
View functions.php
<?php
add_action( 'publish_job_listing', 'smyles_featured_listing_do_something', 20, 2 );
// This is executed whenever a Job Listing status is set to publish (after payment, approval, or initial submission)
// also executes when an expired job is relisted.
function smyles_featured_listing_do_something( $ID, $post ){
$featured = get_post_meta( $ID, '_featured', true );
if( ! empty( $featured ) {
View functions.php
<?php
add_filter( 'listify_listing_data', 'smyles_custom_featured_listing_map_icon', 50, 2 );
function smyles_custom_featured_listing_map_icon( $data, $post ){
// Make sure passed $post is WP_Post object
if( $post instanceof WP_Post ){
// If listing is featured listing, change icon
if( ! empty( $post->_featured ) ){
// Set the icon to use below (@see http://ionicons.com/)
View functions.php
<?php
add_filter( 'pre_get_avatar_data', 'smyles_set_avatar_based_on_user_meta', 10, 2 );
/**
* Use URL from User Meta for Avatar
*
* This will return a URL value set in the user's meta to use as an avatar, if it
* exists, and is a valid URL. Should work everywhere on the site unless you're
* using a custom avatar plugin that overrides or does not call core get_avatar_data()
*
View functions.php
<?php
/**
* Filter to add Custom Theme, or Plugin templates
*
* If you want to add custom templates, this is the hook you should use.
* Custom templates should follow the pattern below. Templates should be placed inside the 'templates' array key
* which is an array of non-key arrays.
*
* For the email template post content, you should NOT use HTML as this will be stripped if the user sets the email type
* to plain text. Instead, you should use new line breaks (\n), which will be converted to HTML <br> automatically.
View functions.php
<?php
/**
* If you are using shortcode, or auto output and do not have the full AND value wrapper being output (output as value only),
* you can use this code below to use something different than the regular <br /> that is output by default
*/
add_filter('field_editor_output_no_wrap_after', 'smyles_custom_no_wrap_after', 10, 6);
function smyles_custom_no_wrap_after( $output, $meta_key, $listing_id, $field_values, $args, $single_value ){
View functions.php
<?php
add_filter( 'job_manager_field_editor_js_conf_meta_keys', 'smyles_allow_featured_image_admin_only' );
/**
* Allow featured_image to be set as admin only
*/
function smyles_allow_featured_image_admin_only( $config ){
// Make sure admin_only_0 is in disabled fields first (_0 added for any checkboxes)