Forum Replies Created
-
AuthorPosts
-
r.cespaMemberOne more information: removing the file field solves the problem about wrong visualization but I noticed a new strange behavior.
I added a couple of slides to my slider group (without images, of course, only text fields). I saved the data and everything was fine.
I then added a third slide, saved the data and everything was fine.
I removed the third slide using the ” – ” button, I saved the data and I was presented with three slides with the third with empty fields: this looks partially correct to me because data was removed but I expected to see only two slides.Thanks,
Roberto
r.cespaMember@Steve – Good morning and Happy New Year!
I’m using piklist in a project and I’m trying to set up a setting page using group fields, add_mores and file fields.
Basically there is a group Sliders containing slides; each slides contains a file field and four text fileds (title, subtitle, CallToAction text, URL).
I’m facing the same problem as lvlo and I was wondering if the bug has been fixed or if you or any user found a workaround.AFAIK the problem seems to be related to data serialization when saving to wp_options table: when saving data it creates an array for every single element but the array containing file information is “wrongly sized”; what I mean is that the first array (background of first slide) has one single element with index 0; the second array (background of second slide) has two (??) elements: the first one (index: 0) is set to undefined while the second one (index: 1) is set to image ID.
If I manually alter the serialized string and correct the anomaly, the page is displayed correctly until I add a new element. If I modify existing elements it still looks ok.Some information about my current setup:
WP 4.3.2 MultiSite
Piklist 0.9.4.29Correct serialized data:
a:1:{s:6:"slider";a:1:{s:5:"slide";a:2:{i:0;a:5:{s:10:"background";a:1:{i:0;a:1:{i:0;s:3:"456";}}s:8:"h1_title";a:1:{i:0;s:12:"Test Title 1";}s:8:"h2_title";a:1:{i:0;s:15:"Test Subtitle 1";}s:3:"cta";a:1:{i:0;s:5:"CTA 1";}s:7:"cta_url";a:1:{i:0;s:22:"http://www.example.com";}}i:1;a:5:{s:10:"background";a:1:{i:0;a:1:{i:0;s:3:"156";}}s:8:"h1_title";a:1:{i:0;s:12:"Test Title 2";}s:8:"h2_title";a:1:{i:0;s:15:"Test Subtitle 2";}s:3:"cta";a:1:{i:0;s:5:"CTA 2";}s:7:"cta_url";a:1:{i:0;s:23:"http://www2.example.com";}}}}}Wrong serialized data string (I added a third slide):
a:1:{s:6:"slider";a:1:{s:5:"slide";a:3:{i:0;a:5:{s:10:"background";a:1:{i:0;a:1:{i:0;s:3:"456";}}s:8:"h1_title";a:1:{i:0;s:12:"Test Title 1";}s:8:"h2_title";a:1:{i:0;s:15:"Test Subtitle 1";}s:3:"cta";a:1:{i:0;s:5:"CTA 1";}s:7:"cta_url";a:1:{i:0;s:22:"http://www.example.com";}}i:1;a:5:{s:10:"background";a:1:{i:1;a:1:{i:0;s:3:"156";}}s:8:"h1_title";a:1:{i:0;s:12:"Test Title 2";}s:8:"h2_title";a:1:{i:0;s:15:"Test Subtitle 2";}s:3:"cta";a:1:{i:0;s:5:"CTA 2";}s:7:"cta_url";a:1:{i:0;s:23:"http://www2.example.com";}}i:2;a:5:{<strong>s:10:"background";a:1:{i:2;a:2:{i:0;s:9:"undefined";i:1;s:3:"318";}</strong>}s:8:"h1_title";a:1:{i:0;s:12:"Test Title 3";}s:8:"h2_title";a:1:{i:0;s:15:"Test Subtitle 3";}s:3:"cta";a:1:{i:0;s:5:"CTA 3";}s:7:"cta_url";a:1:{i:0;s:23:"http://www3.example.com";}}}}}Ciao,
Roberto
r.cespaMember@Steve
Sorry for the delay: I created the CPT and the custom taxonomy using piklist; I’m trying to save data from CPT edit screen into the custom taxonomy.
<?php include('piklist-field-addons.php'); add_filter('piklist_post_types', 'WPT_post_type'); add_filter('piklist_taxonomies', 'WPT_type_tax'); function WPT_post_type($post_types) { $post_types['offer'] = array( 'labels' => piklist('post_type_labels', 'Offerta'), 'public' => true, 'rewrite' => array( 'slug' => 'offerta' ), 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'custom-fields', 'revisions' ), 'hide_meta_box' => array( 'author', 'revisions', 'comments', 'commentstatus' ) ); return $post_types; } function WPT_type_tax($taxonomies) { $taxonomies[] = array( 'post_type' => 'offer', 'name' => 'departureCity', 'show_admin_column' => true, 'hide_meta_box' => false, 'configuration' => array( 'hierarchical' => false, 'labels' => piklist('taxonomy_labels', 'Aeroporto di Partenza'), 'show_ui' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'aeroporto-di-partenza' ) ) ); return $taxonomies; }And in parts/meta-boxes/test.php I put:
piklist('field', array( 'type' => 'group', 'label' => 'Prezzi', 'field' => 'prezzi', // 'add_more' => true, 'fields' => array ( array( 'type' => 'datepicker', 'field' => 'departureDate', 'label' => 'Data di partenza', 'columns' => 6, ), array( 'columns' => 6, 'scope' => 'taxonomy', 'type' => 'text', 'field' => 'departureCity', 'label' => 'Città di partenza', 'description' => 'Terms will appear when they are added to this taxonomy.', ) ) ) );I can see the taxonomy meta-box on the edit screen and I can see the text field created by Piklist; if I put some text in that field, the term is saved to the database but it is not showed on the next refresh of the screen and is not added as a term in the “standard” meta-box. I tried saving draft, publishing, etc.
Any suggestion?
r.cespaMemberI have a similar problem: I need to save some data in a taxonomy term but I do not know how to specify what taxonomy should be used.
I noticed that naming the field like the taxonomy, the term is saved in wp_terms table but the relationship between taxonomy term and post is not saved anywhere.
Any hint on this?
r.cespaMemberSame problem here! +1
Ciao
r.cespaMember@anderly- Thank you for your plugin. I was wondering if it could be possible to leverage the Select2 AJAX capabilities to search through a long list of term without the need to load it in advance.
Ciao,
Roberto
r.cespaMemberHi, Steve!
I spent some time yesterday moving from theme approach to plugin approach; I hope to be able to replicate the same functionality I’m trying to build on several sites without being stuck with the same theme.Thank you very much for your effort. I’ve just downloaded the file you linked and looked at it. I hope to do some tests in the evening or tomorrow.
Ciao,
Roberto
r.cespaMemberI’m trying several solutions to set up a custom admin interface for some projects and Piklist is definitely my preferred choice so, please, hurry up!!!
I’m obviously joking! take all the time you need to develop good code as the whole Piklist plugin.
Do you think I could try to use a the missing relationship by myself? What I mean is: I could write some custom functions in my theme using standard WordPress hooks like save_post, etc. In the admin screen I could insert a dropdown menu populated with the list of CPTs I need and execute custom SQL queries on custom SQL tables to store the value and retrieve them at later time. Is this correct?
Thanks,
Roberto
r.cespaMemberHi Steve!
Any news on this topic? Relationship is a great feature that I’m really missing. Without it I cannot start coding my projects.
I noticed two tables in the db called wp_post_relationships and wp_term_relationships and I think I could try to populate them using some save_action functions but I would like to know if a release date for this feature is planned.
Thanks,
Roberto -
AuthorPosts