Skip to content

Instantly share code, notes, and snippets.

View apintocr's full-sized avatar

António Pinto apintocr

View GitHub Profile
@apintocr
apintocr / edit_divi_contact_form_subject.php
Last active December 10, 2019 15:58
Edit Subject on Divi Contact Form (using add_filter)
<?php
/**
* Edit Subject on Divi Contact Form (using add_filter)
*
* Divi contact form does not allow you to change the subject from the interface.
* The problem is that on clients like Gmail the messages get threaded/organized under the same item/title.
* To solve this we need a unique subject for each new contact.
* However, Divi contact module does not have many hooks or filters, only allowing us to change the $headers[]
* This would be great if the 'Subject:' was set on that variable, it is not, so we need to ADD a extra 'Subject:'
* not an ideal solution, but it works and currently it is the only way to do this without editing the theme files.

Keybase proof

I hereby claim:

  • I am apintocr on github.
  • I am apintocr (https://keybase.io/apintocr) on keybase.
  • I have a public key ASCDtX-QTGEj2cVE1dTxEwJoy_-Z5CrpU3Sax70BR0S0ogo

To claim this, I am signing this object:

@apintocr
apintocr / filterContactFormRecipient.php
Last active April 24, 2018 20:10
Contact Form 7 - Conditionally Chance Recipient to Post Meta
<?php
/**
* Contact Form 7 - Conditionally Chance Recipient to Post Meta
*
* This function gets the current post id and grabs the desired meta to use
* it on the submited form data to change the recipient email conditionally.
* You can add some conditional checks to make sure the data is correct.
*
* @author António Pinto <apinto@vanguardly.com>
* @link https://gitlab.com/snippets/1662384
@apintocr
apintocr / wp-query-ref.php
Created February 11, 2017 15:27
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference.
*
* All credits go to luetkemj. Thanks!
*
* @author luetkemj <luetkemj@gmail.com>
* @author s3rgiosan <me@s3rgiosan.com>
*
* @see http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
@apintocr
apintocr / wc-bookings-availability-search.php
Last active September 15, 2022 12:16
WooCommerce Bookings Availability Search
<?php
/**
* WooCommerce Bookings Availability Search
*
* This is almost pseudo code, it only serves to explain the "how to do it" and does not attempt to be "The Way" to do it.
* NOTE: This NEEDS to be refined in order to work as expected.
*
* @author António Pinto <apinto@vanguardly.com>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*