Labs64 / credit-tracker

Credit Tracker WordPress plugin
https://wordpress.org/plugins/credit-tracker/
GNU General Public License v2.0
20 stars 20 forks source link

Credit Metadata on Gallery Captions #15

Closed r-brown closed 5 years ago

r-brown commented 9 years ago

When I create a Gallery collection of images using the WordPress "Add Media" function, the Credit Tracker information is not outputted via the image caption.

Is this expected behavior and, if so, is there a function/filter which could add the Credit Tracker metadata to captions of Gallery images?

Source: https://wordpress.org/support/topic/credit-metadata-on-gallery-captions

Jaace commented 6 years ago

I can take a look into this.

r-brown commented 6 years ago

Hi @Jaace - absolutely, thank you for your support!

idea--list commented 5 years ago

Hi there @r-brown , i made a dirty solution for this issue. Principally i just copied the the code that generates a gallery from WP (media.php), modified some lines in that and put it into credit-tracker-shortcodes.php

Why so? Of course i could just filter the HTML which is returned from WP, but then i should implement a search and replace function with regular expressions in order to find the figcaption tag for each image and then replace their content with the proper authors. But regular expressions would cost too much resources.

Please tell me if you are interested in the solution.

r-brown commented 5 years ago

Hi @idea--list ,

Thank you for your contribution. Sure, we are interested in the improvement you've made. Please share this with us. If we decide to not include this in a standard plugin delivery (due to the WordPress upgrade process stability), we can create a Wiki page with this troubleshooting.

Best, r-brown

r-brown commented 5 years ago

How to create gallery: https://codex.wordpress.org/The_WordPress_Gallery

r-brown commented 5 years ago

Tested using below post/page content:

<strong>Credit Tracker table</strong>

[credit_tracker_table]

<strong>Credit Tracker at WP Gallery</strong>

[gallery link="none" size="large" ids="8,7,5"]

Result

image
r-brown commented 5 years ago

Docu / Wiki / etc. is outstanding