• Thanks for this great plugin.
    The recent update seems to have resulted in the $shortcoded line in my code below to simple output empty strings.

    If I then change template=bare-value to template=single-value it does work, however I want to keep it as bare value to preserve formatting etc.

    The var_dump was put there only for testing.

    All other code is working fine (otherwise the change in the line above wouldn’t work).

    Was there anything in the recent update which could result in this “bare” approach not working any longer?

    Thanks kindly,
    Adam

    	public function cc_wrapped_value( $atts ) {
    		if(in_array('participants-database/participants-database.php', apply_filters('active_plugins', get_option('active_plugins')))){ 
    			$record_id = $this->get_admin_record_id();
    			$vTag = esc_attr(sanitize_text_field( $atts['tag'] ));
    			$vClass = (isset($atts['class']) && (sanitize_text_field( $atts['class'] ) != '' )) ? ' class= "' . esc_attr(sanitize_text_field( $atts['class'] )) . '"' : '';
    			$vId = (isset($atts['el_id']) && (sanitize_text_field( $atts['el_id'] ) != '' )) ? ' id= "' . esc_attr(sanitize_text_field( $atts['el_id'] )) . '"' : '';
    			
    			$html = '<' . $vTag . $vClass . $vId .'>';
    			$shortcoded = do_shortcode( '[pdb_single record_id=' . $record_id . ' fields=' . $atts['fields'] . ' template=bare-value ]' );
    		//	var_dump($shortcoded);
    			$html .= preg_replace( '/^((?=^)(\s*))|((\s*)(?>$))/si', '', $shortcoded);
    			$html .= '</' . $vTag . '>';
    			$html = preg_replace("/>\s*</", "><", $html);
    			
    			return $html;
    		} else 
    			return false;
    	}
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author xnau webdesign

    (@xnau)

    Looks like there is a problem with the template, it’s missing the “echo,” it should be:

    <?php echo $this->field->raw_value() ?>

    Thread Starter clickingclients

    (@clickingclients)

    Thank you.
    Which file are you referring to? I’ve placed it in pdb-single-bare-value.php.

    <?php 
              $this->field->print_value()
              // echo $this->field->print_value()
              // $this->field->raw_value()
              // echo $this->field->raw_value()
    ?>

    I’ve tried the combinations above, however the one which works properly in all occurrences is the one displayed. It was the original code and for some reason it is suddenly working well.

    I’m not sure what changed/switched to now fix it.

    Thanks again.

    Plugin Author xnau webdesign

    (@xnau)

    The line in the template is

    <?php $this->field->raw_value() ?>

    which needs to be changed to:

    <?php echo $this->field->raw_value() ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘After update – “pdb_single” with “template=bare-value” is no longer working’ is closed to new replies.