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
<?php | |
/** | |
* Create store post type | |
* | |
* @author Phil Wylie | |
* @link http://goo.gl/bjc6XV | |
*/ | |
function pw_register_store_post_type() { | |
$labels = array( | |
'name' => 'Stores', |
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
<?php | |
/** | |
* Metabox to save store information | |
* | |
* @author Phil Wylie | |
* @link http://goo.gl/zJwIk5 | |
*/ | |
function pw_register_store_metabox( $meta_boxes ) { | |
$prefix = '_cmb_'; // Prefix for all fields |
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
<?php | |
$args = array( | |
'posts_per_page' => -1, | |
'post_type' => 'store' | |
); | |
$stores = new WP_Query( $args ); | |
?> | |
<?php if ( $stores->have_posts() ) : ?> | |
<div id="store-locations-map" style="width: 100%; height: 300px;"></div> |
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( $ ) { | |
$( document ).ready( function() { | |
var myMapOptions = { | |
zoom: 15, | |
mapTypeId: google.maps.MapTypeId.ROADMAP | |
}; | |
var map = new google.maps.Map( document.getElementById( 'store-locations-map' ), myMapOptions ); | |
var markerBounds = new google.maps.LatLngBounds(); |
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
<?php | |
wp_register_script( 'pw-google-maps-api', 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false', null, null, true ); | |
wp_enqueue_script( 'pw-store-locations', get_stylesheet_directory_uri() . '/js/store-locations.js', array( 'jquery', 'pw-google-maps-api' ), null, true ); |
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
<?php | |
/* | |
Plugin Name: Enable background updates for version controlled sites | |
Plugin URI: http://www.iweb.co.uk/ | |
Description: Override the check for version controlled checkouts to allow automatic updates. | |
Version: 1.0 | |
Author: iWeb | |
Author URI: http://www.iweb.co.uk/ | |
*/ | |
add_filter( 'automatic_updates_is_vcs_checkout', '__return_false' ); |
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
<?php | |
/* | |
Plugin Name: Disable all WordPress auto update email notifications | |
Plugin URI: http://www.iweb.co.uk/ | |
Description: Disable all WordPress auto update email notifications following an automatic update. | |
Version: 1.0 | |
Author: iWeb | |
Author URI: http://www.iweb.co.uk/ | |
*/ | |
add_filter( 'auto_core_update_send_email', '__return_false' ); |
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
<?php | |
/* | |
Plugin Name: Change WordPress auto update email address | |
Plugin URI: http://www.iweb.co.uk/ | |
Description: Change the email address auto update notifications are sent to following an automatic update. | |
Version: 1.0 | |
Author: iWeb | |
Author URI: http://www.iweb.co.uk/ | |
*/ | |
function iweb_filter_auto_update_email( $email ) { |
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
<?php | |
/** | |
* Filter a few parameters into YouTube oEmbed requests | |
* | |
* @link http://goo.gl/yl5D3 | |
*/ | |
function iweb_modest_youtube_player( $html, $url, $args ) { | |
return str_replace( '?feature=oembed', '?feature=oembed&modestbranding=1&showinfo=0&rel=0', $html ); | |
} | |
add_filter( 'oembed_result', 'iweb_modest_youtube_player', 10, 3 ); |
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
<?php | |
/** | |
* Don't update this plugin | |
* | |
* This prevents you from being prompted to update if there's a public plugin | |
* with the same name. | |
* | |
* @author Phil Wylie | |
* @link http://link.from.pw/1cFfcFZ | |
* @param array $r Request arguments |