dg_Amanda on "[Plugin: Media Library Assistant] Apply Category to JPG images only on Upload"

ساخت وبلاگ

I have uploaded a new MLA Development Version dated 20160714 that contains an example plugin, /media-library-assistant/examples/mla-substitution-parameter-hooks-example.php.txt with a solution for your application.

The example plugin implements a new "conditional:" custom data source that you can use in your mapping rule. Just change your EXIF/Template value to:

template:[+conditional:is_upload,values('restricted','',image/jpeg)+]

If you want to apply the rule to all image types, e.g., to .png images as well, you can code:

template:[+conditional:is_upload,values('restricted','',image)+]

You can also apply a different category to non-image items by coding something like:

template:[+conditional:is_upload,values('restricted','not restricted',image)+]

I hope that makes sense. I chose this implementation because I can think of other ways to use a similar approach.

To get the Development Version, follow the instructions in this earlier topic:

Shortcode not working in (special) widget

Strictly speaking you don't need the new Development Version, just the example plugin. If you give me your contact information I can send the example plugin by email. I will post a summary here when it's complete and tested. You can use the Contact Us page at our web site:

Fair Trade Judaica/Contact Us

Do not post your e-mail address in the forum; personal details in a public forum violates WordPress guidelines. I look forward to hearing from you.

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 366 تاريخ : دوشنبه 18 مرداد 1395 ساعت: 11:36