Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter kida18

    (@kida18)

    And one last thing…how do you built the email message for the conditional fields?
    Since this is dynamic, how can I see only the one answered to?

    Thread Starter kida18

    (@kida18)

    Actually, I’ve rebuilt the whole thing and now it’s working ??

    But I have another question.

    When choosing select boxes, if the choice is unique, then we have the blue validation appearing when making a choice. But when there can be multiple answers, we don’t see what’s been selected.

    See:
    https://imgur.com/lgR3Ml7 : When only one choice is possible
    https://imgur.com/NUtIWI2 : 2 choices are actually selected but we don’t see it(Zumba Strong and Zumba Kids)

    How could I make the blue validation appear on multiple choices too?

    Thread Starter kida18

    (@kida18)

    Perfect!! If I set the post meta as else for each title field, it works ??

    Here is my code in case someone looks to achieve the same thing:

    function kida_post_updated_func( $post_id ) {
        if ( wp_is_post_revision( $post_id ) || get_post_type($post_id) != 'plot_detail')return;
         remove_action( 'post_updated', 'kida_post_updated_func' );
      	$given = get_post_meta($id, 'wpcf-given', true);
            $givenslug = "given";
      	$nickname = get_post_meta($id, 'wpcf-nickname', true);
            $nicknameslug = "nickname";
    	$middle = get_post_meta($id, 'wpcf-middle', true);
    	$middleslug ="middle";
    	$maiden = get_post_meta($id, 'wpcf-maiden-name', true);
    	$maidenslug ="maiden-name";
    	$family = get_post_meta($id, 'wpcf-family', true);
    	$familyslug = "family";
    
        if(isset($_POST['wpcf'][$givenslug]) && !empty($_POST['wpcf'][$givenslug])){
            $a = $_POST['wpcf'][$givenslug]; 
    	}
        else {
    	global $post;
            if( empty( $post ) )
            $post = get_post($post_id);
            if( get_post_type($post_id) !== 'plot_detail' )
            return $post_id;
               if( function_exists('types_render_field') ) {
                 $a = types_render_field( 'given', array('raw'=>'true') );
    	   }
         }
        if(isset($_POST['wpcf'][$nicknameslug]) && !empty($_POST['wpcf'][$nicknameslug])){
            $b = $_POST['wpcf'][$nicknameslug]; 
    		$bb = '"';
    	}
    	else {
    	   global $post;
    	   if( empty( $post ) )
    	   $post = get_post($post_id);
    	   if( get_post_type($post_id) !== 'plot_detail' )
               return $post_id;
    	   if( function_exists('types_render_field') ) {
    		$bx = types_render_field( 'nickname', array('raw'=>'true') );
    		if(!empty($bx)) {
    		   $b = $bx;
    		   $bb = '"';
    		}
    	   }
    	}
        if(isset($_POST['wpcf'][$middleslug]) && !empty($_POST['wpcf'][$middleslug])){
            $c = $_POST['wpcf'][$middleslug]; 
    	}
    	else {
    	   global $post;
    	   if( empty( $post ) )
    	   $post = get_post($post_id);
    	   if( get_post_type($post_id) !== 'plot_detail' )
    		return $post_id;
    	   if( function_exists('types_render_field') ) {
    		$c = types_render_field( 'middle', array('raw'=>'true') );
    	   }
    	}		
        if(isset($_POST['wpcf'][$maidenslug]) && !empty($_POST['wpcf'][$maidenslug])){
            $d = $_POST['wpcf'][$maidenslug]; 
    		$dd = '(';
    		$de = ')';
    	}
    	else {
    	   global $post;
    	   if( empty( $post ) )
    	   $post = get_post($post_id);
    	   if( get_post_type($post_id) !== 'plot_detail' )
    	   return $post_id;
    	   if( function_exists('types_render_field') ) {
    		$dx = types_render_field( 'maiden-name', array('raw'=>'true') );
    		if(!empty($dx)) {
    		   $d = $dx;
    		   $dd = '(';
    		   $de = ')';
    		}
    	    }
    	}		
       if(isset($_POST['wpcf'][$familyslug]) && !empty($_POST['wpcf'][$familyslug])){
            $e = $_POST['wpcf'][$familyslug]; 
    	}
    	else {
    	   global $post;
    	   if( empty( $post ) )
    	   $post = get_post($post_id);
    	   if( get_post_type($post_id) !== 'plot_detail' )
    		return $post_id;
    	   if( function_exists('types_render_field') ) {
    		$e = types_render_field( 'family', array('raw'=>'true') );
    	   }
    	}
    	
    $v = $a . ' ' . $bb . $b . $bb . ' ' . $c . ' ' .  $dd . $d . $de . ' ' . $e;
    		
    	
        $my_args = array(
            'ID' => $post_id,
            'post_title' => $v,
            'post_name' => sanitize_title($v),
        );
     
        // update the post, which calls save_post again
        $res = wp_update_post( $my_args, true );
        add_action( 'post_updated', 'kida_post_updated_func' );
    }
    add_action( 'post_updated', 'kida_post_updated_func' );

    Regarding the “pre_post_update” – If I use that instead then my title doesn’t get set and shows as “auto-draft” whether it’s a new created post or an update.

    Thanks a lot for your help @bcworkz!

    Hello,

    I have the same issue. I’m using Avada with Fusion Page builder.
    I’m trying to insert the WP Post carousel on a page. It displays well but I get the same error message displayed above it : Warning: explode() expects parameter 2 to be string, array given in mysite.com/plugins/wp-posts-carousel/includes/utils.class.php on line 165

    Was there ever any solution to that?

    Thread Starter kida18

    (@kida18)

    Hi Miguel,

    Thanks for answering and sorry for the late reply too!

    For my image issue, I’ve created radio fields and hard coded the display of images based on the answers. Here is my code, in case anyone is looking to achieve the same thing :

    add_action( 'kleo_before_main_content', 'talent_show_badge' );
    function talent_show_badge(){
        if( !bp_is_active( 'xprofile' ) )
            return;
        
        $main_talent = xprofile_get_field_data( '637', bp_displayed_user_id() );
    
        
        if( 'photography' == strtolower( $main_talent ) ){
            echo '<div id="badges"><img src="https://www.mysite.com/wp-content/uploads/2016/10/photography.png" alt="photography" title="Photography"></div>';
        }
    
        if( 'voice' == strtolower( $main_talent ) ){
            echo '<div id="badges"><img src="https://www.mysite.com/wp-content/uploads/2016/10/voice.png" alt="voice" title="Voice"></div>';
        }}

    I’ve tested the custom taxonomy selector and custom taxonomy multiselector (I hadn’t tried them before) but those fields type don’t appear to be compatible with the Conditional profile field plugin from Buddydev (have an extra field appear depending on the selection of the previous field), and I need some kind of conditional answers for what I’m trying to do.

    One feature that could be nice to have in the future, is an enhancement of the normal checkbox type, allowing members to set a level of priority/preference in their answers.

    If we take the same example as in my first post, if we allow members to have several answers for the “skills” field, it would be nice to allow them to choose which are their primary skill, secondary skill etc, without having to create multiple fields.
    I have no idea how this could be achieved though…maybe allowing people to re-order the list after it’s been submitted? Or perhaps incorporate a conditional that displays another set of selection once a box is checked, within the same field, displaying radio buttons with numbers, or priority1, priority2 etc, in the same amount as the number of choices available?

    Anyway, it’s just a suggestion ??

    Thanks for your great plugin

    Thread Starter kida18

    (@kida18)

    Anyone? I haven’t managed to find a solution.
    How would one do to use the google maps API in several plugins without having a conflict?

    Thread Starter kida18

    (@kida18)

    Hey Clicknathan,

    Thanks for the suggestions.
    Yes I had replaced the my_key_here to the code, have just removed it before posting here.

    I’d already tried what you suggested (removing one of the two versions), and the map from the ACF field renders only when they are both added. If I remove one of the two, the map displays on the back-end but not on the front-end. I’ve tried to enqueue them directly, without registering them, but that didn’t work either.

    I can’t show you an example page right now unfortunately

    Thread Starter kida18

    (@kida18)

    Thanks Andrea ??

    Thread Starter kida18

    (@kida18)

    Hey Andrea,
    Yes it works! Yesterday when I tested it, it was showing me results based on a OR search only. Strange.
    Thanks for answering so fast

Viewing 9 replies - 1 through 9 (of 9 total)