View try-amp-sanitizing-script.php
<?php
$scripts = array();
$styles = array();
$content = 'I am <script>not</script> evil.';
$global_args = array();
if ( ! class_exists( 'AMP_DOM_Utils' ) ) {
amp_load_classes();
View amp-wp-encoding-failure.diff
diff --git a/amp.php b/amp.php
index 449a814..731e4c6 100644
--- a/amp.php
+++ b/amp.php
@@ -283,6 +283,7 @@ function amp_render_post( $post ) {
}
$post_id = $post->ID;
+
/*
View sample-post.html
<article id="post-23812" class="post post-23812 type-post status-publish format-standard hentry category-general tag-4-9 tag-customize tag-dev-notes mentions-aquakitty mentions-dlh author-westonruter">
<div class="o2-post">
<header class="entry-header">
<div class="entry-meta">
<a href="https://profiles.wordpress.org/westonruter" class="author-avatar ">
<img src="https://gravatar.com/avatar/bb16e7904f2f335b6c9f524cc533d2d2?d=mystery" width="48" height="48" class="avatar grav-hashed" id="grav-bb16e7904f2f335b6c9f524cc533d2d2-0" scale="0">
</a>
View gist:49552860d1e57a20547bcebd090ef269
88 'sanitize_callback'
37 'permission_callback'
20 'validate_callback'
11 'wp-head-callback'
10 'auth_callback'
10 'active_callback'
8 'admin-preview-callback'
8 'admin-head-callback'
6 'render_callback'
5 'update_callback'
View get-template-include.php
<?php
// The following is copied from <https://github.com/WordPress/wordpress-develop/blob/1258d1d9d2c7bef7c18b4e3420219cfa716d0aca/src/wp-includes/template-loader.php#L49-L76>.
// @codingStandardsIgnoreStart
if ( is_embed() && $template = get_embed_template() ) :
elseif ( is_404() && $template = get_404_template() ) :
elseif ( is_search() && $template = get_search_template() ) :
elseif ( is_front_page() && $template = get_front_page_template() ) :
elseif ( is_home() && $template = get_home_template() ) :
elseif ( is_post_type_archive() && $template = get_post_type_archive_template() ) :
elseif ( is_tax() && $template = get_taxonomy_template() ) :
View 001-add-footer-section-and-control.js
View content.php
<?php
/**
* Template part for displaying a post, forcing the excerpt template part to be used on archives.
*
* Instructions: Place this file in your twentyseventeen child theme at template-parts/post/content.php
*
* @package Twenty_Seventeen
*/
if ( is_archive() ) {
View add-customize-changeset-locked-notification-dismiss-button.js
wp.customize.notifications.bind( 'add', function( notification ) {
if ( 'changeset_locked' === notification.code ) {
notification.render = (function( render ) {
return function() {
var li = render.call( notification ), button;
button = jQuery( '<button type="button" class="button button-secondary">Dismiss</button>' );
button.on( 'click', function() {
notification.parent.remove( notification.code );
} );
li.find( '.action-buttons' ).append( button );
View customize-select-multiple.php
<?php
// @todo The following does not work.
add_action( 'customize_register', function( WP_Customize_Manager $wp_customize ) {
$choices = array(
'foo' => __( 'Foo' ),
'bar' => __( 'Bar' ),
'baz' => __( 'Baz' ),
);
View wp-42573.php
<?php
/**
* Plugin name: WP Trac #42573: Fix for theme template file caching.
* Description: Flush the theme file cache each time the admin screens are loaded which uses the file list.
* Plugin URI: https://core.trac.wordpress.org/ticket/42573
* Author: Weston Ruter, XWP.
* Author URI: https://weston.ruter.net
*/
function wp_42573_fix_template_caching( WP_Screen $current_screen ) {