Forum Replies Created
-
AuthorPosts
-
May 1, 2014 at 1:37 pm in reply to: How to get metabox data from the form before to save a new post? #1687
SteveKeymaster@kattagami– Piklist actually has a filter to help you do this:
piklist_empty_post_title. I just tested it and there is a small bug which I fixed, and will be in the next version of Piklist. Try this:1) Open class-piklist-cpt.php and find the
wp_insert_post_datafunction. Change the IF statement to this:
if (($data['post_status'] != 'auto-draft') && (($data['post_title'] == 'Auto Draft') || empty($data['post_title']))). That fixes the bug.2) Here’s your function:
function set_cpt_organizer_title($data, $post_array) { if ($post_array['post_type'] == 'organizer') { if((isset($post_array['_post_meta']['firstname'][0])) || isset($post_array['_post_meta']['lastname'][0])) { $full_name = $post_array['_post_meta']['firstname'][0] . ' ' . $post_array['_post_meta']['lastname'][0]; return $full_name; } else { return $post_array['post_title']; } } else { return $post_array['post_title']; } } add_filter('piklist_empty_post_title', 'set_cpt_organizer_title', 10, 2);3) The WordPress
$post_arrayarray returns all the data from your post including meta, so you don’t need to use get_post_meta.Let me know if this works. If there are no issues we’ll document it and write a tutorial.
SteveKeymaster@pupppet– Showing/hiding seems to be a bug with the relate field. Supporting multiple scopes is interesting. I just tested multiple scopes like this
'scope' => array('post','page')and it seemed to work, but throws a bunch of warnings since most Piklist functions are not expecting an array. We’re going to have to think through if, and how, we want to support this.
SteveKeymaster@sewid– Piklist currently does not support this, so you may need to go old school 😉
Try hooking into
save_post, pull the “pretty” date field, convert it and save another field with the unix timestamp. Then sort on that field.This thread on WordPress.org has some good ideas and sample code.
Let us know if this works for you.
SteveKeymaster@jason– I believe you want Nested fields, and there’s an example in Piklist Demos:
add new demo > lists > radio fields > nested fields.
SteveKeymaster@jason– Nice find and great fix. I just included it in the next version of Piklist.
Question: where did you make the pull request to?
SteveKeymaster@phila– Piklist still has a few kinks to work out with Windows installs. We’ll take a look at this one.
SteveKeymasterEven easier. The
editorfield supports this. Pass false to the tinymce parameter >
SteveKeymasterTry this:
add_filter('user_can_richedit', '__return_false', 11);
SteveKeymaster@pupppet– There is bug with the image upload field and add-mores. We are working on a fix.
SteveKeymaster@jmendel– These will be separate plugins when released. We’re still fine tuning them.
SteveKeymasterWe just released v0.9.3.2 which contains this fix so it’s safe for you to update.
SteveKeymaster@jason– You can use CSS to size the box. You can even add your own css classes to the field:
"attributes" => array( "class" => "my-class" )
SteveKeymasterCan you post some code for us to review?
-
AuthorPosts