Forum Replies Created

Viewing 15 posts - 91 through 105 (of 330 total)
  • Author
    Posts
  • in reply to: update grouped post meta from 3rd party plugin #6904
    Jason
    Keymaster

    Hi @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!

    in reply to: Display metabox by condition #6876
    Jason
    Keymaster

    Hi @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.

    in reply to: Display metabox by condition #6871
    Jason
    Keymaster

    Hi @unleashed!

    To do something conditionally outside of the comment parameters, you’ll need to use the piklist_part_process filter. I just put together the doc for this: https://piklist.com/learn/doc/piklist_part_process/

    Hope this helps! 🙂

    in reply to: Image preview on backend form #6862
    Jason
    Keymaster

    Ahh.. 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!

    in reply to: Image preview on backend form #6859
    Jason
    Keymaster

    Hey @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.php to see if the $options['preview_size'] is getting overwritten or something.

    in reply to: Image preview on backend form #6856
    Jason
    Keymaster

    It isn’t in the new docs, yet, but you can read more on sanitization here: https://piklist.com/user-guide/docs/sanitizing-field-data/

    in reply to: Image preview on backend form #6855
    Jason
    Keymaster

    Hey @eflouret!

    I believe how you’re changing the preview size should work… Just to be clear, newsleter is 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 limit sanitization:

    
    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!

    in reply to: Woocommerce #6854
    Jason
    Keymaster

    Hi @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.

    in reply to: Search for information in the fields #6835
    Jason
    Keymaster

    Hi 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.

    in reply to: Replacing 'Name' field for taxonomy with a piklist field #6834
    Jason
    Keymaster

    Hi @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! 🙂

    in reply to: new docs problems #6831
    Jason
    Keymaster

    Hey @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!

    in reply to: Removing buttons from editor #6830
    Jason
    Keymaster

    Hi @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.

    Jason
    Keymaster

    You’re very welcome! 🙂

    in reply to: Bug: wrong use of translate function in class-piklist.php #6720
    Jason
    Keymaster

    Hey @scalait!

    Good catch! Thank you for pointing that out! 🙂

    in reply to: Notice: Undefined offset: 1 in post.php when Debug mode on #6716
    Jason
    Keymaster

    Hey @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!

Viewing 15 posts - 91 through 105 (of 330 total)