xtxpatch v 0.1.1 it works fine
This commit is contained in:
@@ -22,20 +22,12 @@ function add_plugin_content_CIPF() {
|
||||
$paypal_credentials = get_paypal_options_CIPF();
|
||||
|
||||
/*
|
||||
* registration email
|
||||
* payment messages
|
||||
*
|
||||
*/
|
||||
$admin_post_email_registration = Plgntls::ADMIN_POST_EMAIL_REGISTRATION;
|
||||
$nonce_email = Plgntls::ADMIN_MENU_NONCE_EMAIL_REGISTRATION;
|
||||
$email_registration = get_email_registration_option_CIPF();
|
||||
|
||||
/*
|
||||
* registration email
|
||||
*
|
||||
$admin_post_payment_messages = Plgntls::ADMIN_POST_PAYMENT_MESSAGES;
|
||||
$nonce_payment_messages = Plgntls::ADMIN_MENU_NONCE_PAYMENT_MESSAGES;
|
||||
$payment_messages = get_payment_messages_option_CIPF();
|
||||
*/
|
||||
|
||||
ob_start();
|
||||
include(Plgntls::root_path() . '/html/menu/cipf_menu.html');
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* it means someone outside wp is accessing the file, in this case kill it.
|
||||
*/
|
||||
if (!defined('ABSPATH')) {
|
||||
die('You can not access this file!');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* use this hook 'admin_post_{$action}' to receive a form post
|
||||
* https://developer.wordpress.org/reference/hooks/admin_post_action/
|
||||
*
|
||||
* add the url to the action atrtibute of form, and the value of the action in an hidden input
|
||||
* <form method="POST" action="<?php echo admin_url( 'admin-post.php' ); ?>">
|
||||
* <input type="hidden" name="action" value="<?php echo $admin_post_patches; ?>">
|
||||
*
|
||||
*/
|
||||
function change_email_registration_CIPF() {
|
||||
Plgntls::debug_infos();
|
||||
$nonce_email = Plgntls::ADMIN_MENU_NONCE_EMAIL_REGISTRATION;
|
||||
|
||||
if (!isset($_POST[$nonce_email['_name']])) {
|
||||
redirect_menu_referer_CIPF($_POST);
|
||||
exit;
|
||||
}
|
||||
if (!wp_verify_nonce($_POST[$nonce_email['_name']], $nonce_email['_action'])) {
|
||||
redirect_menu_referer_CIPF($_POST);
|
||||
exit;
|
||||
}
|
||||
|
||||
// do actions here
|
||||
update_email_registration_option_CIPF($_POST);
|
||||
|
||||
redirect_menu_referer_CIPF($_POST);
|
||||
}
|
||||
add_action('admin_post_'.Plgntls::ADMIN_POST_EMAIL_REGISTRATION, 'change_email_registration_CIPF');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function update_email_registration_option_CIPF($post) {
|
||||
Plgntls::debug_infos();
|
||||
|
||||
|
||||
/*
|
||||
* email
|
||||
*
|
||||
*/
|
||||
$email = '';
|
||||
if (!isset($post['email'])) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
$email = $post['email'];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* is email ?
|
||||
*
|
||||
*/
|
||||
$is_email_prof = false;
|
||||
if (isset($post['is_email_prof']) && $post['is_email_prof'] === 'on') {
|
||||
$is_email_prof = true;
|
||||
}
|
||||
$is_email_partner = false;
|
||||
if (isset($post['is_email_partner']) && $post['is_email_partner'] === 'on') {
|
||||
$is_email_partner = true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* update the option with new values
|
||||
*
|
||||
*/
|
||||
set_email_registration_CIPF($email, $is_email_prof, $is_email_partner);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user