The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Revised date: 7/30/2015
- Original post
SELECT * | |
FROM `wp_usermeta` | |
WHERE `meta_key` LIKE '%thing%' | |
ORDER BY `meta_key` DESC | |
LIMIT 1500 | |
DELETE FROM `wp_usermeta` | |
WHERE `meta_key` LIKE '%thing%' | |
LIMIT 1500 |
// All lowercase | |
Dir | Rename-Item -NewName {$_.FullName.ToLower()} | |
// Spaces to hyphens | |
Dir | Rename-Item –NewName { $_.name –replace " ","-" } |
FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" rmdir /Q/S "%d" |
<?php | |
$string = '{"emptyString":"","stringSpace":" ","zeroInteger":0,"zeroString":"0","nullVal":null,"falseVal":false,"emptyArray":[]}'; | |
$array = json_decode( $string, true ); | |
echo $string; | |
echo'<pre>';print_r( $array );echo'</pre>'; | |
echo '<table>'; | |
echo ' |
class PageTemplater { | |
/** | |
* A Unique Identifier | |
*/ | |
protected $plugin_slug; | |
/** | |
* A reference to an instance of this class. | |
*/ |
'options' => array( | |
'AF' => __( 'Afghanistan', 'textdomain' ), | |
'AX' => __( 'Åland Islands', 'textdomain' ), | |
'AL' => __( 'Albania', 'textdomain' ), | |
'DZ' => __( 'Algeria', 'textdomain' ), | |
'AS' => __( 'American Samoa', 'textdomain' ), | |
'AD' => __( 'Andorra', 'textdomain' ), | |
'AO' => __( 'Angola', 'textdomain' ), | |
'AI' => __( 'Anguilla', 'textdomain' ), | |
'AQ' => __( 'Antarctica', 'textdomain' ), |
<?php | |
class Aristath_Dynamic_CSS { | |
public $stylesheet_id; | |
public function __construct() { | |
add_action( 'customize_save_after', array( $this, 'make_css' ) ); | |
} |
<?php | |
/* ========== | |
Get Split Nav | |
include $menu_name for the menu you want and $raw=true if you want to return just the menu objects | |
========== */ | |
function get_split_nav($menu_name=null, $raw=false){ | |
if($menu_name == null || !is_string($menu_name)){ | |
return false; | |
} | |
$output = new stdClass(); |
add_filter( 'the_content', 'prefix_insert_post_ads' ); | |
/** | |
* Insert code for ads after second paragraph of single post content. | |
* | |
* @param string $content Post content | |
* | |
* @return string Amended content | |
*/ | |
function prefix_insert_post_ads( $content ) { | |
$content_callout = '<h4>Insert code for ads after second paragraph of single post content.</h4>'; |