It doesn’t look like there are any actions in there for you to do that. It’s something I can add but honestly I’m pretty busy right now so I don’t know exactly when I can get it done.
Thread Starter
br3nt
(@br3nt)
Hey Aaron,
I worked out how to do it by following this tutorial.
Here is the code I ended up with:
add_action('admin_init', function() {
register_setting($wpPayPalFramework->_optionsGroup, 'sfr_paypal_id', function($val) {
return trim(wp_strip_all_tags($val, true));
});
add_settings_section('sfr_paypal_id_section', 'PayPal ID', function() { return 'PayPal ID for use in donation button'; }, 'PayPalFramework');
add_settings_field('sfr_paypal_id', 'PayPal ID or email', 'sfr_paypal_id_input', 'PayPalFramework', 'sfr_paypal_id_section');
});
function sfr_paypal_id_input() {
$paypal_id = get_option('sfr_paypal_id');
echo "<input id='sfr_paypal_id_text' name='sfr_paypal_id' size='40' type='text' value='{$paypal_id}' />";
}
Thanks for your plugin. It has made things many times simpler.
Thread Starter
br3nt
(@br3nt)
Update: The code I posted above doesn’t work. It displays the input on the PayPal settings page, but the the value doesn’t get saved. I haven’t discovered the reason why yet.