Skip to content

Instantly share code, notes, and snippets.

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_video'] );
unset( $fields['resume_fields']['links'] );
// And return the modified fields
return $fields;
function remove_subs_price_string() {
return '';
}
add_filter( 'woocommerce_subscription_price_string', 'remove_subs_price_string' );
@bryceadams
bryceadams / gist:5d72de46666b64ef3229
Created March 25, 2015 06:20
Stop WordPress auto-emptying the trash
function my_remove_schedule_delete() {
remove_action( 'wp_scheduled_delete', 'wp_scheduled_delete' );
}
add_action( 'init', 'my_remove_schedule_delete' );
add_filter( 'job_application_form_fields', 'alter_upload_cv_test' );
function alter_upload_cv_test( $fields ) {
$fields['application_attachment']['label'] = 'Upload your CV/resume or any other relevant file';
return $fields;
}
add_filter( 'submit_job_form_fields', 'wpjm_dont_require_app' );
function wpjm_dont_require_app( $fields ) {
$fields['job']['application']['required'] = false;
return $fields;
}
@bryceadams
bryceadams / gist:497c25413d1ddbd584f7
Created March 21, 2015 23:11
Recipe Hero - add an ingredient amount and set as the default
add_filter( 'recipe_hero_meta_ingredients_amount', 'rhs_add_new_amount' );
function rhs_add_new_amount( $amounts ) {
$amounts['pinch'] = 'Pinch';
}
add_filter( 'recipe_hero_meta_ingredients_amount_default', 'rhs_set_new_amount_default' );
function rhs_set_new_amount_default() {
return 'pinch';
}
@bryceadams
bryceadams / gist:24765ad81e0696561848
Last active August 29, 2015 14:16
No Free Shipping for non-Continental US states
add_filter( 'woocommerce_package_rates', 'ba_hide_shipping_continental', 10, 2 );
function ba_hide_shipping_continental( $rates, $package ) {
global $woocommerce;
$excluded_states = array( 'AK','HI','GU','PR' );
if( in_array( $woocommerce->customer->get_shipping_state(), $excluded_states ) ) {
unset( $rates['free_shipping'] );
}
return $rates;
}
@bryceadams
bryceadams / gist:36a489e6affaace57a3f
Last active August 29, 2015 14:16
WP Job Manager - Remove Company Fields
add_filter( 'submit_job_form_fields', 'remove_company_fields' );
function remove_company_fields( $fields ) {
unset( $fields['company'] );
return $fields;
}
add_action( 'single_job_listing_meta_end', 'display_country_data' );
function display_country_data() {
global $post;
$country = get_post_meta( $post->ID, '_job_country', true );
if ( $country ) {
echo '<li>' . __( 'Country:' ) . ' ' . $country . '</li>';
}
}
@bryceadams
bryceadams / gist:bfe84f1985f9c79b9ddc
Last active August 29, 2015 14:16
Example usage of scopes in FB.login Facebook JavaScript SDK
function fblogin() {
FB.login(function (response) {
checkLoginState();
}, {scope: 'public_profile,email,user_website,user_education_history,user_work_history,user_location,user_about_me'});
}