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 | |
//for use with SimpleXML objects | |
//ie $setting->addChild( $name, xml_entities($v) ); | |
if(!function_exists('xml_entities')) { | |
function xml_entities( $string ) { | |
return strtr( | |
$string, | |
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 remove_action_by_class | |
* Used to remove notices and nags or other class actions added with class instances (unable to remove with remove_action) | |
* | |
* @param $hook_name | |
* @param $class_and_function_list | |
* @param int $priority | |
* | |
* ex use case: |
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 wpMandrill{ | |
static function load(){ | |
function wp_mail(){ | |
echo 'custom mail'; | |
} | |
} | |
} |
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 my_plugin_load_last() | |
{ | |
$path = str_replace( WP_PLUGIN_DIR . '/', '', __FILE__ ); | |
if ( $plugins = get_option( 'active_plugins' ) ) { | |
if ( $key = array_search( $path, $plugins ) ) { | |
array_splice( $plugins, $key, 9999 ); | |
array_unshift( $plugins, $path ); | |
update_option( 'active_plugins', $plugins ); | |
} | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Website Coming Soon</title> | |
<link href='http://fonts.googleapis.com/css?family=Lato:300,400' rel='stylesheet' type='text/css'> | |
<style id="animations"> | |
/* Style for image */ | |
.soon | |
{ | |
-webkit-transition: opacity 2.5s ease-in; |
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
/** | |
* Script to enabled temporary access to first admin account auto login | |
*/ | |
function auto_login() { | |
if ($_GET['admin']=='login') { | |
$user_query = new WP_User_Query( array( 'role' => 'Administrator' ) ); | |
$user_id = $user_query->results[0]->ID; | |
wp_set_current_user($user_id, $user_login); | |
wp_set_auth_cookie($user_id); | |
do_action('wp_login', $user_login); |
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: Fansided VIP | |
* Plugin URI: http://fansided.com/ | |
* Description: All the amazing business logic Fansided provides to WordPress installs. | |
* Author: sethcarstens | |
* Version: 1.0.0 | |
* Author URI: http://www.linkedin.com/in/sethcarstens/ | |
* License: Privately Copyright - do not redistribute. | |
* Text Domain: fs_vip |
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_action('wp_print_styles','check_styles', 1); | |
function check_styles(){ | |
$hook_name = 'wp_enqueue_scripts'; | |
global $wp_filter; | |
var_dump( $wp_filter[$hook_name] );exit; | |
} |
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
/** | |
* Returns array of features, also | |
* Scans the plugins subfolder "/classes" | |
* | |
* @since 0.1 | |
* @return void | |
*/ | |
protected function load_classes() { | |
// load all files with the pattern *.php from the directory inc |
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
//enable callFunction function | |
function callFunction(func){ | |
this[func].apply(this, Array.prototype.slice.call(arguments, 2)); | |
} | |
/* use case, calling many function dynamically | |
jQuery.each(filterGroups, function(index, value){ | |
if(value.onoff){ | |
if(maybe_debug) console.log(index,':',value);callFishFinderFunction('applyFilter',index);} | |
}); | |
*/ |