This file contains hidden or 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
add_filter( 'post_type_link', function($post_link, $id = 0){ | |
$post = get_post($id); | |
if ( is_object( $post ) ){ | |
$terms = wp_get_object_terms( $post->ID, 'offer_category' ); | |
if( $terms ){ | |
return str_replace( '%offer_category%' , $terms[0]->slug , $post_link ); | |
} | |
} | |
return $post_link; |
This file contains hidden or 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
var StickyWidget = $('.sidebar .widget:last-child'); | |
if(StickyWidget){ | |
var trigger = StickyWidget.offset().top - $('#primary-masthead').height(); | |
StickyWidget.affix({ | |
offset: { | |
top: function(){ | |
return trigger; | |
}, | |
bottom: function () { |
This file contains hidden or 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
add_action( 'in_widget_form', 'in_widget_form', 20, 3 ); | |
add_filter( 'widget_update_callback', 'widget_update_callback', 20 , 4 ); | |
add_filter( 'widget_display_callback', 'widget_display_callback', 20, 3 ); | |
function in_widget_form( &$widget, &$return, $instance ){ | |
// $instance['nav_widget_is_sticky'] = 1; | |
?> | |
<p> | |
<label> |
This file contains hidden or 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
module['exports'] = function simpleHttpRequest (hook) { | |
// npm modules available, see: http://hook.io/modules | |
var request = require('request'); | |
var options = { | |
uri: 'https://www.ourstate.com/?callback=gravityformsstripe', | |
method: 'POST', | |
json: hook.params | |
}; | |
request(options, function (err, response, body) { |
This file contains hidden or 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
if( (is_single() || is_archive() || is_home() || is_page('business-resources') ) &! ( (get_post_type() == 'application') || (get_post_type() == 'confirmation') || (get_post_type() == 'testimonial') || (get_post_type() == 'hero') || (get_post_type() == 'landing') ) ) |
This file contains hidden or 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 get_menu_posts(){ | |
if($data = get_transient('menu_posts')){ | |
return $data; | |
} else { | |
$menu_posts = new stdClass; | |
$categories = array(57,56,55,1734,20,21,23,1716,1717,39,1718); | |
foreach($categories as $category){ | |
$cat_info = get_category($category); | |
$posts = get_posts(array( | |
'posts_per_page' => 4, |
This file contains hidden or 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 get_api_terms($term_id){ | |
$posts = get_posts(array( | |
'post_type' => 'offer', | |
'posts_per_page' => -1, | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'offer_category', | |
'field' => 'term_id', | |
'terms' => $term_id, |
This file contains hidden or 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 gated_modal_add_admin_menu(){ | |
add_options_page( 'Gated Modal', 'Gated Modal', 'manage_options', 'gated_modal', array($this, 'gated_modal_options_page') ); | |
// add_submenu_page( 'edit.php', 'Gated Modal', 'Gated Modal', 'manage_options', 'gated_modal', array($this, 'gated_modal_options_page') ); | |
add_submenu_page( 'content.php', 'Gated Modal', 'Gated Modal', 'manage_options', 'options-general.php?page=gated_modal', array( $this, 'gated_modal_options_page' ) ); | |
} |
This file contains hidden or 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
jQuery(document).ready(function(e) { | |
function t(e) { | |
var t = document.getElementById(e); | |
if (t) { | |
for (var a = t.getElementsByTagName("li"), i = [], s = 0; s < a.length; s++) i.push({ | |
country: a[s].textContent, | |
item: a[s] | |
}); | |
i.sort(function(e, t) { | |
var a = e.country, |
This file contains hidden or 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
$post_types = get_post_types(array( | |
'public' => true, | |
), 'objects'); | |
foreach($post_types as $key => $value){ | |
$field_name = 'binary_stars_post_type_' . $key; | |
print_r($field_name); | |
add_settings_field( | |
$field_name, | |
__( 'Load Stars on ' . $value->labels->name, 'binary_stars' ), |