Viewing 8 reply threads
  • Author
    Posts
    • #6802
      cannect
      Member

      Hi,

      I have the following part code:

      
      <?php
      
      /*
      Title: Home page background slider images
      Description: The images which will be showed as a background slider on the homepage
      Post Type: page
      Order: 1
      ID: 41
      */
      
      piklist('field', array(
          'type' => 'file',
          'field' => 'slider_afbeeldingen',
          'label' => 'Slider afbeelding(en)',
          'description' => 'Upload your images which will be showed on the homepage as a background slider',
          'validate' => array(
              array(
                  'type' => 'limit',
                  'options' => array(
                      'min' => 2,
                      'max' => 25
                  )
              )
          ),
          'sortable' => true
      ));
      

      I now added sortable => true, but that did change anything.
      The problem is, I can sort the images in the background, but when I save and reload the page, the images stand as they were before.

      How is this possible?

    • #6815
      Steve
      Keymaster

      sortable shouldn’t matter in this case. Can you resort in the Piklist demos?

    • #6824
      cannect
      Member

      Hi,

      I just tested it, and it does work in the demo type!

    • #6825
      Steve
      Keymaster

      So, it looks like it’s something with your field/form. Try removing the sortable and validate parameters.

      You can try this as well >

    • #6839
      cannect
      Member

      Hi, I removed the sortable and validate parameters and added:

      
      function my_custom_init() {
        remove_post_type_support( 'post', 'custom-fields' );
      }
      add_action( 'init', 'my_custom_init' );
      

      But no change. I have the most simplest Piklist configuration with only the code I gave you. And it is not working. I am trying furter.

      Thanks so far!

    • #6908
      cannect
      Member

      Hi,

      Maybe it is because I use a non-English WordPress? Can you please upload the previous version to me, because that version worked completely.

      I am currently digging through your code, but cannot find where you create the hidden elements above the images.

      See here an image before I sort three images:
      Before sorting action in Post

      And here after sorting action in a post (not saved yet).
      After sorting action

      As you can see, the html ID attributes are missing for the last two.

    • #6909
      cannect
      Member

      Ok, I have repoducable steps to show that reordering is really not working:

      1: install WordPress https://wordpress.org/download/ (default English version, install with English language)
      2: install Piklist 0.9.9.9 https://wordpress.org/plugins/piklist/
      3: only activate Piklist plugin, and the plugin below
      4: Add my plugin below:

      /myplugin/myplugin.php:

      
      <?php
      /*
      Plugin Name: My plugin
      Plugin Type: Piklist
      Version: 1.0
      */
      

      /myplugin/parts/meta-boxes/mymeta.php:

      
      <?php
      /*
      Title: Testupload
      Description: Testupload
      Post Type: page
      */
      
      piklist('field', array(
          'type' => 'file',
          'field' => 'sliderimg',
          'label' => 'Slider img',
          'description' => 'Upload',
      ));
      

      As you will see, you cannot reorder. I think we have now the exact same setup (English version, brand new database, only Piklist installed)

      Can you please test it on your system too? I am sure it will not work on your system too.
      Or maybe I have wrong options in my meta file?

    • #6910
      cannect
      Member

      Hi,

      I just installed version 0.9.4.30. And everything is working now, however, this is a really old version that misses important fixes.

    • #6911
      cannect
      Member

      And now installed version 0.9.9.2 and in this version everything is working. It works on the production site too. So i really think you have to squash some bugs 😉

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