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 | |
/** | |
* Plugin name: HTTP2 Push scripts | |
* Author: Tom J Nowell | |
*/ | |
function tomjn_get_dep_url( /*\WP_Dependency*/ $dep ) { | |
global $wp_version; | |
$relative = str_replace( site_url(), '', $dep->src ); | |
$ver = $dep->ver; |
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 | |
/** | |
* Plugin Name: Deny Giant Image Uploads | |
* Description: Prevents Uploads of images greater than 3.2MP | |
* Author: TJNowell | |
* Author URI: http://tomjn.com | |
* Plugin URI: http://tomjn.com/164/clients-who-upload-huge-camera-photos-decompression-bombs/ | |
* Version: 1.1 | |
*/ |
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 | |
/** | |
* Local Kitten images. | |
* | |
* Filters image URLs to load files from placekitten if they aren't present locally. | |
* | |
* @wordpress-plugin | |
* Plugin Name: Local Kitten Images | |
* Version: 1.0.2 | |
* Description: Loads missing image files from placekitten when using local environment. |
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
Index: functions.php | |
=================================================================== | |
--- functions.php (revision 56804) | |
+++ functions.php (working copy) | |
@@ -7,9 +7,19 @@ | |
namespace P2020; | |
+function is_automattician() { | |
+ return false; |
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 | |
function the_field_url( $selector, $post_id=0, $format_value=true ) { | |
echo esc_url( get_field( $selector, $post_id, $format_value ) ); | |
} | |
function the_field_url_raw( $selector, $post_id=0, $format_value=true ) { | |
echo esc_url_raw( get_field( $selector, $post_id, $format_value ) ); | |
} |
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 | |
function exclude_post_categories( $exclude = '', $spacer = ' ' ) { | |
$categories = get_the_category(); | |
if ( empty( $categories ) ) { | |
return; | |
} | |
$exclude = explode( ',', $exclude ); | |
$counter = count( get_the_category() ) - count( $exclude ); | |
foreach ( $categories as $cat ) { |
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
wp.blocks.registerBlockVariation( | |
'core/column', | |
{ | |
name: 'featured-column', | |
isDefault: false, | |
title: 'Featured Column', | |
description: 'A highlighted central column!', | |
attributes: { className: 'central' }, | |
} |
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 | |
$args = [ | |
// parameters go here | |
]; | |
$query = new WP_Query( $args ); | |
if ( $query->have_posts() ) { | |
while ( $query->have_posts() ) { | |
$query->the_post(); | |
// display the post |
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( wp ) { | |
var el = wp.element.createElement; | |
wp.blocks.registerBlockType( 'tomjn/dynamic', { | |
title: 'Toms Dynamic Block', | |
edit: function( props ) { | |
return el( wp.serverSideRender, { | |
block: 'tomjn/dynamic', | |
attributes: props.attributes, | |
} ); | |
}, |
NewerOlder