Created
February 1, 2017 23:41
-
-
Save tripflex/82ee86ca7b64e21a8cf5faaf31b59ae4 to your computer and use it in GitHub Desktop.
Move header_image from job fields to company fields while using the WorkScout Theme (untested)
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 | |
// ^ do not include this, there should only be one of these at the top of the functions.php file! | |
// MAKE SURE you remove any configuration created using Field Editor before adding this, goto the field and click "Delete", | |
// then add this to your child theme's functions.php file | |
add_filter( 'submit_job_form_fields', 'workscout_frontend_change_job_header_image_to_company', 11 ); | |
function workscout_frontend_change_job_header_image_to_company( $fields ){ | |
if( ! empty( $fields['job'] ) && ! empty( $fields['job']['header_image'] ) ){ | |
// Move to company array | |
$fields['company']['header_image'] = $fields['job']['header_image']; | |
// Unset/remove from job array | |
unset( $fields['job']['header_image'] ); | |
} | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment