Skip to content

Instantly share code, notes, and snippets.

View darknailblue's full-sized avatar

Chris Carvache darknailblue

View GitHub Profile
@darknailblue
darknailblue / gf_user_agent.php
Created October 2, 2015 14:45
Adds user agent information to the entry admin screen for Gravity Forms
<?php
add_action( 'gform_entry_info', 'djb_gform_entry_info', 10, 2 );
function djb_gform_entry_info( $form, $lead ) {
// Show IP info link if address is IPv4 and not in private or reserved range
if ( isset( $lead['ip'] ) && filter_var( $lead['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ) ) {
$ip_info_url = 'http://' . $lead['ip'] . '.ipaddress.com';
echo '<a href="' . esc_url( $ip_info_url ) . '" target="_blank">IP info</a>';
}
if ( isset( $lead['ip'] ) && isset( $lead['user_agent'] ) ) {
echo '<br><br>';
@darknailblue
darknailblue / gf_enqueue_higher.php
Created September 23, 2015 20:26
Enqueue GF in Head
/**
* ==============================================
* ENQUEUE_GF_HIGHER
* ==============================================
* Enqueues gravity forms scripts higher on the page
*
*
* @since 0.1.0
* @version 0.1.0
* @author chriscarvache
@darknailblue
darknailblue / ribbon.css
Last active September 23, 2015 17:53
Ribbon CSS Code
.ribbon {
width: 80%;
position: relative;
color: #fff;
text-align: center;
padding: 1em 2em; /* Adjust to suit */
margin: 0 auto 2em; /* Based on 24px vertical rhythm. 48px bottom margin - normally 24 but the ribbon 'graphics' take up 24px themselves so we double it. */
}
.ribbon:before, .ribbon:after {
content: "";