This file contains hidden or 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 | |
public function give_user_subscription( $product, $user_id, $note = '' ){ | |
// First make sure all required functions and classes exist | |
if( ! function_exists( 'wc_create_order' ) || ! function_exists( 'wcs_create_subscription' ) || ! class_exists( 'WC_Subscriptions_Product' ) ){ | |
return false; | |
} | |
$order = wc_create_order( array( 'customer_id' => $user_id ) ); |
This file contains hidden or 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 | |
/** | |
* | |
* WARNING: this only checks if the email is being sent to the same email as admin_email option. | |
* If for some reason another email is sent to that same email address, but it's not meant as an "admin email" | |
* this filter will still add those additional emails, just something to keep in mind. | |
*/ | |
add_filter( 'wp_mail', 'my_custom_to_admin_emails' ); | |
This file contains hidden or 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 | |
/** | |
* Make sure the function does not exist before defining it | |
*/ | |
if( ! function_exists( 'remove_class_filter' ) ){ | |
/** | |
* Remove Class Filter Without Access to Class Object | |
* | |
* In order to use the core WordPress remove_filter() on a filter added with the callback |
This file contains hidden or 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 | |
// ^ there should only be one of these at the top of your child theme's functions.php file | |
add_filter( 'job_manager_default_company_logo', 'smyles_custom_job_manager_logo' ); | |
function smyles_custom_job_manager_logo( $logo_url ){ | |
// Change the value below to match the filename of the custom logo you want to use | |
// Place the file in a /images/ directory in your child theme's root directory. | |
// The example provided assumes "/images/custom_logo.png" exists in your child theme |
This file contains hidden or 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 | |
add_filter('register_post_type_resume', 'modify_resume_rewrite_slug', 99, 1); | |
function modify_resume_rewrite_slug($args) { | |
// don't translate the value | |
$args['rewrite']['slug'] = 'resume'; | |
return $args; | |
} |
This file contains hidden or 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 | |
// 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 | |
// You can see the fields which can be changed here: https://github.com/mikejolley/WP-Job-Manager/blob/master/includes/forms/class-wp-job-manager-form-submit-job.php | |
function remove_listify_submit_job_form_fields( $fields ) { | |
if( ! isset( $fields['company'] ) ) return $fields; |
This file contains hidden or 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 | |
add_filter( 'the_job_location', 'smyles_the_job_location_translatable', 99, 2 ); | |
function smyles_the_job_location_translatable( $job_location, $post ){ | |
// We don't want to override the auto generated geolocation address information | |
if ( get_option( 'job_manager_display_location_address' ) === '1' ) { | |
return $job_location; | |
} | |
return get_job_field('job_location', $post->ID ); |
This file contains hidden or 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 | |
add_filter( 'submit_job_form_wp_editor_args', 'smyles_submit_job_form_wp_editor_args' ); | |
function smyles_submit_job_form_wp_editor_args( $args ){ | |
// @see https://github.com/Automattic/WP-Job-Manager/blob/master/templates/form-fields/wp-editor-field.php#L2 | |
// change quicktags to true | |
$args['quicktags'] = true; | |
// change rows to 10 (default is 8) |
This file contains hidden or 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 | |
add_filter( 'job_manager_packages_job_application_url_type_packages_permalink_not_logged_in', function( $url ) { | |
return 'https://domain.com/please-register'; // Replace with your desired URL | |
}); |
This file contains hidden or 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 | |
function display_candidate_photo_shortcode($atts) { | |
// Check if the function exists before calling it | |
if (function_exists('the_candidate_photo')) { | |
ob_start(); | |
// Options are full, thumbnail, medium, large | |
the_candidate_photo( 'thumbnail' ); | |
return ob_get_clean(); | |
} else { | |
return 'Candidate photo function not available.'; |
NewerOlder