This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function prefix_get_field( $key, $id = null ){ | |
if( !$id ) | |
$id = get_the_id(); | |
if( function_exists('get_field') ){ | |
return get_field( $key, $id ); | |
}else{ | |
return get_post_meta( $id, $key, true ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getInternetExplorerVersion() | |
{ | |
var rv = -1; | |
if (navigator.appName == 'Microsoft Internet Explorer') | |
{ | |
var ua = navigator.userAgent; | |
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); | |
if (re.exec(ua) != null) | |
rv = parseFloat( RegExp.$1 ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter("gform_currencies", "add_na_currency"); | |
function add_na_currency($currencies) { | |
$currencies['NA'] = array( | |
"name" => __("N/A", "gravityforms"), | |
"symbol_left" => '', | |
"symbol_right" => "", | |
"symbol_padding" => " ", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_shortcode('location_date','location_date_sc') | |
function location_date_sc( $atts, $content ){ | |
extract( shortcode_atts( array( | |
'post_id' => get_the_id(), | |
), $atts, 'location_date' ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function email_feed_post_limit( $limit, $query ) { | |
if ( ! is_admin() && $query->is_feed() && isset( $_GET['email'] ) && $_GET['email'] ) { | |
return 'LIMIT 0, 10'; | |
} | |
return $limit; | |
} | |
add_filter( 'post_limits', 'email_feed_post_limit', 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
How to use: | |
1. Create a custom field at SalesForce, long enough to hold your longest page title (i.e. at least 255 characters) | |
2. Replace PAGE_TITLE_CUSTOM_FIELD_NAME below with the name of the custom field you setup in SalesForce, | |
it will be something like PageTitle__c | |
3. Add a hidden field to your form(s) with the same field name (e.g. "PageTitle__c") | |
4. Profit | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function fix_pb_cover_image( $metadata, $object_id, $meta_key, $single ) { | |
if( isset( $meta_key ) && 'pb_cover_image' == $meta_key && is_ssl() ) | |
return str_replace( 'http://', 'https://', $metadata ); | |
return $metadata; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Genesis Simple Sidebars | |
Plugin URI: http://www.studiopress.com/plugins/simple-sidebars | |
Description: Genesis Simple Sidebars allows you to easily create and use new sidebar widget areas. | |
Author: Nathan Rice | |
Author URI: http://www.nathanrice.net/ | |
Text Domain: ss | |
Domain Path: /languages/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Save user ip in a specific field | |
// -- replace user_ip__c with your custom field name | |
// -- make that a hidden text field in your lead form (make sure it's enabled) | |
// -- make sure it can store up to 45 characters (for IPv6 addresses) | |
add_filter( 'salesforce_w2l_field_value', 'salesforce_w2l_ip_field', 10, 3 ); | |
function salesforce_w2l_ip_field( $val, $field, $form ){ | |