Levy on "[Plugin: Media Library Assistant] Parent category tag"

ساخت وبلاگ

Thanks for your update with the additional information, and for taking the time to look through the related topic I mentioned.

After pondering your Idea and application requirements I decided that the best approach required some changes to MLA itself. I have uploaded a new MLA Development Version dated 20160604 that implements four new filters (hooks) that let you define "custom data sources". I've been thinking about something like this for some time and your application gives me a great example of how to use it; thank you!

The new Development Version also contains an example plugin that provides the parent category values your application requires. When you have installed and activated the /examples/mla-substitution-parameter-hooks-example.php.txt example plugin you can populate your ALT Text values with a mapping rule:

  1. Navigate to the Settings/Media Library Assistant IPTC/EXIF tab.
  2. Scroll down to the ALT Text line of the Standard Field Mapping section.
  3. Enter template:[+parent_terms:category,single+] in the text box under the EXIF/Template Value heading.
  4. Set the Priority dropdown control to EXIF and the Existing Text dropdown to Replace.
  5. Scroll to the bottom of the screen and click "Save Changes" to record your settings.

Once that's done you can use the Map All Attachments, Standard Fields Now button to go back and set the ALT Text field for your existing items, if that is appropriate. You can use the Media/Assistant Bulk Edit area or the Media/Edit Media screen to make more selective replacements. Look for the Map IPTC/EXIF Metadata button on either of those screens.

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

Shortcode not working in (special) widget

It would be great if you can install the Development Version, try the example and let me know how it works for you. The "Field-level substitution parameter filters (Hooks)" of the Settings/Media Library Assistant Documentation tab has more information on the new fiters and how to install the example plugin. Of course, if any other problems emerge I want to know about them as well.

If you would rather get the example plugin by email, send you contact information and I will reply with the code. You can give me your contact information using the Contact Us page at the FTJ 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. If you have trouble accessing the FTJ site, post a note here with your country of origin and I can temporarily unblock it.

You wrote "the distinction of a primary category for each post is now standard in WP. That's true for categories, not tags." My search of the WordPress Codex failed to retu any information on "primary category", but a Google search tued up these items:

How can I select a primary category?

WordPress Tip: Specify a Primary Category using Advanced Custom Fields

Yoast SEO 3.1: Improved snippet editor and primary category

The new Make Primary category function in Yoast SEO

If you have any further details on a WordPress "primary category", let me know. In the interim I added the ,single format option to the mapping rule to pick the first category assigned to the parent just in case there are multiples. You could remove it to get a comma-delimited list of all categories when there are multiple assigned terms.

Finally, I see you have discovered the shortcomings of the WordPress parent/child tradition:

How do I extract the id from inserted_in and featured_in?

As you've discovered, WordPress is lax in attaching items to a post/page when it is inserted or used as a Featured Image. You may also have discovered that a single item can be inserted in or be the Featured Image of more than one post/page. I will address those issues when I work on a response to your other topic.

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

برچسب : نویسنده : استخدام کار wpss بازدید : 175 تاريخ : يکشنبه 16 خرداد 1395 ساعت: 10:31