Created
March 15, 2018 13:17
-
-
Save brynzovskii/203aad1c6703a34bab127cf9d1355cb2 to your computer and use it in GitHub Desktop.
WP before post inserting hook
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( 'wp_insert_post', 'wpse128767_add_meta' ); | |
function wpse128767_add_meta( $post_id ) { | |
// do something here, add post meta for example | |
add_post_meta( $post_id, 'key', 'value' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment