Skip to content

Instantly share code, notes, and snippets.

View gist:5a2753f035c89e2c2323
add_action( 'wp_head', 'custom_event_meta' );
function custom_event_meta(){
// reregister meta (this will merge settings into the original registered settings)
tribe_register_meta(
'tribe_event_website', array(
'classes' => array( 'meta_before' => array( 'url' ) ),
'label' => __( 'Register Here:' ),
'register_overwrite' => true, // set to TRUE in order to overwrite the core registration
'filter_callback' => array('Tribe_Register_Meta', 'event_website'),
'priority' => 50,
View get_pages() with pre_get_posts
function site_child($pid) {
$site_term = io_multi_get_var('term', null); //this is working properly from another function
$args = array(
'child_of' => $pid,
'hierarchical' => 0,
'parent' => $pid,
);
// http://codex.wordpress.org/Function_Reference/get_pages
$children = get_pages($args);
View get_pages problem with home page
function site_child($pid) {
$site_term = io_multi_get_var('term', null); //this is coming from a different function. it works.
$args = array(
'child_of' => $pid,
'hierarchical' => 0,
);
// http://codex.wordpress.org/Function_Reference/get_pages
$children = get_pages($args);
@360Zen
360Zen / gravity form handling
Last active Aug 29, 2015
Gravity/Authorize.net/PayPal
View gravity form handling
<?php
# use at your own risk :)
/**
* E-COMM -- Custom Authorize.Net AIM api call for GravityForms
*
* GravityForms AuthorizeNet Add-on does NOT handle eChecks (or two Authorize.net accounts), so we bypass the add-on entirely for the API call, but keep it installed and activated, just to use it's Credit Card field on the form. We bypass it by enabling the Authorize.net Condition (in the GF Authorizet.net Feed settings), and creating a condition that should never happen (like: if Email = "disable-me@xyz.com").
* Of course, modify the input/field/form IDs based on YOUR form.
* This setup assumes your form has a field to allow the user to select a Payment Method: either "Credit Card" or "eCheck".
*/
View hover animation
.custom-frame {
.tl, .tr, .bl, .br {
-webkit-transform: translate(0, 0);
-moz-transform: translate(0, 0);
-ms-transform: translate(0, 0);
-o-transform: translate(0, 0);
transform: translate(0, 0);
-webkit-transition: -webkit-transform .15s cubic-bezier(0.645, 0.045, 0.355, 1.000); /* Changed here */
-moz-transition: -moz-transform .15s cubic-bezier(0.645, 0.045, 0.355, 1.000);
-o-transition: -o-transform .15s cubic-bezier(0.645, 0.045, 0.355, 1.000);
@360Zen
360Zen / encryptForDb.php
Created Feb 15, 2018
This is the function used to encrypt entries for my db
View encryptForDb.php
<?php
function encryptForDb($str) {
$gpg = new gnupg();
$fingerprint = MY_FINGERPRINT;
$gpg->addencryptkey($fingerprint);
$enc = $gpg->encrypt($str);
return $enc;
}