Skip to content

Instantly share code, notes, and snippets.

View FernandoSalinas33's full-sized avatar

Fernando Salinas FernandoSalinas33

View GitHub Profile
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/home/grabmyla/www.airbizo.com/wp-content/plugins/ninja-forms/includes/MergeTags/WP.php</b> on line <b>85</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/home/grabmyla/www.airbizo.com/wp-content/plugins/ninja-forms/includes/MergeTags/Deprecated.php</b> on line <b>43</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/home/grabmyla/www.airbizo.com/wp-content/plugins/ninja-forms/includes/MergeTags/WP.php</b> on line <b>85</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/home/grabmyla/www.airbizo.com/wp-content/plugins/ninja-forms/includes/MergeTags/Deprecated.php</b> on line <b>43</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>/home/grabmyla/www.airbizo.com/wp-content/plugins/ninja-forms/includes/MergeTags/WP.php</b> on line <b>85</b><br />
@FernandoSalinas33
FernandoSalinas33 / functions.php
Created September 27, 2017 16:24
Remove Location, Phone, Video and Website Fields
// 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
function remove_listify_submit_job_form_fields( $fields ) {
if( ! isset( $fields['job'] ) ) return $fields;
// If listing fields fields exist in Job array, remove them
if( isset( $fields['job']['job_location'] ) ) unset( $fields['job']['job_location']);
if( isset( $fields['company']['company_website'] ) ) unset( $fields['company']['company_website']);
if( isset( $fields['company']['company_video'] ) ) unset( $fields['company']['company_video']);
if( isset( $fields['company']['phone'] ) ) unset( $fields['company']['phone']);
@FernandoSalinas33
FernandoSalinas33 / functions.php
Last active May 1, 2018 21:03
Make Regions Multiselect
add_filter( 'submit_job_form_fields', 'custom_submit_job_form_fields' );
function custom_submit_job_form_fields( $fields ) {
// Here we target one of the job fields and change it to multiselect
$fields['job']['job_region']['type'] = "term-multiselect";
// And return the modified fields
return $fields;
}
@FernandoSalinas33
FernandoSalinas33 / functions.php
Created September 21, 2017 16:39
Add Images to Description Text Editor
add_filter( 'submit_job_form_wp_editor_args', function( $args ) {
// modified wp_editor() arguments...
//add media button to add images
$args['media_buttons'] = true;
// change rows to 10 (default is 8)
$args['textarea_rows'] = 10;
return $args;
} );
@FernandoSalinas33
FernandoSalinas33 / functions.php
Created August 21, 2017 04:21
Display Listing Owner nickname on listing card
/** Add the listing owner name to the listing result so it can be shown in the marker popup.
* To show first and last name replace line 6 with the following: $name = get_the_author_meta( 'first_name', $listing->listing_owner ) . ' ' . get_the_author_meta( 'last_name', $listing->listing_owner );
*/
add_filter( 'listify_get_listing_to_array', function( $data, $listing ) {
// Get our custom value
$name = get_the_author_meta( 'nickname', $listing->listing_owner );
// Only add if our custom field is not empty.
if ( '' !== $name ) {
$data['name'] = $name;
add_filter( 'submit_resume_form_fields', 'remove_submit_resume_form_fields' );
function remove_submit_resume_form_fields( $fields ) {
// Unset any of the fields you'd like to remove - copy and repeat as needed
unset( $fields['resume_fields']['candidate_location'] );
// And return the modified fields
return $fields;
// Add lowest linked product price to listing data.
add_filter( 'listify_get_listing_to_array', function( $data, $listing ) {
global $listify_job_manager_products;
$product = $listify_job_manager_products->get_base_product( $listing->get_id() );
$data['price'] = $product->get_price_html();
return $data;
}, 10, 2 );
@FernandoSalinas33
FernandoSalinas33 / style.css
Last active August 3, 2017 17:47
3 Columns Listing Results
@media (min-width: 992px) {
.col-sm-6 {
width: 33.33%;
}
}
@FernandoSalinas33
FernandoSalinas33 / function.php
Created July 27, 2017 19:48
Prevent Homepage Herp video from Looping
add_action( 'wp_footer', function() {
if ( ! is_front_page() ) return;
?>
<script>
jQuery( document ).ready( function($) {
$( document ).on( 'wp-custom-header-video-loaded', function() {
$( "#wp-custom-header-video" ).attr( 'loop', false );
});
});
</script>
add_filter( 'job_manager_geolocation_endpoint', function( $url ) {
$url = str_replace( 'language=zh', 'language=zh-CN', $url );
return $url;
}, 99, 2 );