Skip to content

Instantly share code, notes, and snippets.

@wpflippercode
Created September 27, 2016 11:05
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 wpflippercode/7ed4735bb523bcfdab129222c215e72f to your computer and use it in GitHub Desktop.
Save wpflippercode/7ed4735bb523bcfdab129222c215e72f to your computer and use it in GitHub Desktop.
Use own data placeholder in posts listing using wp posts pro plugin.
add_filter('wpp_posts_data','wpp_posts_data',10,2);
/**
* Modify Post's Data before placing in the template.
* @param array $placeholder_data Post's Data.
* @param int $post_id Post ID.
* @return array Modified Post's Data.
*/
function wpp_posts_data($placeholder_data,$post_id) {
// e.g Use your own placeolder my_placeholder and get value from salary custom field.
$placeolder_data['my_placeholder'] = get_post_meta('salary',$post_id);
return $placeholder_data;
}
@wpflippercode
Copy link
Author

Using 'wpp_posts_data' hook, you can use your own placeholder to display in posts listing. This is very easy approach to display any data you want to show in your posts listing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment