Skip to content

Instantly share code, notes, and snippets.

View c3mdigital's full-sized avatar

Chris Olbekson c3mdigital

  • WebDev Studios
  • Houston, TX
View GitHub Profile
@c3mdigital
c3mdigital / cacheable-ajax.php
Last active February 19, 2023 13:35
Example of how to cache fronted ajax requests in WordPress. This will allow you to use ajax and page caching like varnish or redis. Where ajax requests would normally not be cached using the built in wp_ajax_action method.
<?php
add_filter( 'rewrite_rules_array', 'cache_frontend_ajax_rules' );
/**
* Rewrite rules filter to add rules for front end ajax calls
*
* @param array $rewrite_rules
*
* @return array
*/
@c3mdigital
c3mdigital / WordPress.xml
Created November 18, 2012 08:40
WordPress coding style for PhpStorm
<?xml version="1.0" encoding="UTF-8"?>
<code_scheme name="WordPress">
<option name="USE_SAME_INDENTS" value="true" />
<option name="IGNORE_SAME_INDENTS_FOR_LANGUAGES" value="true" />
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="true" />