Skip to content

Instantly share code, notes, and snippets.

@svenl77
Last active September 4, 2017 12:40
Show Gist options
  • Save svenl77/7f9e2fa3744a6d8635be737bbc3be52e to your computer and use it in GitHub Desktop.
Save svenl77/7f9e2fa3744a6d8635be737bbc3be52e to your computer and use it in GitHub Desktop.
Add a new div to the listing insite the "li"
<?php
// Add a new div to the listing insite the "li"
add_action('buddyforms_the_loop_li_last', 'my_buddyforms_the_loop_li_last', 10, 2);
function my_buddyforms_the_loop_li_last($post_id, $form_slug){
// Check if this is the correct form.
// Change "FORM_SLUG" to your form
if($form_slug != 'posts'){
return;
}
// Get the post meta by the form element slug
// Change the "SLUG" to the form element slug.
$value = get_post_meta( $post_id, 'SLUG', true);
// Display the the value
echo '<div>' . $value . '</div>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment