Plugin Directory

Changeset 3390059


Ignore:
Timestamp:
11/04/2025 11:08:22 PM (5 months ago)
Author:
desk9
Message:

Small update after release

Location:
image-credit-companion
Files:
45 added
1 edited

Legend:

Unmodified
Added
Removed
  • image-credit-companion/trunk/readme.txt

    r3390056 r3390059  
    2222* **Comprehensive Admin Interface**: Site-wide overview with filtering, bulk editing, and usage statistics
    2323* **Template System**: Customizable output templates with theme override support
    24 * **REST API**: Full API support for custom integrations and third-party tools
    2524* **Performance Optimized**: Efficient database design with caching and indexed queries
    2625* **Security First**: Proper sanitization, validation, and capability-based access control
     
    1571564. The block will automatically display the appropriate image sources
    158157
    159 = Template Customization =
    160 
    161 Create custom templates in your theme's `image-credit-companion/` directory:
    162 
    163 ```php
    164 // yourtheme/image-credit-companion/list-ul.php
    165 <div class="my-custom-image-sources">
    166     <h3>Image Credits</h3>
    167     <ul>
    168         <?php foreach ($images as $image): ?>
    169             <li>
    170                 <?php echo esc_html($image['author']); ?> —
    171                 <em><?php echo esc_html($image['attachment_title']); ?></em>
    172                 <?php if ($image['license_name']): ?>
    173                     (<?php echo esc_html($image['license_name']); ?>)
    174                 <?php endif; ?>
    175             </li>
    176         <?php endforeach; ?>
    177     </ul>
    178 </div>
    179 ```
    180 
    181 = REST API Usage =
    182 
    183 The plugin provides a REST API for programmatic access to image metadata.
    184 
    185 **REST API Endpoint Base:** `/wp-json/imagcrco/v1/`
    186 
    187 Get images for a specific post:
    188 ```
    189 GET /wp-json/imagcrco/v1/post/123/images
    190 ```
    191 
    192 Update attachment metadata:
    193 ```
    194 POST /wp-json/imagcrco/v1/attachment/456/meta
    195 {
    196     "author": "John Doe",
    197     "source_url": "https://example.com",
    198     "license_name": "CC BY 4.0",
    199     "license_url": "https://creativecommons.org/licenses/by/4.0/"
    200 }
    201 ```
    202 
    203 == Developer Notes ==
    204 
    205 = Hooks and Filters =
    206 
    207 * `imagcrco_supported_post_types`: Modify which post types are scanned for images
    208 * `imagcrco_image_sources_output`: Filter the final output HTML
    209 * `imagcrco_attachment_metadata`: Filter attachment metadata before saving
    210 
    211 = Database Schema =
    212 
    213 The plugin creates a custom database table to efficiently track which images are used in which posts:
    214 * `id`: Primary key
    215 * `post_id`: Post ID where image is used
    216 * `attachment_id`: WordPress attachment ID
    217 * `context`: Usage context (e.g., "core/image", "html")
    218 * `first_seen`: When image was first used
    219 * `last_seen`: When image was last used
    220 
    221 = Capabilities =
    222 
    223 * `manage_image_sources`: Full administrative access
    224 * `edit_image_sources`: Edit image metadata
    225 * `view_image_sources`: View image sources (default for all users)
    226158
    227159== Support ==
Note: See TracChangeset for help on using the changeset viewer.