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
function list_hooked_functions($tag=false){ | |
global $wp_filter; | |
if ($tag) { | |
$hook[$tag]=$wp_filter[$tag]; | |
if (!is_array($hook[$tag])) { | |
trigger_error("Nothing found for '$tag' hook", E_USER_WARNING); | |
return; | |
} | |
} | |
else { |
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
// Initialize plugin based on its existence | |
// | |
// if ( $.isFunction( $.fn.pluginMethodName ) ) | |
// $(selector).pluginMethodName(); | |
// | |
// Note: you can ommit the $.isFunction | |
// simply write | |
// if ( $.fn.pluginMethodName ) | |
// Example |
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 | |
function dequeue_scripts_on_condition() { | |
// you can use various conditional tags | |
// ex. is_page(), is_page_template() | |
if ( ! is_page( /* page id */ ) ) | |
wp_dequeue_script( $handle ); | |
if ( ! is_page_template( /* page template name */ ) ) | |
wp_dequeue_script( $handle ); |
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
// | |
// @pram a Array | |
// | |
var a = [1,2,3,[4,5,6,[7,8,9]]]; | |
function recursiveMulti(a){ | |
return a.map(function(i){ | |
if(Object.prototype.toString.call(i) === "[object Array]") | |
return recursiveMulti(i); |
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
function list_wpcf7_form_shortcodes() { | |
global $post; | |
if ( ! post_type_exists( 'wpcf7_contact_form' ) ) | |
_e( "You haven't install/activate Contact Form 7 plugin yet.", "text_domain" ); | |
$wpcf7_posts = get_posts( array( | |
'post_type' => 'wpcf7_contact_form', | |
'posts_per_page' => -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
{ | |
"remove-empty-rulesets": true, | |
"always-semicolon": true, | |
"color-case": "lower", | |
"block-indent": " ", | |
"color-shorthand": true, | |
"element-case": "lower", | |
"eof-newline": true, | |
"leading-zero": false, | |
"quotes": "double", |
OlderNewer