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( 'acf/load_value/name=content_blocks', 'default_fields', 10, 3 ); | |
function default_fields( $value, $post_id, $field ) { | |
// Only add default content for new posts | |
if ( $value !== null ) { | |
return $value; | |
} | |
// Only add default content for certain post types | |
if ( ! in_array( |
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
function remove_mediaelement_styles() { | |
wp_dequeue_style('wp-mediaelement'); | |
wp_deregister_style('wp-mediaelement'); | |
} | |
add_action( 'wp_print_styles', 'remove_mediaelement_styles' ); |
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
// Limit post revisions to 3 | |
define( 'WP_POST_REVISIONS', 3 ); | |
// Empty trash every 7 days instead of the default 30 | |
define('EMPTY_TRASH_DAYS', 7); |
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
body { | |
font-family: -apple-system, BlinkMacSystemFont, “Segoe UI”, Roboto, Helvetica, Arial, sans-serif; | |
} |
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
/** | |
* Get the post type labels configuration | |
* | |
* @param string $post_type | |
* @param string $singular_label | |
* @param string $plural_label | |
* | |
* @return array | |
*/ | |
function get_TODO_post_type_labels_config( $post_type, $singular_label, $plural_label ) { |
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
$regex = "/([0-9]{1,2}:[0-9]{2}:[0-9]{2})\s(AM|PM|XM)\s{0,1}\*{3}\s{0,3}\ *{1,2}LOCAL.*?([0-9]{1,2}:[0-9]{2})/"; |
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
function removeHash () { | |
var scrollV, scrollH, loc = window.location; | |
if ("pushState" in history) | |
history.pushState("", document.title, loc.pathname + loc.search); | |
else { | |
// Prevent scrolling by storing the page's current scroll offset | |
scrollV = document.body.scrollTop; | |
scrollH = document.body.scrollLeft; | |
loc.hash = ""; |
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
function getRGB(hex) { | |
if(hex[0] === '#') { | |
hex = hex.substring(1,7); | |
} | |
var r = parseInt(hex.substring(0,2),16); | |
var g = parseInt(hex.substring(2,4),16); | |
var b = parseInt(hex.substring(4,6),16); | |
return 'rgb(' + r + ', ' + g + ', ' + b + ')'; |