Skip to content

Instantly share code, notes, and snippets.

<?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');
<?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; }
<?php
namespace PGMB\Vendor\Cron;
/**
* Abstract CRON expression field
*/
if(!class_exists('PGMB\Vendor\Cron\AbstractField')){
abstract class AbstractField implements FieldInterface
{