Advertisement
Guest User

Untitled

a guest
Jun 10th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. add_filter('frm_after_display_content', 'add_view_total_to_after_content', 30, 4);
  2. function add_view_total_to_after_content($after_content, $display, $show, $atts){
  3. if ( $display->ID == 145 ) {
  4. $entries = $atts['entry_ids'];
  5. $total = 0;
  6. foreach($entries as $entry){
  7. $current_value = FrmProEntriesController::get_field_value_shortcode(array( 'field_id' => 6, 'entry' => $entry ) );
  8. if ( $current_value ) {
  9. $total += $current_value;
  10. }
  11. }
  12. $after_content = str_replace('[sum_6]', $total, $after_content);
  13. }
  14. return $after_content;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement