This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Ignore this first line when copying to your child theme's functions.php file. | |
/** | |
* Make a shortcode for a popup's name (not the title) | |
* | |
* Note: The popup's internal name is actually the CPT's title. | |
* The internal name is different from the popup's title. | |
* | |
* The popup's title is optional. If you enter a popup title, | |
* it displays as the heading of your popup (external title). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Ignore this first line when copying to your child theme's functions.php file. | |
add_action('wp_footer', function () { | |
// Only do for a post called Weekday Tabs just to avoid page bloat. Change to your | |
// post or page (is_page()) or remove this check if wanted. | |
if (!is_single('weekday-tabs')) return; ?> | |
<script> | |
(function() { | |
// Init some consts. | |
const weekDays = [ | |
"Monday", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Ignore this first line when copying to your child theme's functions.php file. | |
add_action( 'wp_footer', function () { ?> | |
<script> | |
(function () { | |
function testRestApi(url, cb) { | |
jQuery.ajax({ | |
url: url, | |
dataType: "text", | |
type: "GET", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:window.location.search += '&pum_debug=true'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://docs.wppopupmaker.com/article/512-popup-maker-debug-tools | |
javascript: (function($) { | |
var $select = $('<select>').attr('id', 'pum-popup-select').css({ | |
zIndex: 9999999999999999, | |
position: 'fixed', | |
top: 0, | |
right: 0 | |
}).on('change', function() { | |
PUM.open($select.val()); | |
$(this).remove(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Ignore this first line when copying to your child theme's functions.php file. | |
/** | |
* Disable Content Control if Elementor Preview Mode is Active | |
* | |
* References: | |
* - https://code.elementor.com/methods/elementor-preview-is_preview_mode/ | |
* - https://ralphjsmit.com/elementor-check-active/ | |
*/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Ignore this first line when copying to your child theme's functions.php file. | |
function filter_product_query_on_attribute_and_role($tax_query, $query) | |
{ | |
// Step 1: Filter the role. | |
if (wp_get_current_user()->roles[0] != 'wholesale') return $tax_query; // Logged-in except wholesale can see. | |
// More examples: | |
// 1. Filter all roles except for wholesale. | |
// if ( wp_get_current_user()->roles[0] == 'wholesale' ) return $tax_query; // Only a logged-in wholesale role can see. |