Forum Replies Created
-
AuthorPosts
-
JasonKeymasterHi @Dzmitry Voranau!
This is definitely possible to do what you’re describing. Take a look at Roles and Capabilities. You can then determine which meta-boxes (or specific fields using the
current_user_can()function) display via the capability comment block parameter.Hope this helps!
JasonKeymasterHi @unleashed!
Glad that helps!
Yup! There’s some internal properties (e.g. id, path to file, etc.) but one of the elements is
$part['data']which contains everything that was in the comment section (and everything that wasn’t). This hooks is the perfect place to change those dynamically.
JasonKeymasterHi @unleashed!
To do something conditionally outside of the comment parameters, you’ll need to use the
piklist_part_processfilter. I just put together the doc for this: https://piklist.com/learn/doc/piklist_part_process/Hope this helps! 🙂
JasonKeymasterAhh.. I see what you’re saying. I don’t believe the preview size is passed along to the javascript that later renders the images as you add them. I’ll make a ticket for this, as it really should be consistent.
Thanks for reporting this, Enrique!
JasonKeymasterHey @eflouret!
Interesting. I just tested it out locally without issue. The scope of the field shouldn’t make any difference as it’s using a global WordPress function to retrieve the image; scope issues would only affect whether or not the correct picture is displayed at all.
If you try a standard WordPress size, such as ‘medium’, does that work? Otherwise, try digging into the field at
/piklist/parts/fields/file.phpto see if the$options['preview_size']is getting overwritten or something.
JasonKeymasterIt isn’t in the new docs, yet, but you can read more on sanitization here: https://piklist.com/user-guide/docs/sanitizing-field-data/
JasonKeymasterHey @eflouret!
I believe how you’re changing the preview size should work… Just to be clear,
newsleteris a registered image size?For the basic uploader, no there is no preview. That’s just using the standard HTML file input field, which doesn’t offer that. Hence, basic. 🙂
Yes! You can do that using the
limitsanitization:array( 'type' => 'file' ,'scope' => 'post_meta' ,'field' => 'article_image' ,'label' => 'Article Image' ,'options' => array( 'modal_title' => 'Add File(s)' ,'preview_size' => 'newsletter' ), ,'sanitize' => array( array( 'type' => 'limit' ,'options' => array( 'max' => 1 ) ) ) ),Hope this helps!
JasonKeymasterHi @tomthomsen!
Can you please provide some more information? Have you tried disabling Piklist and it works? Are you getting an error? I use Piklist on woocommerce sites regularly without issue.
JasonKeymasterHi Fernando!
Extending the built-in WordPress search to scan beyond the defaults is currently outside of the scope of Piklist. I strongly recommend looking into SearchWP as it’s a great plugin that does exactly what you’re looking for.
June 28, 2016 at 7:48 pm in reply to: Replacing 'Name' field for taxonomy with a piklist field #6834
JasonKeymasterHi @Rachel!
This is definitely possible! You can see an example of this in the Piklist Demos. Create a new Piklist Demos Post and then you’ll see the “Taxonomies” metabox on the side. You can also find the metabox in
/piklist/add-ons/piklist-demos/parts/meta-boxes/field-taxonomies.php. For ease I’ll paste it here, too:piklist('field', array( 'type' => 'checkbox' ,'scope' => 'taxonomy' ,'field' => 'piklist_demo_type' ,'label' => __('Demo Types', 'piklist-demo') ,'description' => sprintf(__('Terms will appear when they are added to %1$s the Demo taxonomy %2$s.','piklist-demo'), '<a href="' . network_admin_url() . 'edit-tags.php?taxonomy=piklist_demo_type&post_type=piklist_demo">', '</a>') ,'choices' => piklist( get_terms('piklist_demo_type', array( 'hide_empty' => false )) ,array( 'term_id' ,'name' ) ) ));Hope this helps! 🙂
JasonKeymasterHey @hughc!
There’s always the tension between the newcomer looking to learn and the experienced user trying to look up a quick reference. In the future, I think it would be great to use something like PHP Doc to build out an API based on our DocBlocks. The good news is that if you’re using something like Atom, PhpStorm, or another editor that has PHP parsing, you can pretty easily access the API that way. It’s obviously not ideal, but you could also easily use PHP Doc to make yourself a local API. We’ve really tried to make sure that the Piklist code is well internally documented to the DocBlock standard.
Hope this helps!
JasonKeymasterHi @eflouret!
Checking for the front-end is pretty easy, just throw
!is_admin()in your teeny_mce_buttons hook. Nothing is stored for the editors, so you can do it per request like that.June 18, 2016 at 9:31 pm in reply to: Notice: Undefined offset: 1 in post.php when Debug mode on #6746
JasonKeymasterYou’re very welcome! 🙂
June 16, 2016 at 11:09 am in reply to: Bug: wrong use of translate function in class-piklist.php #6720June 16, 2016 at 10:55 am in reply to: Notice: Undefined offset: 1 in post.php when Debug mode on #6716
JasonKeymasterHey @vayu!
It’s because you’re passing an incorrectly structured array. 🙂
Please take a look on the register_post_type docs under the capability_type section. You’ll see there that it’s expecting the array to be your post type name in singular and plural form (e.g.
array('product', 'products')).My favorite place to look is in the WordPress code itself: https://github.com/WordPress/WordPress/blob/4.5-branch/wp-includes/post.php#L1331
Hope this helps!
-
AuthorPosts