View bootstrapping-wp-rest-api-collection.php
<?php
// Make internal REST API requests for all resources the client JS app will need.
$request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
$request->set_query_params( array(
'per_page' => 5,
'orderby' => 'title',
'order' => 'desc',
) );
$response = rest_get_server()->dispatch( $request );
$response = apply_filters( 'rest_post_dispatch', $response, rest_get_server(), $request );
View wp-trac-39254.php
<?php
/**
* Plugin Name: WP Trac #39254: Allow starter content posts to display in The Loop
* Version: 0.1.0
* Author: Weston Ruter, XWP
* Plugin URI: https://core.trac.wordpress.org/ticket/39254
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2 or, at
* your discretion, any later version, as published by the Free
View class-customize-single-postmeta-setting.php
<?php
/**
* Class Customize_Postmeta_Setting.
*
* @package WPSE_257322
*/
namespace WPSE_257322;
/**
View class-wp-widget-media.php
<?php
/**
* Widget API: WP_Media_Widget class
*
* @package WordPress
* @subpackage Widgets
* @since 4.8.0
*/
/**
View wpse-254735.php
<?php
function my_styles_method() {
wp_enqueue_style( 'custom-style', get_template_directory_uri() . '/custom-css.css' );
$colors = array(
'headings_color' => get_theme_mod( 'wpt_heading_color' ),
);
$css_output = "{color: {$colors['headings_color']}; }";
$selector = 'h1,h2,h3,h4,h5,h6';
View load-recent-posts-upon-panel-expansion.js
// Watch for the first expansion of each added panel.
var logPanelFirstExpanded = function( panel ) {
var onceExpanded, onExpandedChange;
if ( ! panel.extended( wp.customize.Posts.PostsPanel ) ) {
return;
}
onceExpanded = function() {
console.info( 'Panel "%s" expanded! You should now lazy-load your controls if needed.', panel.id );
View customize-preview-frontend-show-edit-shortcuts.js
wp.customize.bind( 'preview-ready', function() {
_.defer( function() {
wp.customize.preview.trigger( 'active' );
jQuery( 'body' ).addClass( 'customize-partial-edit-shortcuts-shown' );
} );
});
View trac-39128-customizer-cross-domain-workaround.php
<?php
/**
* Plugin Name: Customizer Cross-Domain Workaround (Trac #39128)
* Description: Force customizer preview to use siteurl instead of home URL to work around Trac #39128. Temp fix for issue loading customizer preview when home and siteurl have different domains (cross-domain).
* Plugin URI: https://core.trac.wordpress.org/ticket/39128
* Author: Weston Ruter, XWP
* Author URI: https://make.xwp.co/
*
* Copyright (c) 2017 XWP (https://xwp.co/)
*
View trac-39663-test-case.php
<?php
/**
* Plugin Name: WP Core #39663: Test case for broken contextual panels and sections.
* Plugin URI: https://core.trac.wordpress.org/ticket/39663
* Author: Weston Ruter, XWP
*/
add_action( 'customize_register', function ( WP_Customize_Manager $wp_customize ) {
$panel = $wp_customize->add_panel( 'test_panel', array(
View notifications-test.js
wp.customize.each( function( setting ) {
var notifications = [
new wp.customize.Notification( 'example-error', { 'message': 'This is an example error.', type: 'error' } ),
new wp.customize.Notification( 'example-warning', { 'message': 'This is an example warning.', type: 'warning' } ),
new wp.customize.Notification( 'example-info', { 'message': 'This is an example info.', type: 'info' } ),
new wp.customize.Notification( 'example-notice', { 'message': 'This is an example notice.', type: 'notice' } ),
];
_.each( notifications, function ( notification ) {
setting.notifications.add( notification.code, notification );
} );