Created
February 6, 2024 08:58
-
-
Save koen12344/63fa57ac1f27292758fdaf6932d951a4 to your computer and use it in GitHub Desktop.
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(); | |
if(!$container){ | |
return; | |
} | |
$api = $container['google_my_business_api']; | |
$location_id = 'locations/5083214136172243061'; | |
$localPost = new \PGMB\Google\LocalPost('en', 'post text here', 'STANDARD'); | |
$api->create_post($location_id, $localPost); | |
} | |
add_action( 'init', 'pgmb_do_something_with_api' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment