Forum Replies Created

Viewing 15 posts - 16 through 30 (of 72 total)
  • Author
    Posts
  • in reply to: Clear textarea after submit #5935
    kattagami
    Member

    I can do it with JavaScript but I wonder if there is a more “Piklist way” 😉

    in reply to: Front end form, update a CPT #5814
    kattagami
    Member

    Typo in my previous message:

    “Do I need to do it myself with a get_post($ID) function …”

    in reply to: Piklist and SiteOrigin page builder not working together #5813
    kattagami
    Member

    Hello @dammeer

    Steve had already answered about this subject in this thread: https://piklist.com/support/topic/clarification-request-for-piklist-widgets-dont-work-in-siteorigin-page-builder/

    in reply to: hide fields until layout is ready #5711
    kattagami
    Member

    +1

    Have the same problem with group fields + condition.

    in reply to: Disable drag and drop reorder on add_more fields #5119
    kattagami
    Member

    Works like a charm 🙂
    Awesome !

    Thanks Steve

    in reply to: Disable drag and drop reorder on add_more fields #5106
    kattagami
    Member

    Hello,

    I comeback with this old request. Is it available in Piklist 0.9.9.x ?
    If yes, how can I disable the Drag and Drop from my add_more fields ?

    Thx

    kattagami
    Member

    Hello @tatamata,

    Yes, there is a way to get the value of the field, in frontend form, before hitting submit
    Check this thread:

    https://piklist.com/support/topic/build-a-contact-form-with-piklist-0-9-9-6/

    in reply to: Build a Contact Form with Piklist 0.9.9.6? #4957
    kattagami
    Member

    Thanks very much for your help Steve, you always come with a solution 🙂
    It’s works like a charm! but …

    I use the “message” comment on top of my form php file to tell to my user that the message has been sent when they submit it.

    However, if a field doesn’t validate, the error message AND the “message” (which said everything is ok) both display above my form.

    How display the “message” only if there is no validate error messages?

    Thx
    Gilles

    in reply to: How to get a Piklist field from a setting page with WP-CLI? #4608
    kattagami
    Member

    I have it 🙂

    I get my setting field in a php file and then call this file with the WP-CLI command “wp eval-file file.php”

    [Resolved]

    in reply to: Bug with Media uploader in widget? #3912
    kattagami
    Member

    Ok, noticed!
    I would be able to deal with this pending the patch.

    Thanks

    kattagami
    Member

    I expected this answer because my request was very specific 😉
    No worries
    Thanks

    in reply to: Disable a metabox #3820
    kattagami
    Member

    Thanks Steve, you are amazing 🙂

    in reply to: Advice for sorting by date (with Date Picker) #3304
    kattagami
    Member

    Hi,

    I recover my code. In fact I didn’t use an hidden field, sorry for the wrong advice.

    I just put this code in my metabox file :

    
    /*
    Title: Date et lieu de l'événement
    Description: date et lieu
    Post Type: evenement
    Capability: administrator
    Context: normal
    Priority: high
    Order: 1
    
    */
     
    // Création d'un champ date
    piklist( 'field' , array(
    				'type'        => 'datepicker',
    				'scope'       => 'post_meta',
    				'field'       => 'mr_evenement_date',
    				'label'       => __( 'Date' , 'mr' ),
    				'description' => __( 'Cette information est obligatoire.' , 'mr' ),
    				'required'    => true,
    				'attributes'  => array(
    							'class' => 'evenement_date'
    										),
    						'options' => array(
    								'dateFormat' => 'd MM yy',
    								'firstDay'   => '1',
    								'monthNames' => array( "janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre" ),
    								'dayNamesMin' => array( "Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa" )
    										)
    					)
    );
    
    // Création d'un champ texte lieu
    piklist( 'field' , array(
    				'type'        => 'text',
    				'scope'       => 'post_meta',
    				'field'       => 'mr_evenement_location',
    				'label'       => __( 'Lieu' , 'mr' ),
    				'attributes'  => array(
    						'class' => 'evenement_location'
    						),
    						'columns'     => '5',
    						'position'    => 'wrap',
    					)
    );
    
    $mr_evenement_date = get_post_meta( $post_id , 'mr_evenement_date' , true );
    $mr_evenement_date_timestamp = get_post_meta( $post_id , 'mr_evenement_date_timestamp' , true );
    
    if ( !empty( $mr_evenement_date ) ) {
    	// Convert a French string date to timestamp
    	/* Set local date to French. Needed fot strptime() */
    	setlocale ( LC_TIME, 'fr_FR.utf8' , 'fra' );
    	$mr_evenement_date = strptime( $mr_evenement_date , '%j %B %Y' );
    	$mr_evenement_date_timestamp_converted = mktime( 0 , 0 , 0 , $mr_evenement_date['tm_mon']+1 , $mr_evenement_date['tm_mday'] , $mr_evenement_date['tm_year'] + 1900 );
    
        if ( empty( $mr_evenement_date_timestamp ) ) {
            add_post_meta( $post_id, 'mr_evenement_date_timestamp', $mr_evenement_date_timestamp_converted );
        } else {
        	update_post_meta( $post_id, 'mr_evenement_date_timestamp', $mr_evenement_date_timestamp_converted );
        }
    }
    

    And the query to display my CPT by date is :

    
    $args_query = array ( 
    			'offset'         => 0,    
    			'post_type'      => 'evenement',
    			'post_status' 	 => 'public',
    			'meta_key'       => 'mr_evenement_date_timestamp',
    			'orderby'        => 'meta_value_num',
    			'order'          => 'DESC',
    			);
    
    			// The Query
    			$the_query = new WP_Query( $args_query );
    

    Hope this code could help you 🙂

    in reply to: Advice for sorting by date (with Date Picker) #3282
    kattagami
    Member

    Hello Angelique,

    Why don’t you convert your String date in timestamp with some php functions and store this timestamp as an hidden custom field?

    You could afterwards select your CPT on this timestamp custom field with WP_Query.

    I did that in one of my project and it works like a charm.
    If you need the code, tell me. I can recover it and post it for you.

    in reply to: Removing attachment causes it to jump right back after update #2985
    kattagami
    Member

    Very, very cool !
    Thanks all of you 🙂

Viewing 15 posts - 16 through 30 (of 72 total)