Skip to content

Instantly share code, notes, and snippets.

@tommcfarlin
Created February 9, 2017 15:46
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 tommcfarlin/c1245410fdf288edd11c9547711dd76c to your computer and use it in GitHub Desktop.
Save tommcfarlin/c1245410fdf288edd11c9547711dd76c to your computer and use it in GitHub Desktop.
<?php
// Using post title as the value, but it's just an example.
add_user_meta( $user_id, $post_id, $post_title );
<?php
// User user email address a value but just an example.
add_post_meta( $post_id, $user_id, $email_address );
<?php
/**
* Using this association will give you the ability to query for information
* both on posts and users and then work with the data accordingly.
*/
add_user_meta( $user_id, $post_id, $post_title );
add_post_meta( $post_id, $user_id, $email_address );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment