No longer kept up to date.
Please see Sridhar's fork.
function Selector_Cache() { | |
var elementCache = {}; | |
var get_from_cache = function( selector, $ctxt, reset ) { | |
if ( 'boolean' === typeof $ctxt ) { | |
reset = $ctxt; | |
$ctxt = false; | |
} | |
var cacheKey = $ctxt ? $ctxt.selector + ' ' + selector : selector; |
{ | |
"disallowKeywordsOnNewLine": ["else"], | |
"disallowMixedSpacesAndTabs": "smart", | |
"disallowNewlineBeforeBlockStatements": true, | |
"disallowSpaceAfterObjectKeys": true, | |
"disallowSpacesInAnonymousFunctionExpression": { | |
"beforeOpeningRoundBrace": true | |
}, | |
"disallowTrailingWhitespace": true, | |
"requireBlocksOnNewline": true, |
( function( api ) { | |
'use strict'; | |
// Add callback for when the header_textcolor setting exists. | |
api( 'header_textcolor', function( setting ) { | |
var isHeaderTextDisplayed, linkSettingValueToControlActiveState; | |
/** | |
* Determine whether the site title and tagline should be displayed. | |
* |
No longer kept up to date.
Please see Sridhar's fork.
The CSSTidy package for SublimeText 2 works great for toggling between different CSS formats, but none of the default options output CSS consistent with the Drupal CSS coding standards with selectors, braces and properties indented and formatted like so:
selector {
property: value;
}
CSSTidy allows you to add your own templates, but the documentation is sparse, then there's the matter of the Sublime Text 2 integration. If I hadn't been deeply procrastinating, I would not have had th patience to figure it all out. Here's what to do:
# This is a template .gitignore file for git-managed WordPress projects. | |
# | |
# Fact: you don't want WordPress core files, or your server-specific | |
# configuration files etc., in your project's repository. You just don't. | |
# | |
# Solution: stick this file up your repository root (which it assumes is | |
# also the WordPress root directory) and add exceptions for any plugins, | |
# themes, and other directories that should be under version control. | |
# | |
# See the comments below for more info on how to add exceptions for your |
<?php | |
add_filter( 'genesis_attr_content', 'yoast_schema_empty', 20 ); | |
add_filter( 'genesis_attr_entry', 'yoast_schema_event', 20 ); | |
add_filter( 'genesis_attr_entry-title', 'yoast_itemprop_name', 20 ); | |
add_filter( 'genesis_attr_entry-content', 'yoast_itemprop_description', 20 ); | |
add_filter( 'genesis_post_title_output', 'yoast_title_link_schema', 20 ); | |
/** | |
* We'll use the post info output to add more meta data about the event. |
<?xml version="1.0"?> | |
<ruleset name="phpmd.xml" | |
xmlns="http://pmd.sf.net/ruleset/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | |
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> | |
<description>PHPMD Ruleset for a WordPress Theme</description> | |
<rule ref="rulesets/cleancode.xml/BooleanArgumentFlag" /> | |
<rule ref="rulesets/cleancode.xml/ElseExpression" /> | |
<rule ref="rulesets/cleancode.xml/StaticAccess" /> |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |