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 prettyPhoto lightbox | |
| add_action( 'wp_enqueue_scripts', 'fc_remove_woo_lightbox', 99 ); | |
| function fc_remove_woo_lightbox() { | |
| remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); | |
| wp_dequeue_style( 'woocommerce_prettyPhoto_css' ); | |
| wp_dequeue_script( 'prettyPhoto' ); | |
| wp_dequeue_script( 'prettyPhoto-init' ); | |
| } | |
| //Add fancyBox lightbox - if thats what you want. |
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
| curl -sS getcomposer.org/installer | php -d detect_unicode=Off | |
| composer create-project laravel/laravel THE_PROJ_DIRECOTRY_NAME_YOU_WANT --prefer-dist | |
| or using the new phar, copy it into usr/local/bin | |
| run : | |
| $ chmod +x /usr/local/bin/laravel |
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 | |
| // Utility function - allow us to strpos an array | |
| if ( !function_exists( 'audio_strpos_arr' ) ) { | |
| function audio_strpos_arr($haystack, $needle) { | |
| if( !is_array($needle) ) $needle = array($needle); | |
| foreach( $needle as $what ) { | |
| if( ($pos = strpos($haystack, $what) ) !==false ) return $pos; | |
| } |
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
| add_action( 'contextual_help', 'wptuts_screen_help', 10, 3 ); | |
| function wptuts_screen_help( $contextual_help, $screen_id, $screen ) { | |
| // The add_help_tab function for screen was introduced in WordPress 3.3. | |
| if ( ! method_exists( $screen, 'add_help_tab' ) ) | |
| return $contextual_help; | |
| global $hook_suffix; | |
| // List screen properties |
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
| // Utilities | |
| //--------------------------- | |
| // check if a function already exists | |
| function function_exists (func_name) { | |
| if (typeof func_name === 'string') { | |
| func_name = this.window[func_name]; | |
| } | |
| return typeof func_name === 'function'; | |
| } |
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 $custom_terms = get_terms('mytaxonomyname'); | |
| foreach($custom_terms as $custom_term) { | |
| wp_reset_query(); | |
| $args = array('post_type' => 'myposttypename', | |
| 'mytaxonomyname' => 'taxonomyitem', // might be unneccessary - test this | |
| 'tax_query' => array( | |
| array( | |
| 'taxonomy' => 'mytaxonomyname', | |
| 'field' => 'slug', |
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
| Disable the WordPress Admin Bar for all Users and Visitors | |
| Turn off the toolbar with one simple line. | |
| view plain | |
| /* | |
| * Disable the WordPress Admin Bar for all Users and Visitors | |
| */ | |
| remove_action( 'init', '_wp_admin_bar_init' ); | |
| ^ top | |
| Enable the WordPress Admin Bar for admins only |
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 # -*- coding: utf-8 -*- | |
| /** | |
| * Plugin Name: T5 Silent Flush | |
| * Description: Flushes rewrite rules whenever a custom post type or taxonomy is registered and not already part of these rules. This is a soft flush, the .htaccess will not be rewritten. | |
| * Version: 2013.05.04 | |
| * Author: Thomas Scholz <info@toscho.de> | |
| * Author URI: http://toscho.de | |
| * License: MIT | |
| * License URI: http://www.opensource.org/licenses/mit-license.php | |
| */ |
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 | |
| /** | |
| * @package Redirect to homepage after logout | |
| * @version 0.1 | |
| */ | |
| /* | |
| Plugin Name: Redirect to homepage after logout | |
| Plugin URI: http://daankortenbach.nl/wordpress/redirect-to-homepage-after-logout/ | |
| Description: Redirects the user to the homepage after logout | |
| Author: Daan Kortenbach |
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 hex2rgb($hex) { | |
| $hex = str_replace("#", "", $hex); | |
| if(strlen($hex) == 3) { | |
| $r = hexdec(substr($hex,0,1).substr($hex,0,1)); | |
| $g = hexdec(substr($hex,1,1).substr($hex,1,1)); | |
| $b = hexdec(substr($hex,2,1).substr($hex,2,1)); | |
| } else { | |
| $r = hexdec(substr($hex,0,2)); | |
| $g = hexdec(substr($hex,2,2)); |