This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Auto-populate Image ALT Tags from Media Library

توضیحات

Automatically populates Alt and Title tags for images featured in posts and pages, pulling directly from the values set in the Media Library. This makes it easy to manage your image metadata centrally in one place (the Media Library). Plugin also supports the ability to override the Alt/Title tag Media Library values by placing an Alt/Title tag directly on the attachment in the WordPress WYSIWYG Editor.

Tag population only occurs when viewing the post or page, and does not occur in the WYSIWYG editor.

نصب

This section describes how to install the plugin and get it working.

  1. Upload the img-alt-media-library directory to the plugins directory of your theme (usually /wp-content/plugins/).
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.

That’s all, you’re good to go! Upon viewing your posts and pages, you should now see image Alt and Title tags being pulled automatically from the Media Library.

سوالات متداول

How does it work?

This plugin hooks into the the_content filter on page and post render. Essentially right before post_content (in the form of raw HTML) is set to the browser, this plugin will scan the HTML for tags using a regex matcher. Regex was used instead of parsing the HTML into a Document Object to maximize compatibility (parsing the HTML into a Document Object, and then back to an HTML string would likely modify the HTML syntax, drop attributes, etc. which could break other components and post functionality).

Once images are identified in the HTML, the image src URL is used to lookup the attachment ID corresponding to the image. Unfortunately I was not able to find a cleaner way of performing this lookup, as the image ID is not always output onto the page when an attachment is included.

Once the image ID is determined, the plugin retrieves the image Alt and Title values for that attachment using the get_post_meta() and get_the_title() WordPress functions. Once these values are returned, they are added to the image unless the image already contains an alt or title tag, in which case this part is skipped.

The modified image HTML is placed back into the post_content HTML string, and returned to the browser.

نقد و بررسی‌ها

نقد و بررسی‌ای برای این افزونه یافت نشد.

توسعه دهندگان و همکاران

“Auto-populate Image ALT Tags from Media Library” نرم افزار متن باز است. افراد زیر در این افزونه مشارکت کرده‌اند.

مشارکت کنندگان

ترجمه “Auto-populate Image ALT Tags from Media Library” به زبان شما.

علاقه‌ مند به توسعه هستید؟

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

گزارش تغییرات

1.1

  • Updated “Tested up to” tag on readme

1.0

  • Initial release of functional code and readme