This file contains 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 | |
/* | |
It is possible to limit the location list to specific locations (or a single location) using the mbp_business_selector_locations filter. | |
We can use it to filter out the locations that don't belong to the website or user. | |
The code loops through all locations and checks whether the location is within an array of allowed locations. If not, it is removed (hidden). | |
You can find the location ID by right clicking the location in the location selector, and pressing "Inspect Element": https://i.imgur.com/gWd5M9x.png |
This file contains 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 | |
if(interface_exists('\PGMB\Placeholders\VariableInterface')){ | |
class PGMB_Motors_Variables implements \PGMB\Placeholders\VariableInterface { | |
private $listing_id; | |
public function __construct($listing_id){ | |
$this->listing_id = $listing_id; | |
} | |
/** |
This file contains 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 | |
/** | |
Function to change the order of the save_post execution. Change the $priority value to change the priority | |
lower numbers mean earlier execution. | |
**/ | |
function pgmb_change_autopost_priority(){ |
This file contains 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 | |
function pgmb_gf_post_created($post_id, $feed, $entry, $form){ | |
global $post_to_google_my_business_plugin; | |
$post_type = 'your_post_type'; | |
// -- Do not edit after this | |
//If this is a different post type, abort |
This file contains 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 | |
/** | |
Snippet to create GMB posts from the Advanced Post Creation plugin of Gravity Forms | |
**/ | |
function pgmb_gf_create_post_advancedpostcreation($post_id, $feed, $entry, $form){ | |
if(!class_exists('\PGMB\PostTypes\SubPost') || !class_exists('\PGMB\FormFields') || !class_exists('\PGMB\Vendor\WeDevsSettingsAPI')){ |
This file contains 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 | |
//Copied from http://fatlabmusic.com/blog/2009/08/12/how-to-fix-wp-http-error-name-lookup-timed-out/ | |
//adjustments to wp-includes/http.php timeout values to workaround slow server responses | |
add_filter('http_request_args', 'pgmb_http_request_args', 100, 1); | |
function pgmb_http_request_args($r) //called on line 237 | |
{ | |
$r['timeout'] = 15; | |
return $r; | |
} | |
This file contains 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 | |
class PGMBRankMathSEOVariables implements \PGMB\Placeholders\VariableInterface { | |
private $parent_id; | |
public function __construct($parent_id) { | |
$this->parent_id = $parent_id; | |
} |
This file contains 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 | |
if(interface_exists('\PGMB\Placeholders\VariableInterface')){ | |
class PGMBYoastSEOVariables implements \PGMB\Placeholders\VariableInterface { | |
private $parent_id; | |
public function __construct($parent_id) { | |
$this->parent_id = $parent_id; | |
} |
This file contains 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 | |
function pgmb_add_acf_fields($variables, $parent_post_id){ | |
//Check if the ACF get_fields function is actually available | |
if(!function_exists('get_fields')){ return $variables; } | |
$fields = get_fields($parent_post_id); | |
if($fields){ | |
foreach($fields as $name => $value){ | |
$variables["%acf_{$name}%"] = $value; |
OlderNewer