Skip to content

Instantly share code, notes, and snippets.

:shipit:
Working from home

Mike Jolley mikejolley

:shipit:
Working from home
Block or report user

Report or block mikejolley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mikejolley
mikejolley / gist:8862027
Created Feb 7, 2014
Get a list of Transifex contributors from WordPress for a project
View gist:8862027
$project_name = 'woocommerce-core';
$your_username = 'YOURUSERNAME';
$your_password = 'YOURPASSWORD'; // Don't include this in open source projects for obvious reasons :)
$response = wp_remote_post( 'http://www.transifex.com/api/2/project/' . $project_name . '/languages/', array(
'method' => 'GET',
'headers' => array(
'Authorization' => 'Basic ' . base64_encode( $your_username . ':' . $your_password )
)
) );
@mikejolley
mikejolley / gist:9476823
Created Mar 10, 2014
WP Job Manager - Remove company fields
View gist:9476823
add_filter( 'submit_job_form_fields', 'custom_submit_job_form_fields' );
function custom_submit_job_form_fields( $fields ) {
unset( $fields['company'] );
return $fields;
}
@mikejolley
mikejolley / gist:9531799
Created Mar 13, 2014
Show more jobs in the feeds
View gist:9531799
add_filter( 'job_feed_args', 'custom_job_feed_args' );
function custom_job_feed_args( $args ) {
$args['posts_per_page'] = 20;
return $args;
}
@mikejolley
mikejolley / gist:9554215
Last active Aug 29, 2015
WP Job Manager - Change post_name when posting a job via the frontend.
View gist:9554215
add_filter( 'submit_job_form_save_job_data', 'custom_submit_job_form_save_job_data', 10, 5 );
function custom_submit_job_form_save_job_data( $data, $post_title, $post_content, $status, $values ) {
$job_slug = array();
// Prepend with company name
if ( ! empty( $values['company']['company_name'] ) )
$job_slug[] = $values['company']['company_name'];
@mikejolley
mikejolley / gist:10305752
Created Apr 9, 2014
WC Transifex config
View gist:10305752
[main]
host = https://www.transifex.com
[woocommerce.woocommerce-admin-pot]
file_filter = languages/woocommerce-admin-<lang>.po
source_file = languages/woocommerce-admin.pot
source_lang = en
type = PO
[woocommerce.woocommerce-pot]
@mikejolley
mikejolley / gist:10782775
Created Apr 15, 2014
WP Job Manager - Custom login url for submit form
View gist:10782775
/** Code goes in theme functions.php **/
add_filter( 'submit_job_form_login_url', 'custom_submit_job_form_login_url' );
function custom_submit_job_form_login_url() {
return 'http://someurl.com';
}
@mikejolley
mikejolley / gist:b2fa3d912ed9f7b114ee
Created May 24, 2014
Change the job application email link subject using a filter
View gist:b2fa3d912ed9f7b114ee
add_filter( 'job_manager_application_email_subject', 'custom_job_manager_application_email_subject', 10, 2 );
// This is your hooked in function. Note: the $post variable is only available after v1.11.2
function custom_job_manager_application_email_subject( $subject, $post ) {
// By default, $subject will contain: Job Application via "X" listing on X. Change that below
$subject = 'New subject';
// Return the new subject
return $subject;
}
@mikejolley
mikejolley / gist:3eeaabef9046f6a4a79b
Created Jun 18, 2014
WP Job Manager - Indeed related jobs
View gist:3eeaabef9046f6a4a79b
<?php echo do_shortcode('[indeed_jobs limit="5" q="' . $post->post_title . '" l="' . $post->geolocation_formatted_address . '" co="' . $post->geolocation_country_short . '" sort="relevance"]'); ?>
@mikejolley
mikejolley / gist:70587a1f89c12c3540d4
Last active Aug 29, 2015
Job Applications - Form customisation
View gist:70587a1f89c12c3540d4
// Add a new field
add_filter( 'job_application_form_fields', 'custom_job_application_form_fields' );
function custom_job_application_form_fields( $fields ) {
$fields[ 'your_field' ] = array(
'label' => 'Label for field',
'type' => 'text',
'required' => true,
'placeholder' => 'Placeholder text',
'priority' => 6
@mikejolley
mikejolley / gist:416df06fcf593c26285f
Created Jul 10, 2014
WP Job Manager - Notify admin when a job is edited
View gist:416df06fcf593c26285f
add_action( 'post_updated', 'notify_on_job_updated' );
function notify_on_job_updated( $post_ID ) {
if ( 'job_listing' === get_post_type( $post_ID ) ) {
wp_mail( get_option( 'admin_email' ), 'Job Updated', sprintf( 'Job %d has been updated: %s', $post_ID, get_permalink( $post_ID ) ) );
}
}
You can’t perform that action at this time.