Forum Replies Created
-
AuthorPosts
-
SteveKeymasterGlad you like it!
SteveKeymaster@luis– So, you have a few options here:
1) Create a SETTINGS page. Instead of an admin-page, create a settings page and the data will be saved with the WordPress settings api: https://piklist.github.io/docs/tutorials/settings/building-settings-pages/
2) If you want to keep the admin-page you can create a separate Piklist Form and embed it into the admin-page. The benefit with a form is that you can save the data anywhere you want: settings, post_meta, user_meta, etc or a combination of all.
— Create the form: https://piklist.github.io/docs/forms/
— use this function call in your admin-page to embed the form:piklist('form', array( 'form' => 'your-form-file-name-without-the-php' ));Either way will work!
May 12, 2020 at 4:05 pm in reply to: Does Piklist settings saved on posts are exported with WordPress tool #10651
SteveKeymaster@mhweb– The default WordPress export tool will also export Piklist custom field data.
SteveKeymasterThere are definitely a few issues on the New term screen, which will be addressed in Piklist v2.0. You may have to allow the user to fill in those fields on the Edit screen for now.
SteveKeymasterHappy to help!
SteveKeymaster@invisiblevision– Welcome to the Piklist community!
Is this on the NEW Term screen, or when you are editing an existing term?
SteveKeymasterFirst you need to write your custom validation function. Using your code snippet, above, and using the Piklist “range” validation rule as a template because it’s similar, I came up with this:
function validate_number_length($index, $value, $options = null, $field, $fields) { extract($options); $passed_value = $field['request_value'][0]; $required_length = $options['length']; if (ctype_digit($passed_value) and $needsMatch = strlen($required_length)) { return true; } else { return sprintf(__('contains a value that is not %s characters', 'piklist'), $required_length); } }Next add a function that filters
piklist_validation_rulesand calls your function:add_filter('piklist_validation_rules', 'check_number_length', 11); function check_number_length($validation_rules) { $validation_rules['number_length'] = array( 'callback' => 'validate_number_length' ); return $validation_rules; }Then you would use it like this:
piklist('field', array( 'type' => 'number', 'field' => 'my_field', 'label' => 'my field', 'validate' => array( array( 'type' => 'number_length', 'options' => array( 'length' => 3 ), ) ) ));This is untested.
SteveKeymaster@cyclissmo– I love that you are so used to building with Piklist, that adding fields to the REST API the WordPress way is considered hackery! 😉
SteveKeymasterYou can easily create your own validation rules to use with Piklist:
https://piklist.github.io/docs/actions-filters/filters/piklist_validation_rules/
SteveKeymaster@courtens– When a user registers the normal WordPress way, you want to save the customers name as a user taxonomy term?
SteveKeymasterList Tables have not been added yet. You will have to create one the old fashioned way 😉
SteveKeymasterRegistering a Post Type automatically adds that menu: https://piklist.github.io/docs/actions-filters/filters/piklist_post_types/
SteveKeymasterPiklist does everything the WordPress way, using core WordPress functions. You can do this using the WordPress filter wp_insert_post_data.
Any tutorial you find with encrypting data in WordPress you can use with Piklist. Something like this may help: https://torquemag.io/2016/10/storing-encrypted-data-wordpress-database/
SteveKeymasterWe really love when users spread the love. 😉
Let us know how we can help with your presentation.
SteveKeymasterWorkflows can contain subtabs, which are essentially another set of Workflow tabs. But they can only go one level deep. Here’s a tutorial >
-
AuthorPosts