Last active
October 6, 2017 00:53
-
-
Save ChrisFlannagan/36e235224bb135019424fc1eed2504db to your computer and use it in GitHub Desktop.
This file contains 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 | |
/** | |
* @param $value | |
* @param $option_value | |
*/ | |
function my_special_field( $value, $option_value ) { | |
?> | |
<tr> | |
<th scope="row" class="titledesc" colspan="2"> | |
<input type="text" name="my_special_field" value="<?php esc_attr( give_get_option( 'my_special_field' ); ?>" /> | |
</th> | |
</tr> | |
<?php | |
} | |
add_action( 'give_admin_field_my_special_field', 'my_special_field', 10, 5 ); | |
/** | |
* Save the field | |
*/ | |
function save_my_special_field() { | |
if ( ! isset( $_POST['my_special_field'] ) ) { | |
return; | |
} | |
give_update_option( 'my_special_field', sanitize_text_field( $_POST['my_special_field'] ) ); | |
} | |
add_action( 'give-settings_save_gateways', 'save_my_special_field' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment