test add action on post publish
- but don't retrieve coordinates yet + test differents functions for custom fields
This commit is contained in:
@@ -84,4 +84,16 @@ function mp_add_div() {
|
||||
}
|
||||
add_shortcode('lejourduprof_map', 'mp_add_div');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* when a post is published, check its coordinates
|
||||
*/
|
||||
function post_published_coordinates($id, $post) {
|
||||
if ( ! add_post_meta( $id, 'coordinates', 'banana', true ) ) {
|
||||
update_post_meta( $id, 'coordinates', 'banana' );
|
||||
}
|
||||
}
|
||||
add_action( 'publish_post', 'post_published_coordinates', 10, 2 );
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user