Last active
September 4, 2017 12:40
-
-
Save svenl77/7f9e2fa3744a6d8635be737bbc3be52e to your computer and use it in GitHub Desktop.
Add a new div to the listing insite the "li"
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
<?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