Skip to content

Instantly share code, notes, and snippets.

@tripflex
Created February 1, 2017 23:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripflex/82ee86ca7b64e21a8cf5faaf31b59ae4 to your computer and use it in GitHub Desktop.
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)
<?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