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_filter( 'ep_prepare_meta_allowed_protected_keys', 'ep_add_priority_meta', 10, 2 ); | |
function ep_add_priority_meta( $keys, $post ) { | |
$keys[] = '_priority'; | |
return $keys; | |
} |
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
(function() { | |
let filterElasticsearchResponse = false; | |
let searchTerm; | |
$.ajaxSetup({ | |
beforeSend: function(xhr, settings) { | |
if( settings.url == window.epas.endpointUrl) { | |
filterElasticsearchResponse = true; | |
searchTerm = settings.headers['EP-Search-Term']; | |
} | |
}, |
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
wordpress: | |
endpoint: 'http://local.wordpress.dev/wp-json' | |
cacheLimit: 3600000 # 1000ms * 60s * 60m = 1hr |
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
javascript:(function()%7Bfunction callback()%7Bdocument.getElementsByTagName('table')%5B0%5D.className %3D "timesheet_summary invoice_dashboard sortable"%7Dvar s%3Ddocument.createElement("script")%3Bs.src%3D"https%3A%2F%2Fcdn.jsdelivr.net%2Fsorttable%2F2%2Fsorttable.min.js"%3Bif(s.addEventListener)%7Bs.addEventListener("load"%2Ccallback%2Cfalse)%7Delse if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)() |
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
document.getElementsByTagName('table')[0].className = "timesheet_summary invoice_dashboard sortable"; | |
/* | |
SortTable | |
version 2 | |
7th April 2007 | |
Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ | |
Instructions: | |
Download this file | |
Add <script src="sorttable.js"></script> to your HTML |
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
//based on and borrowing heavily from http://tdanemar.wordpress.com/2010/01/19/global-events-with-jquery/ | |
//define an addAction plugin method that will store the event in a single container object (WP.eventHolder) | |
//so that it doesn't pollute the global space, but we can still access it in a 'global' way | |
$.fn.addAction = function(eventName, func) { | |
$(WP.eventHolder).bind(eventName, this, function(e) { func.call(e.data); | |
}); | |
//add an action that will fire when the addFeaturedPost WP event fires | |
$('.featured-post').addAction('WP.eventTriggers.addFeaturedPost', function(e){ |
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
Index: class.wp-dependencies.php | |
=================================================================== | |
--- class.wp-dependencies.php (revision 20792) | |
+++ class.wp-dependencies.php (working copy) | |
@@ -245,7 +245,9 @@ | |
function __construct() { | |
@list($this->handle, $this->src, $this->deps, $this->ver, $this->args) = func_get_args(); | |
- if ( !is_array($this->deps) ) | |
+ if ( is_string( $this->deps ) ) |
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
Index: functions.wp-scripts.php | |
=================================================================== | |
--- functions.wp-scripts.php (revision 20792) | |
+++ functions.wp-scripts.php (working copy) | |
@@ -131,6 +131,11 @@ | |
$wp_scripts = new WP_Scripts(); | |
} | |
+ //if a single param is passed as the dependency, convert to an array so WP_Dependencies won't convert | |
+ //it to an empty array |
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 | |
function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false ) { | |
global $wp_scripts; | |
if ( !is_a($wp_scripts, 'WP_Scripts') ) | |
$wp_scripts = new WP_Scripts(); | |
if ( $src ) { | |
$_handle = explode('?', $handle); | |
$wp_scripts->add( $_handle[0], $src, $deps, $ver ); |
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
Index: inc/js.php | |
=================================================================== | |
--- inc/js.php (revision 18733) | |
+++ inc/js.php (working copy) | |
@@ -239,26 +239,26 @@ | |
<script type="text/javascript"> | |
/* <![CDATA[ */ | |
- jQuery(document).ready( function() { | |
+ jQuery(document).ready( function($) { |
NewerOlder