From 1262aeb70676bdac6205b98f2995cd773bc6b559 Mon Sep 17 00:00:00 2001 From: asus Date: Wed, 21 Feb 2024 23:58:53 +0100 Subject: [PATCH] wip paypal tests --- plugins/fipfcard_plugin/fipfcard_plugin.php | 86 ++++++++++++++++++- .../fipfcard_plugin/html/example_index.html | 4 + private | 2 +- 3 files changed, 88 insertions(+), 4 deletions(-) diff --git a/plugins/fipfcard_plugin/fipfcard_plugin.php b/plugins/fipfcard_plugin/fipfcard_plugin.php index cee8974..3be4bcc 100644 --- a/plugins/fipfcard_plugin/fipfcard_plugin.php +++ b/plugins/fipfcard_plugin/fipfcard_plugin.php @@ -79,6 +79,7 @@ $data = $data->user_email; $acf_get_fields = get_fields( get_the_ID() ); $user_data = get_userdata( get_current_user_id() ); $current_user = wp_get_current_user(); + $user_email = get_field('user_email', 'MarieM'); return $fipfcard_tools->add_to_front @@ -103,6 +104,7 @@ $data = $data->user_email; "acf_get_fields", "user_data", "current_user", + "user_email", "names", "ages", ) @@ -120,13 +122,91 @@ function custom_frontend_posting_form() { } add_shortcode('custom_frontend_posting_form', 'custom_frontend_posting_form'); +// function author_shortode_test($field) { +// // global $authordata; +// // $user_id = $authordata->ID; +// +// $author_username = get_query_var('author_name'); +// $author = get_user_by('slug', $author_username); +// $user_id = $author->ID; +// +// $acf_field = $field['field']; +// $acf_post_id = "user_{$user_id}"; +// +// $acf_shortcode = "[acf field='" . $acf_field . "' post_id='" . $acf_post_id . "']"; +// +// error_log("---"); +// error_log("acf_shortcode:"); +// error_log($acf_shortcode); +// // error_log("get_userdata:"); +// // error_log(json_encode(get_userdata($user_id)->data->user_email)); +// error_log("get_fields($acf_post_id):"); +// error_log(json_encode(get_fields($acf_post_id))); +// error_log("get_field($acf_field, $acf_post_id):"); +// error_log(json_encode(get_field($acf_field, $acf_post_id))); +// +// //$shortcode = "[acf field=" . $field['field'] . "]"; +// wp_reset_query(); +// $acf_return = do_shortcode($acf_shortcode); +// // error_log("acf_return:"); +// // error_log(json_encode($acf_return)); +// return $acf_return; +// // regarder option repeter de diviengine +// // peutetre plugin gratuit ? +// // plugin menu avec conditions +// } +// add_shortcode('fipf_acf', 'author_shortode_test', 10, 1); + + + +function check_paypal_request() +{ + error_log("----"); + if (is_page('paypal_ok')) + error_log("on paypal_ok"); + else if (is_page('paypal_infos')) + error_log("on paypal_infos"); + else + return; + error_log("_GET"); + error_log(json_encode($_GET)); + error_log("_POST"); + error_log(json_encode($_POST)); +} +add_action('template_redirect', 'check_paypal_request'); + +function paypal_shortcode_content() +{ + ob_start(); + ?> +
+ + + + +
+ +

get_field('user_email') :

+

+ +

i am a new p

to change

diff --git a/private b/private index 99052ab..498434c 160000 --- a/private +++ b/private @@ -1 +1 @@ -Subproject commit 99052ab8998c441bf886e34b10fdb5de826f2349 +Subproject commit 498434c7fcc3a6dac7f701e04c4d4b3d3ab44030