- This topic has 6 replies, 2 voices, and was last updated 3 years, 11 months ago by
Ico.
-
AuthorPosts
-
-
February 26, 2018 at 11:41 am #8756
IcoMemberHi,
I understand why add_more is not working in shortcodes ( the add_more is displayed in shortcode form, but the inserted shortcode takes only the last item ). It is probably a lot of work to implement and probably is not a popular request, but did someone found a workaround? -
February 27, 2018 at 11:11 am #8760
SteveKeymasterI don’t understand. ‘add_more’ is a field parameter. Any fields generated by a shortcode will work.
-
February 27, 2018 at 4:55 pm #8762
IcoMemberHi, I’m not native english speaker, so my bad. What I want to create a shortcode and a form. Here is the code:
test-form.php
<?php /* Name: Post Shortcode Description: Adding add_more field to shortcoe Shortcode: test Inline: false */ piklist('field', array( 'type' => 'text', 'field' => 'test_text', 'label' => 'Text', 'add_more' => true ));test.php
<?php /* Shortcode: test */ ?> <div style="color:grey;"> <span> Args :</span> <pre><?php print_r( $arguments); ?></pre> </div>When I open the modal to insert the shortcode, I have repeating field in the form. If I create three fields ( 1, 2, 3 ), when I insert the shortcode into the editor, only the last shortcode value is added ( the result is ):
[test test_text="3" _index="0"]I added some screenshots : https://my.pcloud.com/publink/show?code=kZn0SL7ZYQw0TpwsSMuL4Pi5rie6sLoCfPNV
Is there a way to make it work? It would be very helpful!
Best,
ChrisAttachments:
You must be logged in to view attached files. -
March 6, 2018 at 5:54 am #8774
IcoMemberUp ⬆️
-
March 12, 2018 at 5:28 pm #8785
SteveKeymaster@bassta– You just stumbled upon a powerful and undocumented feature of Piklist. The ability to save shortcode data to your database. Undocumented… until now. Try this tutorial and let me know what you think >
-
March 14, 2018 at 7:42 am #8789
IcoMemberThanks Steve, it is working for a single field. So the idea is I can pass single values just as shortcode vars and one’s with repeater using save_id, scope and hidden field, then retrieve them with
get_post_meta($post->ID, 'my_shortcode_saved_to_db', false);.This is just great, thanks a lot!
-
March 14, 2018 at 8:02 am #8791
IcoMemberUpdate:
The data is displayed just fine, but clicking when trying to edit the shortcode (click on edit and modal pops-up ) only the first value is displayed;
-
-
AuthorPosts
- You must be logged in to reply to this topic.