Created
September 27, 2016 11:05
-
-
Save wpflippercode/7ed4735bb523bcfdab129222c215e72f to your computer and use it in GitHub Desktop.
Use own data placeholder in posts listing using wp posts pro plugin.
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
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.