Skip to content

Instantly share code, notes, and snippets.

@koen12344
Last active March 22, 2023 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koen12344/61470f9c8b138e9caa2863bc7e2250cf to your computer and use it in GitHub Desktop.
Save koen12344/61470f9c8b138e9caa2863bc7e2250cf to your computer and use it in GitHub Desktop.
<?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();
if(!$autopost_factory){
return;
}
$autopost_factory->create_autopost($post_id);
}
add_action( 'pmxi_saved_post', 'pgmb_create_import_autopost', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment