Skip to content

Instantly share code, notes, and snippets.

@robertdevore
Created January 14, 2019 20:24
Show Gist options
  • Save robertdevore/7a9c420ae236378ea7a2bac38b2de9bc to your computer and use it in GitHub Desktop.
Save robertdevore/7a9c420ae236378ea7a2bac38b2de9bc to your computer and use it in GitHub Desktop.
Filter the text displayed for the "apply to become a driver" page
<?php
/**
* Driver Dadshboard - Access Denied Filter
*/
function acme_access_denied( $access_denied ) {
if ( false !== get_option( 'ddwc_pro_settings_driver_application' ) && 'yes' == get_option( 'ddwc_pro_settings_driver_application' ) ) {
if ( false !== get_option( 'ddwc_pro_settings_contact_page' ) && 'none' !== get_option( 'ddwc_pro_settings_contact_page' ) ) {
$contact_link = get_permalink( get_option( 'ddwc_pro_settings_contact_page' ) );
} else {
$contact_link = 'mailto:' . get_option( 'admin_email' );
}
$access_denied = "<h3 class='ddwc access-denied'>" . __( 'Apply to become a driver', 'ddwc-pro' ) . "</h3>";
$access_denied .= "<p>" . __( 'Want to become a delivery driver for our company?', 'ddwc-pro' ) . "</p>";
$access_denied .= "<p><a href='" . $contact_link . "' class='button'>" . __( 'Contact Us', 'ddwc-pro' ) . "</a></p>";
} else {
// Do nothing.
}
return $access_denied;
}
add_filter( 'ddwc_access_denied', 'acme_access_denied', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment