SHARE
TWEET

Untitled

a guest Jun 10th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top