This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.
— Erik
<?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 | |
*/ |
add_action( 'after_setup_theme', 'woocommerce_support' ); | |
function woocommerce_support() { | |
add_theme_support( 'woocommerce' ); | |
} |
<?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 | |
*/ |
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') ) ); | |
} |
<?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() { |
<?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", |
/** | |
* 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" ){ |
<?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}]}, |
<?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 ); |