Skip to content

Instantly share code, notes, and snippets.

<?php
add_action( 'user_register', 'give_wcpl_user_package_on_registration' );
function give_wcpl_user_package_on_registration( $user_id ) {
global $wpdb;
if ( wpjm_check_user_role( 'employer', $user_id ) ) {
$wpdb->insert(
"{$wpdb->prefix}wcpl_user_packages",
@bryceadams
bryceadams / gist:db6c8669e9e99cb2808c
Last active October 9, 2023 13:55
Clear WooCommerce Cart (when not cart/checkout)
/**
* Clears WC Cart on Page Load
* (Only when not on cart/checkout page)
*/
add_action( 'wp_head', 'bryce_clear_cart' );
function bryce_clear_cart() {
if ( wc_get_page_id( 'cart' ) == get_the_ID() || wc_get_page_id( 'checkout' ) == get_the_ID() ) {
return;
}
<?php
global $wp_post_types;
switch ( $job->post_status ) :
case 'publish' :
printf( __( '%s listed successfully. To view your listing <a href="%s">click here</a>.', 'wp-job-manager' ), $wp_post_types['job_listing']->labels->singular_name, get_permalink( $job->ID ) );
break;
case 'pending' :
printf( __( '%s submitted successfully. Your listing will be visible once approved.', 'wp-job-manager' ), $wp_post_types['job_listing']->labels->singular_name, get_permalink( $job->ID ) );
break;
.business-glance .location-address { display: none; }
.business-glance img { display: none; }
.business-glance .location-hours { display: none; }
<div class="business-glance">
[opening_hours]
</div>
<?php echo get_post_meta( $post->ID, '_candidate_color', true ); ?>
// Add field to admin
add_filter( 'resume_manager_resume_fields', 'wpjms_admin_resume_form_fields' );
function wpjms_admin_resume_form_fields( $fields ) {
$fields['_candidate_color'] = array(
'label' => __( 'Favourite Color', 'job_manager' ),
'type' => 'text',
'placeholder' => __( 'Blue', 'job_manager' ),
'description' => '',
);
/**
* Filter email message for submitted resumes
*/
add_filter( 'apply_with_resume_email_message', 'bryce_wpjm_resume_email_message' );
function bryce_wpjm_resume_email_message( $messages ) {
$messages['extra'] = 'Write some custom text or HTMl etc. here!';
return $messages;
}
'resume_category' => array(
'label' => __( 'Resume category', 'wp-job-manager-resumes' ),
'type' => 'term-multiselect',
'taxonomy' => 'resume_category',
'required' => true,
'placeholder' => '',
'priority' => 7
),
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_title'] );
// And return the modified fields
return $fields;