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 data attributes to the query block to describe the block query. | |
* | |
* @param string $block_content Default query content. | |
* @param array $block Parsed block. | |
* @return string | |
*/ | |
function query_render_block( $block_content, $block ) { | |
if ( 'core/query' === $block['blockName'] ) { |
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 | |
/** | |
* Instead of calling get_the_content(), call this function instead, and it'll all be good | |
*/ | |
function get_the_content_with_formatting() | |
{ | |
ob_start(); | |
the_content(); | |
$the_content = ob_get_contents(); |
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
// Works in modern browsers + IE9, but Modernizr has a polyfill baked in for function.bind. | |
// Hat tip Paul Irish | |
var o = $( {} ); | |
$.subscribe = o.on.bind(o); | |
$.unsubscribe = o.off.bind(o); | |
$.publish = o.trigger.bind(o); | |
// Usage | |
$(document.body).on( 'click', function() { |