PhpStorm now bundles WordPress coding style natively, starting from version 8.
- Go to
Project Settings
>Code Style
>PHP
. - Select
Set From...
(top right of window) >Predefined Style
>WordPress
.
No longer need to muck with this import! :)
WP Bag of Tricks | |
1. Helpful Scripts/Plugins: | |
Hacks: | |
http://wordpress.org/extend/plugins/tac/ | |
http://wordpress.org/extend/plugins/exploit-scanner/ (Can be extremely resource intensive.) | |
http://wordpress.org/extend/plugins/wp-malwatch/ |
#sortable-list{margin-top:20px;} | |
#sortable-list li{padding:10px;width:50%;font-weight:bold;cursor:move;border:1px solid #ddd;background:#f5f5f5;background:-webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(1, #ffffff));background:-ms-linear-gradient(bottom, #eeeeee, #ffffff);background:-moz-linear-gradient(center bottom, #eeeeee 0%, #ffffff 100%);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box;} | |
#loading-animation{display:none;} |
<?php | |
/** | |
* WordPress Chosen Taxonomy Metabox | |
* Author: Helen Hou-Sandi | |
* | |
* Use Chosen for a replacement taxonomy metabox in WordPress | |
* Useful for taxonomies that aren't changed much on the fly and are | |
* non-hierarchical in nature, as Chosen is for flat selection only. | |
* You can always use the taxonomy admin screen to add/edit taxonomy terms. | |
* Categories need slightly different treatment from the rest in order to |
<?php | |
/** | |
* Prevents the creation of full Administrators by client accounts | |
* Forked from JPB_User_Caps (unable to locate origin) | |
* | |
* @return void | |
* @author Jonathan Christopher | |
*/ | |
if( is_admin() ) |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
Note: Work in progress document.
Note: Change the PHP version number as appropriate to your MAMP Pro install.
PATH
, making sure that it is first: /Applications/MAMP/bin/php/php5\.3\.6/bin:/Applications/MAMP/bin/apache2/bin:/Applications/MAMP/bin
mv /Applications/MAMP/bin/php/php5.3.6/conf/pear.conf /Applications/MAMP/bin/php/php5.3.6/conf/pear.conf.bak
source ~/.profile
(or where ever you made your PATH
changes)sudo pear update-channels && sudo pear upgrade pear
<?php | |
// Add the filter and function to your functions.php file | |
add_filter('body_class', 'add_slug_to_body_class'); | |
function add_slug_to_body_class($classes) { | |
global $post; | |
if(is_page()) { | |
$classes[] = sanitize_html_class($post->post_name); | |
} elseif(is_singular()) { |
<?php | |
# Register custom post types on the 'init' hook. | |
add_action( 'init', 'my_register_post_types' ); | |
/** | |
* Registers post types needed by the plugin. | |
* | |
* @since 1.0.0 | |
* @access public |
<?php | |
/** | |
* Handle meta boxes that are used on multiple content types. | |
* | |
*/ | |
class CTRS_Meta_Boxes { | |
private $_blacklisted_post_types = array( | |
'ctrs-people', |