Last active
July 25, 2017 00:24
-
-
Save mcfarlan/1c87701fb5645601148ec2f3ef22457c to your computer and use it in GitHub Desktop.
Override filters in RCP Address 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 | |
/* | |
Plugin Name: RCP Address Fields Filters | |
Plugin URI: http://www.vanpattenmedia.com/ | |
Description: Override filters in RCP Address Fields | |
Version: 0.0.1 | |
Author: Van Patten Media Inc. | |
Author URI: https://www.vanpattenmedia.com/ | |
Contributors: chrisvanpatten, mcfarlan | |
*/ | |
/** | |
* Display a custom message below address field editing | |
* | |
* @return string $message | |
*/ | |
function rcpaf_notice_below_address_fields() { | |
$message = sprintf( | |
'<p class="rcp_success">%1$s <a href="mailto:%2$s">%2$s</a></p>', | |
'To have your address changed, please contact', | |
'[email protected]' | |
); | |
return $message; | |
} | |
add_filter( 'rcpaf_disable_field_editing_notice_bottom', 'rcpaf_notice_below_address_fields' ); | |
/** | |
* Disable the editing of address fields once they are saved | |
* | |
* @param array $field_data | |
* | |
* @return bool | |
*/ | |
function rcpaf_disable_address_field_editing( $field_data ) { | |
return true; | |
} | |
add_filter( 'rcpaf_disable_address_field_editing', 'override_this' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment