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 | |
| if ( file_exists( dirname( __FILE__ ) . '/local-config.php' ) ) { | |
| include( dirname( __FILE__ ) . '/local-config.php' ); | |
| define( 'WP_LOCAL_DEV', true ); // We'll talk about this later | |
| } else { | |
| define( 'DB_NAME', 'production_db' ); | |
| define( 'DB_USER', 'production_user' ); | |
| define( 'DB_PASSWORD', 'production_password' ); | |
| define( 'DB_HOST', 'production_db_host' ); | |
| } | 
  
    
      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 | |
| /** | |
| * Regsiter script | |
| */ | |
| add_action( 'wp_enqueue_scripts', function() { | |
| // Set dependency to wp-api, which has nonce and endpoint root. | |
| wp_enqueue_script( 'api-handler', '/path/to/api-handler.js', [ 'jquery', 'wp-api' ], '1.0', true ); | |
| } ); | |
| // Below is the content of api-handler.js | |
| ?> | 
  
    
      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
    
  
  
    
  | ol { | |
| list-style: none; | |
| counter-reset: li; | |
| } | |
| ol > li { | |
| counter-increment: li; | |
| margin-bottom: 7px; | |
| } | 
  
    
      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 | |
| add_filter( 'script_loader_src', 'remove_src_version' ); | |
| add_filter( 'style_loader_src', 'remove_src_version' ); | |
| function remove_src_version ( $src ) { | |
| global $wp_version; | |
| $version_str = '?ver='.$wp_version; | |
| $version_str_offset = strlen( $src ) - strlen( $version_str ); | |
| $version_str_alt = '&ver='.$wp_version; | |
| $version_str_offset_alt = strlen( $src ) - strlen( $version_str_alt ); | 
  
    
      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
    
  
  
    
  | javascript:void(function()%7Bvar i,a,s%3Ba%3Ddocument.getElementsByTagName(%27link%27)%3Bfor(i%3D0%3Bi<a.length%3Bi%2B%2B)%7Bs%3Da%5Bi%5D%3Bif(s.rel.toLowerCase().indexOf(%27stylesheet%27)>%3D0%26%26s.href) %7Bvar h%3Ds.href.replace(/(%26%7C%5C%3F)forceReload%3D%5Cd%2B/,%27%27)%3Bs.href%3Dh%2B(h.indexOf(%27%3F%27)>%3D0%3F%27%26%27:%27%3F%27)%2B%27forceReload%3D%27%2B(new Date().valueOf())%7D%7D%7D)()%3B | 
  
    
      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
    
  
  
    
  | // Just set the pointer-events: none CSS to the <iframe> to disable mouse scroll. | |
| /* | |
| <div id="gmap-holder"> | |
| <iframe width="100%" height="400" frameborder="0" style="border:0; pointer-events:none" | |
| src="https://www.google.com/maps/embed/v1/place?q=XXX&key=YYY"></iframe> | |
| </div> | |
| If you want the mouse scroll to be activated when the user clicks into the map, then use the following JS code. | |
| It will also disable the mouse scroll again, when the mouse moves out of the map. | 
  
    
      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 plugins when doing local dev | |
| Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify | |
| Version: 0.1 | |
| License: GPL version 2 or any later version | |
| Author: Mark Jaquith | |
| Author URI: http://coveredwebservices.com/ | |
| */ | 
  
    
      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 | |
| /** | |
| * Get field key for field name. | |
| * Will return first matched acf field key for a give field name. | |
| * | |
| * ACF somehow requires a field key, where a sane developer would prefer a human readable field name. | |
| * http://www.advancedcustomfields.com/resources/update_field/#field_key-vs%20field_name | |
| * | |
| * This function will return the field_key of a certain field. | 
  
    
      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
    
  
  
    
  | ul { | |
| list-style: none; | |
| margin-bottom: 1em; | |
| } | |
| ul li { | |
| list-style: none; | |
| position: relative; | |
| padding-left: 16px; | |
| padding-bottom: 0; | 
  
    
      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
    
  
  
    
  | /** | |
| * For developers: WordPress debugging mode. | |
| * | |
| * Change this to true to enable the display of notices during development. | |
| * It is strongly recommended that plugin and theme developers use WP_DEBUG | |
| * in their development environments. | |
| */ | |
| define('WP_DEBUG', false); | |
| define( 'WP_DEBUG_DISPLAY', false ); | |
| define( 'WP_DEBUG_LOG', true ); |