Skip to content

Instantly share code, notes, and snippets.

View pgmb_enable_all_businesses.php
function pgmb_enable_all_locations($locations){
foreach($locations as &$location){
$location->locationState->isLocalPostApiDisabled = false;
return $locations;
add_filter('mbp_business_selector_locations', 'pgmb_enable_all_locations');
View pgmb_woocommerce_variables.php
//Remove the <?php opening tag to get rid of the red exclamation mark in the Code Snippets plugin
function mbp_add_woocommerce_product_variables($variables){
//Get the product ID from the variables
$id = intval($variables["%ID%"]);
//Check whether the WooCommerce wc_get_product function exists, and this is a product post type
if(!function_exists('wc_get_product') || get_post_type($id) !== 'product'){ return $variables; }
View AbstractField.php
namespace PGMB\Vendor\Cron;
* Abstract CRON expression field
abstract class AbstractField implements FieldInterface