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 | |
defined( 'ABSPATH' ) OR exit; | |
add_action( 'init', array( 'oxoImageSizesExtd', 'init' ), 0 ); | |
class oxoImageSizesExtd extends oxoImageSizes | |
{ | |
/** | |
* The Class Object | |
* @var |
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 | |
defined( 'ABSPATH' ) OR exit; | |
/** | |
* Plugin Name: (WCM) Faster Admin Post Lists | |
* Description: Reduces the queried fields inside WP_Query for WP_Post_List_Table screens | |
* Author: Franz Josef Kaiser <[email protected]> | |
* AuthorURL: http://unserkaiser.com | |
* License: MIT | |
*/ |
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 | |
// Hook function with action | |
// add_action( hook_id, func_name, priority, number_of_arguments ) | |
add_action('thesis_hook_before_post','recent_post_by_author',10,2); | |
function function_name ( $arg1, $arg2 ) { | |
/* do stuff here */ | |
} | |
// At the place of action |
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('post_gallery', 'my_post_gallery', 10, 2); | |
function my_post_gallery($output, $attr) { | |
global $post; | |
if (isset($attr['orderby'])) { | |
$attr['orderby'] = sanitize_sql_orderby($attr['orderby']); | |
if (!$attr['orderby']) | |
unset($attr['orderby']); | |
} |
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
$.fn.flickr = | |
function(arr){ | |
var wrapper = this; | |
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id="+arr.id+"&lang=en-us&format=json&jsoncallback=?", displayImages); | |
function displayImages(data) | |
{ | |
// Choose where in the feed to start, 0 is latest | |
var iStart = 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
/* The command in its simpliest form looks like: */ | |
rm myFile.txt myFile1.txt myFile2.txt …etc… | |
/* Fortunately, rm accepts several arguments which can ease us. | |
In the above example, we could type: */ | |
rm myFile*.txt | |
/* This will match all files starting with ‘myFile’ and ending in ‘.txt’ */ | |
/* To delete a whole folder and its content recursively, you can use: */ | |
rm -rf foldername/ |
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
div[class^="tocolor-"], div[class*=" tocolor-"] { | |
color:red | |
} | |
/* | |
In the place of div you can add any element or remove it altogether, | |
and in the place of class you can add any attribute of the specified element. | |
[class^="tocolor-"] — starts with "tocolor-". | |
[class*=" tocolor-"] — contains the substring "tocolor-" occurring directly after a space character. |
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
package main | |
import "fmt" | |
func name(s string, m int) func(int) (int, string) { | |
sum := len(s)+m | |
return func(x int) (int, string) { | |
sum += x | |
var val string | |
if val="even"; sum%2==1 { |
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
import ( | |
_ "fmt" | |
"strings" | |
) | |
func WordCount(s string) map[string]int { | |
word:=make(map[string]int) | |
m:=strings.Fields(s) | |
for _,w:=range m{ |