Forum Replies Created

Viewing 15 replies - 1 through 15 (of 26 total)
  • Thread Starter Zenbirdy

    (@zenbirdy)

    Ok so I follow:

    <?php
    add_action( ‘caldera_forms_submit_complete’, ‘slug_process_form’, 55 );
    function slug_process_form( $form ) {

    //put form field data into an array $data
    $data= array();
    foreach( $form[ ‘fields’ ] as $field_id => $field){
    $data[ $field[‘slug’] ] = Caldera_Forms::get_field_data( $field_id, $form );
    }

    //get embedded post ID.
    $embeded_post_id = absint( $_POST[ ‘_cf_cr_pst’ ] );

    wp_set_object_terms( $embeded_post_id, $data[ ‘example’ ], ‘example’, true );

    }

    But still the taxonomy is not registering. Do I also have to sustitute the post id’_cf_cr_pst’?

    Thread Starter Zenbirdy

    (@zenbirdy)

    Josh and David,(better late than never) thanks a million for all the effort you put in this plugin, which is truly great and its full of options and possibilities, thanks for the patience and help :), I think caldera forms has the potential to become (and it will eventually)some of those 1 million+ downloaded plugins, due to its flexibility and features.

    David what I am trying to do is a form that will be used to create a post type, one of the field is a taxonomy field, So I want that when I submit the post, the post is tagged with the selected taxonomy.

    What I did is:
    <?php
    add_action( ‘caldera_forms_submit_complete’, ‘slug_process_form’, 55 );
    function slug_process_form( $form ) {

    //put form field data into an array $data
    $data= array();
    foreach( $form[ ‘fields’ ] as $field_id => $field){
    $data[ $field[‘slug’] ] = Caldera_Forms::get_field_data( $field_id, $form );
    }

    //get embedded post ID.
    $embeded_post_id = absint( $_POST[ ‘_cf_cr_pst’ ] );

    /** DO SOMETHING WITH $data here **/

    }
    Then, position—> process
    type—–> action
    action/filter—–>wp_set_object_terms()

    also try adding callback function wp_set_object_terms
    and setting as varibales the field with the taxonomy, I test changing the behavior with “entry list,static and passback” but none work to register or tagged my “taxonomy”.

    Thread Starter Zenbirdy

    (@zenbirdy)

    Is it possible to select, only a child category from a taxonomy?

    Thread Starter Zenbirdy

    (@zenbirdy)

    Just test the exact same condition and field but in other form, and I notice it works in this other form, and not in the other, the difference between those forms is that the form that works has only 2 fields, and the other forms not working have 5 fields.

    Thread Starter Zenbirdy

    (@zenbirdy)

    Thanks for the instructions, I did everything, create my condition and selected it for the conditional field, Once I test it, I select the USA but the conditional field did not show.

    Thread Starter Zenbirdy

    (@zenbirdy)

    I did that, but it still doesn’t work.
    Its weird because first the fields didn’t appear at all, then the other day it displayed the fields, then I closed the page, didnt move anything and today only one field is showing. I notice that the day that pods was updated was when my fields where working, but it was only that day.

    Thread Starter Zenbirdy

    (@zenbirdy)

    Ok I am confused.
    I add a run action processor,I did the following:
    position—> process
    type—–> action
    action/filter—–>wp_set_object_terms()

    But nothing happens, I tried also with pre process and post process.

    Thread Starter Zenbirdy

    (@zenbirdy)

    1) Ok I get it is not saving them as associated with the post,but why they are working perfect with the default wordpress post if I also try it with the same caldera form?
    That’s why I even dare to think it was perhaps something with the “custom post type” created with pods, since caldera work fine in the “post”.
    Anyway I will try the run action ( I am reading the tutorial) Will update once am done.

    2)I did use the each loop:

      {{#each taxonomy.post_tag}}

    • {{name}}
    • {{/each}}

      Thread Starter Zenbirdy

      (@zenbirdy)

      I check in the backend editor, it did have the taxonomy I selected associated (in the custom fields metabox {that field is an autopopulated taxonomy field from a taxonomy called “example”}) (there is an additional metabox( the one that pods adds of the “built in taxonomies”) my built in taxonomy is the taxonomy “example”( I would think that being the same taxonomy the result that shows in the metabox will also appear in the built in taxonomy metabox ) but it didn’t.
      So I add it manually in the backend,after I did that in the frontend it shows an “array” instead of the name of the taxonomy I selected.

      Note that when creating a post, in the default “post” the taxonomy appears automatically in the frontend even without having to manually add tags in the backend, and I dont get an “array”, I get the value selected from the autopopulate.

      Thread Starter Zenbirdy

      (@zenbirdy)

      When you write “associated with a tag” do you refer to associate the pods created “custom post type” with the “built in taxonomies” —> Tags(post_tag) and select the “custom taxonomy” I created. Because I already did that, I rule out a theme conflict since I am using one of the default wordpress themes, my active plugins are caldera, caldera custom fields, metaplate and pods. And it does work with the post but not with my custom post type, I used the exact same form in both,and the “post” works with and without the code:

        {{#each taxonomy.post_tag}}

      • {{name}}
      • {{/each}}

        But the custom post type just don’t show the taxonomy.
      Thread Starter Zenbirdy

      (@zenbirdy)

      Yes. I created the custom post type with pods, and in the built-in taxonomies option, I checked tags(post_tag) option.

      Thread Starter Zenbirdy

      (@zenbirdy)

      Ok, I’ve been testing and I find that it works in “posts” but not in “custom post types”.

      How can I make it work on custom post types?

      Thread Starter Zenbirdy

      (@zenbirdy)

      Thanks Josh, now I used your code: {{#each taxonomy.post_tag}} {{name}} {{/each}} in my functions php file, I was using that code in my metaplate template, maybe that is why it was returning nothing.

      Before I was getting a blank field with that code, but now that is in my functions.php file I get the “Array” instead of my taxonomy, why would that be?

      Hi Josh I first tried your example:

        {{#each taxonomy.post_tag}}

      • {{name}}
      • {{/each}}

        But it doesn’t display anything. Thats’s why I modified it.

        What I am trying to do is a form with a dropdown list of taxonomies. And I want to show the taxonomy selected.

        But that code does not show the taxonomy selected nor the list of taxonomies available, it doesn’t show anything to me.

      Does that snippet works with a taxonommy created with pods? I tried it but it doesn’t display anything, the only way I can get it to do something is this way: {{taxonomy.post_tag}} {{name}}, but instead of showing the taxonomy it shows “Array”, it doesn’t matter which taxonomy I choose every time it shows the same “Array”.

    Viewing 15 replies - 1 through 15 (of 26 total)