Global Objects
window.VPData
Contains global configuration data localized from PHP.
Properties:
screenSizes(object) - Responsive breakpoint configurationsettingsPopupGallery(object) - Popup gallery settingsnonce(string) - WordPress nonce for AJAX requestsadminUrl(string) - WordPress admin URLajaxUrl(string) - WordPress AJAX URL
window.VPPopupAPI
Global API for popup gallery functionality.
Location: assets/js/popup-gallery.js
Properties
vendor(string|false) - Current popup vendor namevendors(array) - Array of supported video vendors (YouTube, Vimeo)
Methods
init()
open()
items(array) - Array of gallery itemsindex(number) - Index of item to open
close()
getQueryStringParams()
query(string) - Query string to parse
parseVideo()
url(string) - Video URL (YouTube, Vimeo, etc.)poster(string) - Optional poster image URL
parseItem()
itemElement(HTMLElement) - Gallery item element
parseGallery()
$gallery(jQuery) - Gallery container element
embedCallback()
vendorData(object) - Video vendor configurationvideoId(string) - Parsed video IDurl(string) - Original video URLmatch(object|boolean) - URL match data
Layout APIs
Grid Layout
Location:assets/js/layout-grid.js
Handles responsive grid layout calculations.
Usage:
Masonry Layout
Location:assets/js/layout-masonry.js
Provides masonry grid functionality using Isotope.
Slider Layout
Location:assets/js/layout-slider.js
Implements carousel/slider functionality using Swiper.
Justified Layout
Location:assets/js/layout-justified.js
Creates justified image galleries with consistent row heights.
Tiles Layout
Location:assets/js/layout-tiles.js
Generates tile-based layouts with custom patterns.
Custom Events
Portfolio Events
vpf:init
Fired when a portfolio is initialized.
Event Detail:
vp(object) - Portfolio instanceoptions(object) - Portfolio configuration
vpf:ready
Fired when a portfolio is fully loaded and ready.
Example:
vpf:layoutReady
Fired when portfolio layout is calculated and rendered.
Example:
vpf:imagesLoaded
Fired when all images in portfolio are loaded.
Example:
Filter Events
vpf:filterChange
Fired when filter selection changes.
Event Detail:
vp(object) - Portfolio instancefilter(string) - Selected filter value
Pagination Events
vpf:loadMoreStart
Fired before loading more items.
Example:
vpf:loadMoreComplete
Fired after loading more items completes.
Example:
Popup Events
vpf:popupOpen
Fired when popup gallery opens.
Event Detail:
vp(object) - Portfolio instancepopup(object) - Popup instanceindex(number) - Current item index
vpf:popupClose
Fired when popup gallery closes.
Example:
jQuery Events
Portfolio Initialization
Layout Events
Filter Events
Extending Functionality
Adding Custom Video Vendors
You can add support for additional video platforms by extending theVPPopupAPI.vendors array.
Example: