View test-http-request.php
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'; |
View pgmb_wp_all_import.php
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(); |
View build-plugin.yml
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: |
View test post for woo.txt
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% |
View pgmb_sync_products.php
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; | |
} |
View pgmb_add_yoast_description.php
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 ); |
View pgmb_custom_meta_field_example.php
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_custom_variable($variables, $parent_post_id){ | |
$variables['%custom_variable%'] = get_post_meta($parent_post_id, 'custom_variable', true); | |
return $variables; | |
} | |
add_filter('mbp_placeholder_variables', 'pgmb_add_custom_variable', 10, 2); |
View pgmb_business_selector_full_height.php
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_action('admin_head', 'pgmb_increase_height'); | |
function pgmb_increase_height() { | |
echo '<style> | |
.mbp-business-selector { | |
height:100% !important; | |
} | |
</style>'; | |
} |
View pgmb_calendarize_it_variables.php
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_calendarize_it_fields( $variables, $parent_post_id ) { | |
$event_start_date = get_post_meta( $parent_post_id, 'fc_start_datetime', true ); | |
$event_end_date = get_post_meta( $parent_post_id, 'fc_end_datetime', true ); | |
if ( ! $event_start_date || !$event_end_date ) { | |
return $variables; | |
} | |
$start_datetime = new \DateTime($event_start_date); |
View bulk-update-auto-post-template.php
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_batch_update_templates(){ | |
$product_ids = get_posts([ | |
'post_type' => 'product', | |
'fields' => 'ids', | |
'numberposts' => '-1', | |
]); | |
foreach($product_ids as $product_id){ | |
$product = wc_get_product($product_id); |
NewerOlder