Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

wpflippercode commented Sep 27, 2016

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
You can’t perform that action at this time.