Forum Replies Created
-
AuthorPosts
-
James McMemberIt would seem as though naming fields as ‘taxonomy’ creates a collision with how wordpress does things. The troubleshooting I’ve done should help Steve spend his time reworking his solution as opposed to finding the bug. With 3.5 now out, I am sure he is busy with some loose ends.
James McMember@Steve – thanks. I thought maybe you had Romny on the brain when you were coding it.
The taxonomy_exists() function isn’t to happy about handing it a nested array. I guess you can’t create those taxonomy field checkboxes with field names like: name=”taxonomy[piklist_demo_type][]”.
You can fix the warnings by modifying the function get_field_name() in class-piklist-form.php with something like the following:
if ($scope == 'taxonomy')
{
$name = 'tax_input[' . $field . '][]';
}
else
{
$name = $prefix . ($scope ? $scope . (self::is_media() && isset($GLOBALS['piklist_attachment']) ? '_' . $GLOBALS['piklist_attachment']->ID: '') . '[' : null) . $field . ($scope ? ']' : null) . (is_numeric($index) ? '[]' : null);
}
Not sure if this is how you would want to actually fix this, there might be side effects somewhere else. But it works it seems.
James McMemberFound a typo in class-piklist-taxonomy.php:
public static function process_form($term_id, $taxonomny_id)
James McMemberI can reproduce same error message from my install with Demo Type taxonomy and Demo CPT with WP development version (3.5-RC6-23166)
Also, selecting/editing Demo Type taxonomies for Demos works fine in quick edit menu.
Further, when editing a Demo, unchecking the current Demo Type and saving works fine, however, after the page reloads, the previous Demo Type is still selected.
James McMember@Steve – when I inspected what was being stored in the post_meta table, which correctly was an empty value, it looked to me like it was the javascript that was being the culprit.
James McMemberThe problem is located in the /parts/js/pik.js file.
The following code:
switch (field.type)
{
case 'datepicker':$('#' + field.id)
.val($('#' + field.id).val() ? $('#' + field.id).val() : field.value)
.attr('autocomplete', 'off')
.datepicker(options);break;
Is where you need to look. I am not sure of the best way to solve this, as my javascript/jquery-fu is weak. My suggestion is the following modification, but it may have side effects/not be correct in this context:
switch (field.type)
{
case 'datepicker':$('#' + field.id)
.val($('#' + field.id).val() ? $('#' + field.id).val() : '')
.attr('autocomplete', 'off')
.datepicker(options);break;
James McMemberHi,
If I have a chance tonight, I’ll try and find what the best approach to fix this might be.
I have confirmed this behavior when a datepicker field is in the post_meta scope. The datepicker does not do this when in a settings page/tab.
James McMemberThis would be a good place to start…
http://piklist.com/user-guide/tutorials/creating-meta-boxes-fields/
Also, in reference to adding ‘Title’ or WYSIWIG, you need to tell your custom post type which stock wordpress post features you want. See:
http://codex.wordpress.org/Function_Reference/register_post_type
http://codex.wordpress.org/Function_Reference/add_post_type_supportTry the following in your code:
,'supports' => array(
'title'
,'editor'
,'author'
,'revisions'
)
December 4, 2012 at 8:03 pm in reply to: Suggestion: Be able to add metaboxes field to a specific page #518
James McMember@kattagami — Did it work for you? I guess it would fancier to have some css and javascript added to this so that template specific meta-boxes are hidden until the corresponding template is selected.
James McMember@jchamb: Thanks, will check it out. I noticed some changes in the piklist code related to this this morning, so things may have been updated since my previous posts.
James McMemberWow, how have I missed LESS all this time? Do you know how many times I’ve leaned back in my chair and thought to myself ‘there must be a better way’ for solving the ‘dynamic CSS’ problem. And it even has a WP plugin to boot! Thats great. Will definitely check this out and have a look.
James McMemberError is in process_form function in file includes/class-piklist-media.php
The fix is to return the $post variable.
public static function process_form($post, $attachment)
{
piklist_form::process_form(array(
'post' => $post['ID']
));
return $post;
}
See the WP Codex…
Note that the filter function must return the $post array after it is finished processing.
James McMemberI can reproduce when saving an ‘Add New Piklist Demo’ page/post. Adding a regular wordpress page works fine.
James McMemberConfirmed fixed in v0.6.7
-
AuthorPosts