Created
May 18, 2015 07:54
-
-
Save iamtekeste/df7bcf1d07f84bda3f54 to your computer and use it in GitHub Desktop.
Use value of post meta for something when the post meta changes
This file contains hidden or 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
| /** | |
| * Use value of post meta for something when the post | |
| * meta changes | |
| * @param integer $meta_id ID of the meta data field | |
| * @param integer $post_id Post ID | |
| * @param string $meta_key Name of meta field | |
| * @param string $meta_value Value of meta field | |
| */ | |
| function saveYouTubeInfo($meta_id, $post_id, $meta_key='', | |
| $meta_value=''){ | |
| // Stop if not the correct meta key | |
| if ( $meta_key != 'my_meta_field_name') { | |
| return false; | |
| } | |
| // Function code goes here. | |
| } | |
| add_action('updated_post_meta', 'saveYouTubeInfo', 10, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment