Viewing 5 reply threads
  • Author
    Posts
    • #10997
      thor
      Member

      I stumbled upon a tutorial in the docs:
      https://docs.piklist.com/tutorials/shortcodes/save-shortcode-data-to-database/

      It is missing a ‘)’ in the end of the first piece of code. By the way, is it suppose to show the fields data_id as value in the shortcode, or is my_shortcode_saved_to_db="" the right appearance?

    • #10998
      Steve
      Keymaster

      @thor– since your saving the shortcode data to the database, Piklist needs a way to pull it. You can use that shortcode multiple times in one post so the only unique ID to use is meta_id.

      Let us know how this works for you. It’s one of the coolest features of Piklist.

      I updated the docs page as well: https://docs.piklist.com/tutorials/shortcodes/save-shortcode-data-to-database/

    • #11000
      thor
      Member

      Thank you Steve. I understand how it works now 🙂

      Is there a way (filter?) to prevent the urlencoding of the shortcode fields/parameters that Piklist returns to the editor?

    • #11001
      Steve
      Keymaster

      Can you post here what you are seeing?

    • #11003
      thor
      Member

      If I have this:

      
      <?php
      /*
      Name: Test
      Description: Testing
      Shortcode: test
      Icon: dashicons-editor-quote
      */
      
      piklist('field', array(
          'type' => 'text'
          ,'field' => 'my_shortcode'
          ,'label' => 'Demo shortcode'
      ));
      

      and enter “This is a test” in the field, it encodes and outputs the shortcode to

      
      [test my_shortcode="This%20is%20a%20test"]
      

      I understand that this is safer in many cases, but it makes the shortcodes almost unreadable in some cases – and not easily editable – e.g. if it’s an URL as attribute or comma separated values like 1,2,3,4: [test my_shortcode="1%2C2%2C3%2C4"]

    • #11004
      Steve
      Keymaster

      Ah… Sorry, Piklist does not have a filter for that.

Viewing 5 reply threads
  • You must be logged in to reply to this topic.