Skip to content

Instantly share code, notes, and snippets.

View pingram3541's full-sized avatar

pingram3541 pingram3541

View GitHub Profile
@pingram3541
pingram3541 / class-customize-queried-post-info.php
Created March 6, 2016 23:07 — forked from westonruter/class-customize-queried-post-info.php
Customize Queried Post Info plugin: Communicate the singular post queried object currently previewed in the Customizer.
<?php
/**
* Customize_Queried_Post_Info class.
*
* @package CustomizeQueriedPostInfo
*/
/**
* Class Customize_Queried_Post_Info.
*/
jQuery(function($) {
// returns an array of the potential selector components for the first element in the jQuery object. IDs, classes, and tagNames only.
var getSelectorComponents = function($el) {
var components = [];
var id = $el.attr('id');
if (typeof(id)!='undefined' && /[^\s]/.test(id)) {
components.push('#'+id);
}