Skip to content

Instantly share code, notes, and snippets.

View jom's full-sized avatar
🌮

Jake Morrison jom

🌮
View GitHub Profile
@jom
jom / functions.php
Last active November 27, 2019 13:22
Redirect when an application is submitted
add_action( 'new_job_application', function( $application_id, $job_id ) {
if ( is_object( $job_id ) ) {
// We're in WP core's hook.
return;
}
wp_safe_redirect( home_url( '/page-success-application' ) );
exit;
}, 999, 2 );
@jom
jom / keybase.md
Created December 5, 2019 14:47
Keybase

Keybase proof

I hereby claim:

  • I am jom on github.
  • I am jakeom (https://keybase.io/jakeom) on keybase.
  • I have a public key ASCmHzniJb6QigpFMxSq9IBDYDSqzcJ3q0SURRqhq1sP-Ao

To claim this, I am signing this object:

@jom
jom / functions.php
Created April 9, 2019 18:55
Change jQuery UI CSS
<?php
add_action( 'wp_loaded', function() {
wp_deregister_style( 'jquery-ui' );
$jquery_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.9.2';
wp_register_style( 'jquery-ui', '//code.jquery.com/ui/' . $jquery_version . '/themes/black-tie/jquery-ui.css', array(), $jquery_version );
}, 11 );
@jom
jom / 0-enrolment-snippets.php
Last active April 27, 2020 12:42
Sensei Enrolment Related Snippets
<?php
/**
* Below are some snippets for modifying behavior related to Sensei LMS v3.0.0's new enrolment strategy.
*
* Most of these should be in place prior to upgrading to Sensei LMS 3.0.0.
*
* These may change in later releases and are just meant to be a guide.
*/
@jom
jom / disable-guest-enrolment-check.php
Created April 28, 2020 16:12
Disable guest enrollment check
<?php
add_filter(
'sensei_is_enrolled',
function( $is_enrolled, $user_id ) {
if ( empty( $user_id ) ) {
return false;
}
return $is_enrolled;
},
@jom
jom / functions.php
Last active December 30, 2020 20:56
Remove Resume Preview Step
<?php
/**
* Remove the preview step when submitting resumes. Code goes in theme functions.php or custom plugin.
* @param array $steps
* @return array
*/
add_filter( 'submit_resume_steps', function( $steps ) {
@jom
jom / redirecToJD.php
Created February 4, 2019 15:54
Redirect to job dashboard after job has been submitted
add_filter( 'job_manager_job_submitted', function() {
if ( wp_redirect( job_manager_get_permalink( 'job_dashboard' ) ) ) {
exit;
}
}, 20 );