Skip to content

Instantly share code, notes, and snippets.

View pbearne's full-sized avatar

Paul Bearne pbearne

View GitHub Profile
@pbearne
pbearne / matador-privacy-checkbox-text.php
Last active May 19, 2020 11:45
matador privacy checkbox text
function matador_privacy_policy_opt_in_label( $fields ) {
$fields['privacy_policy_opt_in']['options']['1'] = esc_html( 'By submitting this application, you give us permission to store your personal
information, and use it in the consideration of your fitness for the position,
including sharing it with the hiring firm.' ); // changes the label
return $fields;
}
add_filter( 'matador_application_fields_structure', 'matador_privacy_policy_opt_in_label' );
if( ! function_exists( 'matador_get_hiring_organization_url') ) {
add_filter( 'matador_get_hiring_organization_url', 'matador_get_hiring_organization_url' );
// reset the compamy URL to default vaalue
function matador_get_hiring_organization_url( $org_url ){
return get_bloginfo('url');
}
}
if( ! function_exists( 'matador_get_hiring_organization_name') ) {
add_filter( 'matador_get_hiring_organization_name', 'matador_get_hiring_organization_name' );
// replace teh name of hireing company
function matador_get_hiring_organization_name( $org_name ){
return 'Matador Jobs';
}
}
if( ! function_exists( 'matador_get_hiring_organization_logo') ) {
// lets add logo to the caompany
add_filter( 'matador_bullhorn_import_save_job_jsonld', 'matador_get_hiring_organization_logo' );
function matador_get_hiring_organization_logo( $ld_data ){
$ld_data['hiringOrganization']['logo'] = 'https://matadorjobs.com/matador-jobs-avatar-transparent-red.png';
return $ld_data;
}
@pbearne
pbearne / gist:87b8f2ca64c7dbb40c39eb07b2b2be81
Created January 12, 2018 15:20
matador_reset_list_filter_text filter example
function matador_reset_list_filter_text( $text, $tax_slug ){
switch ( $tax_slug ) {
case 'matador-locations';
return __( 'Show All Locations', 'text-domain' );
break;
case 'matador-categories';
return __( 'Show All Gategories', 'text-domain' );
function matador_default_required_fields( $fields ) {
return array(
'first_and_last_name',
'email',
'phone',
);
}
add_filter( 'matador_default_required_fields', 'matador_default_required_fields' );
// or
function matador_application_default_fields( $methods ){
return array(
'first_and_last_name',
'email',
'phone',
'profile',
'resume',
);
}
add_filter( 'matador_application_fields_defaults', 'matador_application_default_fields' );
@pbearne
pbearne / gist:9b893108ccebe4c4783eefce0ee9f5a9
Created November 23, 2016 19:51
wordpress time offset
$original_timezone = new DateTimeZone( 'UTC' );
// Instantiate the DateTime object, setting it's date, time and time zone.
$datetime = new DateTime( $time_to_change, $original_timezone );
$blog_timezone = get_option( 'timezone_string' );
// timezone not set use offset
if ( ! empty( $blog_timezone ) ) {
// Set the DateTime object's time zone to convert the time appropriately.

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@pbearne
pbearne / gist:605d09919ab454062e71
Created October 15, 2014 14:03
loop wp cli to make post per month
for i in {01,02,03,04,05,06,07,08,09,10,11,12}; do curl http://loripsum.net/api/5 | wp post generate --post_content --count=1 --post_date=2013-$i-1 --url=vvv.dev/path ;done;