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 | |
/* | |
Plugin Name: AB Edit Filter Save | |
Version: 0.1 | |
Author: Aaron Brazell | |
Author URI: http://technosailor.com | |
Description: Saves default WordPress edit page filters as usermeta | |
License: GPLv2 | |
*/ | |
class AB_Filter_Save { |
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
<<<<<<< HEAD | |
filterLists.init($('.filter-list-item'), function (o) { | |
for (var i = 0; i < o.length; i++) { | |
var closestBucket = $('.filter-'+o[i]+'-bucket').parents('.filter-bucket').find('.filter-toggle-btn'); | |
filterCollapse.closed(closestBucket); | |
} | |
$('.sidebar .filter-bucket').slideDown(); | |
}); | |
======= | |
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 | |
class Some_Child_Theme { | |
public function __construct() { | |
$this->hooks(); | |
} | |
public function hooks() { |
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
CREATE OR REPLACE | |
VIEW v AS | |
SELECT DISTINCT(meta_key) | |
FROM wp_usermeta | |
WHERE NOT( meta_key REGEXP '^wp_5_{1}') | |
AND (meta_key REGEXP '^wp_(.)+'); | |
DELETE FROM wp_usermeta | |
WHERE meta_key IN | |
(SELECT * FROM v); | |
UPDATE wp_usermeta |
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 | |
/* | |
Plugin Name: AB Duplicate Blog | |
Author: Aaron Brazell | |
Version: 1.0-beta | |
Description: Duplicate a WordPress Multisite blog into a new one, transferring options, taxonomies, etc | |
*/ | |
class AB_Duplicate_Blog { |
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 | |
class AF_Metaboxes { | |
public function __construct() { | |
$this->hooks(); | |
} | |
public function hooks() { | |
add_action( 'add_meta_boxes', array( $this, 'metaboxes' ) ); |
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 | |
class Example_Plugin_Class { | |
public function __construct() | |
{ | |
$this->hooks(); | |
} | |
protected function hooks() | |
{ |
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 | |
/** | |
* Logs messages/variables/data to browser console from within php | |
* | |
* @param $name: message to be shown for optional data/vars | |
* @param $data: variable (scalar/mixed) arrays/objects, etc to be logged | |
* @param $jsEval: whether to apply JS eval() to arrays/objects | |
* | |
* @return none | |
* @author Sarfraz |
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
<form onsubmit="return false;"> | |
<input title="U.S. or Canadian Zip or Postal code is required" pattern="(\d{5}([\-]\d{4})?)|[A-Za-z][0-9][A-Za-z][ -]?[0-9][A-Za-z][0-9]" type="text" name="zip" value="" placeholder="Zip/Postal Code *" required /> | |
<input title="Phone number in form 123-456-7890 is required" pattern="(\d{3}-?\d{3}-?\d{4})" type="tel" name="phone" placeholder="Phone *" required /> | |
<input type="submit" name="submit" value="Submit" /> | |
</form> | |
<script> | |
jQuery(document).ready(function(){ |
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
HTML5 U.S. Zip Code/Canadian Postal code Validation | |
<input class="lead-zip full-wide" title="U.S. or Canadian Zip or Postal code is required" pattern="(\d{5}([\-]\d{4})?)|[A-Za-z][0-9][A-Za-z] [0-9][A-Za-z][0-9]" type="text" name="lead-zip" placeholder="Zip Code *" required /> |