Subscription Management (Testing)

// Save Stripe Customer ID to user meta upon user registration add_action( ‘gform_after_submission’, function ( $entry, $form ) { $form_ids = array(3,4,12); if ( ! in_array( (int)$form[‘id’], $form_ids, true ) ) { return; } // Retrieve the Stripe Customer ID…Continue reading

Transform Page Admin To Sales Pages Admin

################################# # Page Edit View ################################# function add_page_meta_boxes() { add_meta_box( ‘page_type_meta_box’, __(‘Page Settings’), ‘render_page_meta_boxes’, ‘page’, ‘side’, ‘high’ // Ensures the meta box appears first ); } add_action(‘add_meta_boxes’, ‘add_page_meta_boxes’); // Render the Meta Box function render_page_meta_boxes($post) { // Get existing values…Continue reading

Remove Author Column from Pages Admin

function remove_author_column_from_pages($columns) { if (isset($columns[‘author’])) { unset($columns[‘author’]); // Remove the “Author” column } return $columns; } add_filter(‘manage_page_posts_columns’, ‘remove_author_column_from_pages’);Continue reading

KayBee AG – Webhook on Order Payment Complete

add_action( ‘woocommerce_order_status_processing’, ‘rudr_complete’ ); function rudr_complete( $order_id ) { $order = wc_get_order( $order_id ); //$order_data = $order->get_data(); $msg = [ ‘order_id’ => $order_id, ‘site’ => get_site_url() ]; $webhook_url = ‘https://server.bergwerk.li:9000/hooks/kaybee-woocommerce-palos’; //$webhook_url = ‘https://eo9dxhypahm1gsc.m.pipedream.net’; $headers = array(‘Content-Type: application/json’); $ch = curl_init();…Continue reading

PHP: Backend Logic for Gallery Rendering

// AJAX action to handle gallery rendering add_action(‘wp_ajax_render_user_gallery’, ‘handle_render_user_gallery’); add_action(‘wp_ajax_nopriv_render_user_gallery’, ‘handle_render_user_gallery’); /** * Handle AJAX request to render the user gallery. */ function handle_render_user_gallery() { $gallery_html = get_user_gallery_html(); // Return a JSON response if (!empty($gallery_html)) { wp_send_json_success([‘html’ => $gallery_html]); }…Continue reading

Prevent AIOSEO from changing the category to the primary one

add_action( ‘admin_enqueue_scripts’, function () { if ( ! function_exists( ‘aioseo’ ) ) { return; } // Remove the “Select Primary Category” box from the post editor. wp_dequeue_script( ‘aioseo/js/src/vue/standalone/primary-term/main.js’ ); }, 100 ); // Prevent AIOSEO from changing the category to…Continue reading

Génération formulaire jetengine

add_action( ‘admin_footer’, ‘ajouter_bouton_jetengine_generer_formulaire’ ); function ajouter_bouton_jetengine_generer_formulaire() { // Vérifiez si nous sommes sur une page JetEngine $current_screen = get_current_screen(); if ( ! in_array( $current_screen->id, array( ‘jet-engine_page_meta_boxes’, ‘jet-engine_page_post_types’ ) ) ) { return; } // Ajouter le bouton avec un comportement…Continue reading

Generate and Send Invoice Number to Authorize.Net

/* * Include an invoice number into the set of Authorize.Net args. * * @link https://wpforms.com/developers/how-to-send-an-invoice-number-through-to-authorize-net-payments */ function wpf_dev_authorize_net_process_payment_single_add_invoice_to_args( $args, $process ) { // Replace 20 in $process->fields[20] to an id of your invoice field. if ( isset( $process->fields[20][ ‘value’…Continue reading