Skip to content

Instantly share code, notes, and snippets.

Avatar

Marko Bajlovic arbitrarily

View GitHub Profile
@arbitrarily
arbitrarily / remove-empty-p.php
Last active Sep 9, 2016 — forked from ninnypants/remove-empty-p.php
Remove empty p tags from WordPress posts
View remove-empty-p.php
<?php
add_filter( 'the_content', 'remove_empty_p', 20, 1 );
function remove_empty_p( $content ){
$content = preg_replace( array(
'#<p>\s*<(div|aside|section|article|header|footer)#',
'#</(div|aside|section|article|header|footer)>\s*</p>#',
'#</(div|aside|section|article|header|footer)>\s*<br ?/?>#',
'#<(div|aside|section|article|header|footer)(.*?)>\s*</p>#',
'#<p>\s*</(div|aside|section|article|header|footer)#',
), array(
View gist:e21e416179da719d3a90

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt