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
var google_map = {} | |
window.googleMapInitialize = function() { | |
var $map_address = $('#map-address'); | |
var map_options = { | |
zoom: 17, | |
}; | |
google_map = { |
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_action('registered_post_type', 'my_registered_post_type_handler', 10, 2); | |
function my_registered_post_type_handler($post_type, $args) { | |
do_action("my_registered_{$post_type}_post_type", $post_type, $args); | |
} | |
// Replace foo with your post type slug | |
add_action('my_registered_foo_post_type', 'my_registered_foo_post_type_handler', 10, 2); | |
function my_registered_foo_post_type_handler($post_type, $args) { |
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 | |
/** | |
* Example WordPress hook to geocode Gravity Forms fields for Geo Mashup. | |
* | |
* This example uses a form ID of 2, replace _2 with your form ID, | |
* 'address' and 'zip' with your Gravity Forms field names, and prefix | |
* with your unique namespace prefix. | |
*/ | |
add_action( 'gform_after_submission_2' 'prefix_gform_after_submission_2', 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
function convertTimestamp(timestamp) { | |
var d = new Date(timestamp * 1000), // Convert the passed timestamp to milliseconds | |
yyyy = d.getFullYear(), | |
mm = ('0' + (d.getMonth() + 1)).slice(-2), // Months are zero based. Add leading 0. | |
dd = ('0' + d.getDate()).slice(-2), // Add leading 0. | |
hh = d.getHours(), | |
h = hh, | |
min = ('0' + d.getMinutes()).slice(-2), // Add leading 0. | |
ampm = 'AM', | |
time; |
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 | |
/* | |
Seperate Woocommerce reviews from comments and make a reviews moderation panel. | |
*/ | |
class PL_Woo_Review_Mods { | |
function __construct() { | |
add_action( 'current_screen', array( $this, 'check_current_page' ), 10, 2 ); | |
add_action( 'admin_menu', array( $this, 'add_product_reviews' ) ); | |
} | |
function check_current_page( $screen ) { |
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 compiler_action( $options, $css, $changed_values ) { | |
$keys = array( | |
'header_color', | |
'header_footer_color' | |
); | |
$compile = false; | |
foreach ( $changed_values as $key => $value ) { | |
if ( in_array( $key, $keys ) ) { |
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 get_random_post_link() { | |
$args = array( | |
'orderby' => 'rand', | |
'posts_per_page' => '1', | |
); | |
$wp_query = new WP_Query( $args ); | |
if ( $wp_query->have_posts() ) : while ( $wp_query->have_posts() ) : $wp_query->the_post(); |
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 | |
/* | |
* EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR | |
* See the codex to learn more about WP text domains: | |
* http://codex.wordpress.org/Translating_WordPress#Localization_Technology | |
* Example Tribe domains: 'tribe-events-calendar', 'tribe-events-calendar-pro'... | |
*/ | |
function tribe_custom_theme_text ( $translations, $text, $domain ) { | |
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
// Make two admin-only fields (as text fields) | |
// and post to the custom fields from Gravity Forms | |
// instead of the "real" date picker. | |
// NOTE: change the input IDs to match the ones on your form | |
function rkv_datesubmit_fix ($form){ | |
//event start date field id is 3 | |
//event end date field ID is 4 | |
$raw_srt = $_POST['input_3']; | |
$raw_end = $_POST['input_4']; |
OlderNewer