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_raw_content_variable($variables, $parent_post_id){ | |
$post = get_post($parent_post_id); | |
$text = wpautop($post->post_content); //Add paragraph tags | |
//$text = preg_replace("~(?:\[/?)[^\]]+/?\]~s", '', $text); //Strip shortcodes | |
$text = do_shortcode($text); | |
$parse_html = new \PGMB\Vendor\Html2Text\Html2Text( | |
$text, | |
array( |
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_do_something_with_api() { | |
global $post_to_google_my_business; | |
if(!$post_to_google_my_business->is_loaded()){ | |
return; | |
} | |
$container = $post_to_google_my_business->get_container(); |
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 | |
/* | |
* Add a custom taxonomy variable to the Post to Google My Business plugin | |
*/ | |
function pgmb_add_custom_taxonomy($variables, $parent_post_id){ | |
//Replace name_of_the_taxonomy with the name of your taxonomy | |
$terms = get_the_terms( $parent_post_id, 'name_of_the_taxonomy' ); | |
if($terms && !is_wp_error($terms) && !empty($terms)){ |
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 | |
/* | |
* Clears Product Sync for GPB image references on Google and forces re-upload | |
* | |
* Copy snippet into the Code Snippets plugin (https://wordpress.org/plugins/code-snippets/) and set it to only run once, then execute it | |
* | |
*/ | |
function psfg_clear_all_image_references(){ | |
$args = [ | |
'post_type' => 'product', |
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 | |
// Ensure you're in a WordPress context before executing this | |
// Instantiate the WP_Http class | |
$http = new WP_Http(); | |
// Define the URL | |
$url = 'https://eoizizbuz0eynh6.m.pipedream.net'; |
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
name: Build plugin | |
on: | |
push: | |
if: startsWith(github.ref, 'refs/tags/v') | |
branches: | |
- main | |
- beta | |
- pending | |
jobs: | |
create-release: |
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
wc_product_price: %wc_product_price% | |
wc_product_regular_price: %wc_product_regular_price% | |
wc_product_sale_price: %wc_product_sale_price% | |
wc_product_price_including_tax: %wc_product_price_including_tax% | |
wc_currency_symbol: %wc_currency_symbol% (do not use this in the price field!) | |
wc_variation_min_current_price: %wc_variation_min_current_price% | |
wc_variation_max_current_price: %wc_variation_max_current_price% | |
wc_variation_min_regular_price: %wc_variation_min_regular_price% | |
wc_variation_max_regular_price: %wc_variation_max_regular_price% | |
wc_variation_min_sale_price: %wc_variation_min_sale_price% |
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_create_import_autopost( $post_id, $xml_node, $is_update ) { | |
global $post_to_google_my_business; | |
if(!$post_to_google_my_business->is_loaded()){ | |
return; | |
} | |
$autopost_factory = $post_to_google_my_business->get_autopost_factory(); |
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_publish_all_products(){ | |
if(get_option('pgmb_products_synced')){ | |
return; | |
} | |
global $post_to_google_my_business; | |
if(!$post_to_google_my_business->is_loaded()){ | |
return; | |
} |
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_yoast_description($variables, $parent_post_id){ | |
if(!function_exists('YoastSEO')){ return $variables; } | |
$description = YoastSEO()->meta->for_post( $parent_post_id )->description; | |
$variables['%yoast_description%'] = $description; | |
return $variables; | |
} | |
add_filter( 'mbp_placeholder_variables', 'pgmb_add_yoast_description', 10, 2 ); |
NewerOlder