Skip to content

Instantly share code, notes, and snippets.

@atwellpub
atwellpub / software-licensing-and-updating-code-example.php
Last active August 29, 2015 13:55
InboundNow - Prepare Extensions for Licensing and Updating
<?php
function inboundnow_mailchimp_extension_setup()
{
/*PREPARE THIS EXTENSION FOR LICENSING */
if ( class_exists( 'INBOUNDNOW_EXTEND' ) )
{
$license = new INBOUNDNOW_EXTEND( INBOUNDNOW_MAILCHIMP_FILE , INBOUNDNOW_MAILCHIMP_LABEL , INBOUNDNOW_MAILCHIMP_SLUG , INBOUNDNOW_MAILCHIMP_CURRENT_VERSION , INBOUNDNOW_MAILCHIMP_REMOTE_ITEM_NAME ) ;
}
@atwellpub
atwellpub / add-extension-settings-to-global-settings-code-example.php
Last active August 29, 2015 13:55
InboundNow - Add Settings to Global Settings Section
<?php
add_filter('lp_define_global_settings','inboundnow_mailchimp_add_global_settings');
add_filter('wpleads_define_global_settings','inboundnow_mailchimp_add_global_settings');
add_filter('wp_cta_define_global_settings','inboundnow_mailchimp_add_global_settings');
function inboundnow_mailchimp_add_global_settings($global_settings)
{
switch (current_filter())
{
@atwellpub
atwellpub / example-hook.php
Created February 3, 2014 04:47
Secure WordPress JSON API with API Key
<?php
/* place in theme's functions.php file */
/* disable json api if api key not correct */
add_action('init','json_api_apikey_check' , 1 );
function json_api_apikey_check()
{
$api_key = 'hello';
$base = get_option('json_api_base', 'api');
$this_url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
<?php
/* replace core tokens if available */
$template = str_replace( '{{cta-id}}' , $selected_cta['id'] , $template );
$template = str_replace( '{{variation-id}}' , $vid , $template );
$template = str_replace( '{{template-urlpath}}' , $selected_cta['templates'][$vid]['urlpath'] , $template );
$template = str_replace( '{{wordpress-ajaxurl}}' , admin_url( 'admin-ajax.php' ) , $template );
$template = str_replace( '{{cta-width}}' , $width , $template );
$template = str_replace( '{{cta-height}}' , $height , $template );
@atwellpub
atwellpub / misc.php
Created March 26, 2014 03:50
Breeze theme fix for landing pages
<?php
function unisphere_portfolio_preset_content( $content ) {
global $post, $unisphere_options;
if ( $post->post_content == '' && $post->post_type == 'portfolio' ) {
$default_content = $unisphere_options['portfolio_default_text'];
} else {
$default_content = $content;
@atwellpub
atwellpub / functions.php
Created March 28, 2014 00:32
Solves Inboost theme conflict with WordPress Landing Pages
/* Landing Pages Theme Conflic Resolution */
if ( isset($_GET['post']) ) {
remove_action( 'widgets_init', 'inboost_widgets_init' );
}
@atwellpub
atwellpub / example.html
Created April 19, 2014 21:24
How to tell Calls to Action not to track a link as a conversion.
<a href='http://www.inboundnow.com' class='do-not-track'>Inbound Now</a>
@atwellpub
atwellpub / example-cta-variation-shortcode
Created April 20, 2014 19:42
Example call to action shortcode that targets variation
[cta id="404" vid='2']
@atwellpub
atwellpub / html.html
Created April 30, 2014 20:11
Fix for GoToWP embedded forms when Lead Tracking with WordPress Leads
<script>
jQuery(document).ready(function($) {
jQuery('#gotowp_personal_webinar_registration').addClass('wpl-track-me');
jQuery('#gotowp_personal_webinar_registration input[name="submit"]').attr('name' , 'go');
});
</script>
@atwellpub
atwellpub / .php
Created May 16, 2014 23:16
Example single-landing-page.php file for Genesis Child Theme
<?php
remove_action( 'genesis_before_post_content', 'genesis_post_info' );
/** Remove the entry meta in the entry header (requires HTML5 theme support) */
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
/** uncomment line below if you are using any after post widgets */
remove_action( 'genesis_after_post_content', 'genesis_after_post' );