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/
*/
namespace Trac39128;
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 );
} );
View standalone-form-shortcode.php
<?php
/**
* Plugin Name: JS Widgets: Standalone Form Shortcode
*/
add_action( 'wp_enqueue_scripts', function() {
wp_enqueue_style( 'js-widget-form' );
} );
add_shortcode( 'js-widget-standalone-form', function( $atts ) {
View return-value-5.2.php
<?php
function __return_value( $value ) {
return create_function( '', sprintf( 'return %s;', var_export( $value, true ) ) );
}