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 | |
/** | |
* redirect to permalink on click of info marker instead of opening info window | |
* Use the_permalink as the only content of your map facet marker content setting | |
* https://d.pr/i/TTb4XW | |
*/ | |
add_action( 'wp_footer', function() { ?> | |
<style> | |
.gm-style .gm-style-iw-a {display: none;} | |
</style> |
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 | |
/** | |
* Setup instructions: | |
* | |
* 1. Add the following code to your (child) theme's functions.php | |
* 2. Create a new facet named "location" | |
* 3. Set the facet type to "Proximity" | |
* 4. Set the facet's Data source to "Post Type" (as a placeholder) | |
* 5. Save and re-index | |
*/ |
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 to your (child) theme's functions.php */ | |
add_action( 'woocommerce_after_shop_loop', function() { | |
?> | |
<button class="fwp-load-more">Load more</button> | |
<?php | |
} ); |
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 map facet icon labels **/ | |
add_filter( 'facetwp_map_marker_args', function( $args, $post_id ) { | |
$args['label'] = esc_html( get_the_title( $post_id) ); | |
return $args; | |
}, 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 | |
/** filtering map styles | |
** see https://developers.google.com/maps/documentation/javascript/style-reference | |
*/ | |
add_filter( 'facetwp_map_init_args', function( $settings) { | |
$settings['init']['styles'] = json_decode( '[{"featureType":"all","elementType":"labels.text.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"all","elementType":"labels.text.stroke","stylers":[{"color":"#000000"},{"lightness":13}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#000000"}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#144b53"},{"lightness":14},{"weight":1.4}]},{"featureType":"landscape","elementType":"all","stylers":[{"color":"#08304b"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#0c4152"},{"lightness":5}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#000000"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#0b434f"},{"lightness":25}]}, |
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
/** | |
* Ultimate Member - Customization | |
* Description: Allow everyone to upload profile and cover photos on front-end pages. | |
*/ | |
add_filter("um_user_pre_updating_files_array","um_custom_user_pre_updating_files_array", 10, 1); | |
function um_custom_user_pre_updating_files_array( $arr_files ){ | |
if( is_array( $arr_files ) ){ | |
foreach( $arr_files as $key => $details ){ | |
if( $key == "userphoto" ){ |
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 fields to account page */ | |
add_action('um_after_account_general', 'showExtraFields', 100); | |
function showExtraFields() | |
{ | |
$custom_fields = [ | |
"alternate_email" => "Permanent E-mail Address", | |
"major" => "Major", | |
"minor" => "Minor", | |
"gpa" => "GPA", |
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 // only copy if needed | |
/** | |
* Removes coupon form, order notes, and several billing fields if the checkout doesn't require payment. | |
* | |
* REQUIRES PHP 5.3+ | |
* | |
* Tutorial: http://skyver.ge/c | |
*/ | |
function sv_free_checkout_fields() { |
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
add_action('um_submit_form_errors_hook', 'check_customer_code', 100 ); | |
function check_customer_code( $args ){ | |
if ( isset( $args['customer_code'] ) && $args['customer_code'] != 'ABCDE' ) | |
exit( wp_redirect( add_query_arg('err', 'invalid_customer_code') ) ); | |
} |
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: WP Invite Codes | |
Plugin URI: http://pmg.co/ | |
Description: Makes wordpress an invite only community. | |
Version: n/a | |
Author: Christopher Davis | |
Author URI: http://pmg.co/people/chris | |
*/ |
NewerOlder