Type: php
PHP [Profile Builder]: Submit a Vendor Profile Claim, Create or Edit Vendor Record on Successful User Profile Update – OLD
// When the user profile form is updated, this snippet checks if the business_name field matches a preexisting vendor post title. // If so, a vendor profile claim request is sent to the ‘Vendor Claims’ admin page // This snippet…Continue reading
PHP [Profile Builder]: Submit a Vendor Profile Claim, Create or Edit Vendor Record on Successful User Profile Update
// This code snippet is run when a Profile Builder user profile is successfully updated, it: // – checks if the business_name field matches a vendor post title a vendor profile claim request is sent to the ‘Vendor Claims’ admin…Continue reading
PHP [Profile Builder]: Submit a Vendor Profile Claim, Create or Edit Vendor Record on Successful User Profile Update
// This code snippet is run when a Profile Builder user profile is successfully updated, it: // – checks if the business_name field matches a vendor post title a vendor profile claim request is sent to the ‘Vendor Claims’ admin…Continue reading
PHP [Vendor Claims]: Vendor Claims Management Interface
// This code snippet creates an admin page for managing vendor profile claims. // It allows administrators to approve or deny claims, which updates the ownership of vendor posts accordingly. // The Vendor Claims page displays pending claims and provides…Continue reading
PHP [Vendor Claims]:
function vendor_claim_admin_menu() { add_menu_page( ‘Vendor Claims’, ‘Vendor Claims’, ‘manage_options’, ‘vendor-claims’, ‘vendor_claims_page’, ‘dashicons-businessman’, 30 ); } add_action(‘admin_menu’, ‘vendor_claim_admin_menu’); function vendor_claims_page() { global $wpdb; $claims = $wpdb->get_results(“SELECT post_id, meta_value as user_id FROM {$wpdb->postmeta} WHERE meta_key = ‘pending_claim_by_user’”); echo ‘ Vendor Claims ‘;…Continue reading
ConexionBD
// Código PHP echo “Entrada a Conexión de la BD\n”; // Database hostname define(‘DBHOST’, ‘localhost:3306’); // Database username define(‘DB_USER’, ‘wp_j4cbx’); // Database password define(‘DB_PASSWORD’, ‘uDFmf0E~?a2YgVj0’); // Nombre de la BD define( ‘DB_NAME’, ‘wp_n5p5f’); $conexion = mysqli_connect(DBHOST, DB_USER, DB_PASSWORD, DB_NAME); echo…Continue reading
WP Simple Pay: Stripe Checkout – Subscription Confirmation
/** * Ensure Customer Subscriptions are available in the payment confirmation data. */ add_filter( ‘simpay_payment_confirmation_data’, function( $payment_confirmation_data ) { $subscriptions = \SimplePay\Core\API\Subscriptions\all( array( ‘customer’ => $payment_confirmation_data[‘customer’]->id, ‘limit’ => 1, ‘status’ => ‘all’, ‘expand’ => array( ‘data.latest_invoice’, ‘data.latest_invoice.payment_intent’, ), ), $payment_confirmation_data[‘form’]->get_api_request_args()…Continue reading
Untitled Snippet
Clear Auto Fill in WooCommerce Checkout
/** * Start Remove Autofill Checkout **/ add_filter(‘woocommerce_checkout_get_value’, ‘prefix_return_empty_checkout’, 10, 2); function prefix_return_empty_checkout($value, $key) { // List of fields to clear $fields_to_clear = array( ‘billing_first_name’, ‘billing_last_name’, ‘billing_company’, ‘billing_country’, ‘billing_address_1’, ‘billing_address_2’, ‘billing_city’, ‘billing_state’, ‘billing_postcode’, ‘billing_phone’, ‘billing_email’, ‘shipping_first_name’, ‘shipping_last_name’, ‘shipping_company’, ‘shipping_country’, ‘shipping_address_1’,…Continue reading