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
//This would be good for setting up a stock dev environment. So instead of dumping in a DB, you would run an initializer with options | |
$users[0] = array( | |
'first_name' => 'Daniel', | |
'last_name' => 'Pataki', | |
'user_login' => 'danielpataki', | |
'user_pass' => 'mysupersecretpass', | |
'user_email' => 'mysupermail@mymail.com', | |
'display_name' => 'Daniel', | |
'description' => 'Guitar-wielding Web developer', |
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
/** | |
* Disable admin bar on the frontend of your website | |
* for subscribers. | |
*/ | |
function themeblvd_disable_admin_bar() { | |
if( ! current_user_can('edit_posts') ) | |
add_filter('show_admin_bar', '__return_false'); | |
} | |
add_action( 'after_setup_theme', 'themeblvd_disable_admin_bar' ); | |
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
//Template fallback | |
add_action("template_redirect", 'my_theme_redirect'); | |
function my_theme_redirect() { | |
global $wp; | |
$plugindir = dirname( __FILE__ ); | |
//A Specific Custom Post Type | |
if ($wp->query_vars["post_type"] == 'product') { | |
$templatefilename = 'single-product.php'; |
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
.hoverSpriteVert, | |
.hoverSpriteHoriz | |
background-position: 0 0 | |
.hoverSpriteHoriz:hover | |
background-position: 100% 0 | |
.hoverSpriteVert:hover | |
background-position: 0 100% |
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 | |
//vvvvvvvvvv *INCLUDE_FUNCTIONS vvvvvvvvvv | |
/* phpReadDir v0.1 | |
* This function gets the contents of a directory. | |
* It returns an array ($contentsArr) of strings for each item in the target directory | |
* $dir : The path of the directory to search in | |
* Attributes: | |
ignoreSystemFiles: Do not include system files in the array | |
Such as: ., .., DS_Store | |
num: How many entries to return. 0 will return all |
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
/* getContentsofDir v0.1 | |
* This function gets the contents of a directory. | |
* It returns an array ($contentsArr) of strings for each item in the target directory | |
* $dir : The path of the directory to search in | |
* Attributes: | |
ignoreSystemFiles: Do not include system files in the array | |
Such as: ., .., DS_Store | |
num: How many entries to return. 0 will return all | |
ignore: Ignore this file(s) | |
ignoreType: Ignore this file type(s) |
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
add_filter( 'all_plugins', 'hide_plugin_list' ); | |
function hide_plugin_list( $plugins ) { | |
if ( is_admin() ) { | |
//Only run this if we're in the Admin panels | |
unset( $plugins[ 'advanced-custom-fields/acf.php'] ); | |
//Admin only plugins | |
if ( ! current_user_can( 'administrator' ) ) { | |
unset( $plugins[ 'better-wp-security/better-wp-security.php'] ); |
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_filter('upload_dir', 'mu_media_upload_dir'); | |
function mu_media_upload_dir($upload) { | |
$site_title=str_replace( ' ' , '_' , get_bloginfo('name','raw') ); | |
$upload['path'] = ABSPATH . '/shared/' . $site_title; | |
switch_to_blog(1); | |
$upload['url'] = site_url() . '/shared/' . $site_title; | |
restore_current_blog(); | |
$upload['subdir'] = ""; | |
$upload['basedir'] = $upload['path']; |
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: Change User Language | |
* Description: Change the language depending on the user | |
* Version: 0.1 | |
* Author: AJ Zane | |
* Author URI: http://AJZane.com | |
* License: GPL2 | |
*/ |
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
for old in path/to/files/*.txt; do mv $old path/to/files/`basename $old .text`.md; done |
OlderNewer