Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show the caption as text and not the copyright place-holder for specific images #43

Open
Manni79 opened this issue Oct 11, 2019 · 10 comments
Labels
enhancement hacktoberfest Hacktoberfest ready issue

Comments

@Manni79
Copy link

Manni79 commented Oct 11, 2019

Hello,

Any chance to show normal captions as text and not the copyright place-holder for some specific images?

We have some Images which have a caption entered in wordpress. When switching the plugin on, all captions will be replaced with the place holder out of the credit tracker settings. Are we able to show the caption text (only) as set in the settings of an in an article used image for specific images?

With other words:
Any solution to show the normal image caption, without effects of this plugin, same as the caption are entered in wordpress as without the plugin.

best regards
Manni

@r-brown r-brown added hacktoberfest Hacktoberfest ready issue question labels Oct 11, 2019
@r-brown
Copy link
Member

r-brown commented Oct 11, 2019

Hello @Manni79 you can try to use %caption% placeholder to use defined image caption in the credit.

@Manni79
Copy link
Author

Manni79 commented Oct 11, 2019

I tried already but it is not working.

In Credit tracker settings I used "© %author% - %publisher% - %caption%" for the string you can enter in the top of the credit tracker setting page.
I seems not to work for us: When I entered some Caption text in wordpress in a article/post like...

[caption id="attachment_1111" align="alignright" width="111"]<img class="wp-image-1111 size-full" src="https://www.11111111.com/wp-content/uploads/1111111-11111.jpg" alt="111111" width="1111" height="1111" /> MY Caption Text with normal used Wordpress caption function in a post[/caption]

... then the caption text is not shown. It still only shows the copyright information.

Would be nice to see this fixed or give me an advice what I am do wrong. Thanks a lot!

But this would be also just a workaround, because I am not sure to add the Caption to the credit tracker overall settings. Is there a possibility to also make the entered caption visible for specific images? For example with using some place-holder in the specific post-image caption-text?

@r-brown
Copy link
Member

r-brown commented Oct 11, 2019

Hi @Manni79

%caption% placeholder takes the values from the Media Caption field and not from the content of the caption shortcode as you provided.
To test this I'd suggest to add Caption to any of the images in the Media Library and this text should be shown then.

@Manni79
Copy link
Author

Manni79 commented Oct 11, 2019

Thank you @r-brown, that really seems to be the reason why it is not working for me.

But on the other side, this is not a solution for my case. We (and I think often people do) use same images on different places of a web portal. And on different places the image has also a different caption.
So we never use the caption, which is saved directly to the image, but we use the captions you can write in word-press dynamically to every separate image usage by using the wordpress UI or edit the caption shortcode.

So my new question is:
Do you see any solution to show the "dynamically caption text" which you can add to an image when using it in a post in wordpress? (caption short code text, or how ever it is called)

@r-brown
Copy link
Member

r-brown commented Oct 11, 2019

Hi @Manni79 got it.
In the Credit Tracker documentation at /wp-admin/options-general.php?page=credit-tracker following is specified:

Override WordPress [caption] shortcode.
Attributes:
id (mandatory) - Attachment ID.
width (optional) - Caption area width in pixels.
text (optional) - custom attribute to override standard media caption. The default behavior, if not specified standard media caption will be used.

So u might need to add text attribute to your shortcode.

@r-brown
Copy link
Member

r-brown commented Oct 11, 2019

So, ur example can be rewritten as follows:
[caption id="attachment_1111" align="alignright" width="111" test="MY Caption Text with normal used Wordpress caption function in a post"]<img class="wp-image-1111 size-full" src="https://www.11111111.com/wp-content/uploads/1111111-11111.jpg" alt="111111" width="1111" height="1111" />[/caption]

@Manni79
Copy link
Author

Manni79 commented Oct 12, 2019

Thank you, I tried, but face an issue.

I tried :;
[caption id="attachment_1111" align="alignnone" width="111" text="Test Caption Text"]<img class="wp-image-111size-full" src="https://www.111-111.com/wp-content/uploads/111.jpg" alt="11111" width="1111" height="111" /> test[/caption]

When switch in WP from text to visual. Or when Saving or Preview, WP is strip the text="Test Caption Text" out of the caption shortcode. For me it seems there is a build in WP function which clean the caption code and it is not knowing your text attribute and delete it. It is still working on your side?

@r-brown
Copy link
Member

r-brown commented Oct 12, 2019

Probably WP sanitizes content while switching between content and visual modes.
It will be challenging on our side to change this WP behaviour, as this is definitely out of the scope of Credit Tracker.

@Manni79
Copy link
Author

Manni79 commented Oct 12, 2019

OK. in that case I don't want to bother any longer.

But would be nice to see you taking up on this in the future. So, actually it seems there is no way of using the caption function of wp on "per post" or on "per image usage" style when using credit tracker. So we have no way of adding dynamical caption text beside credit tracker replaced copyright.

And beside "text" attribute is not working, also a better solution would be by not replacing the "inline caption text", but be able to tell credit tracker to add the "inline caption text" beside the copyright.

Or having a list with excludes for pages or images in credit tracker settings.

Or more general and perhaps more simple, don't replace the inline caption text when there are no copyright information filled in the credit tracker attributes of the image. Credit tracker replaces also wp inline caption text, when there are no copyright information filled to in the image settings of specific images.

What do i man with "inline caption text"
The WP way of define caption text for a single image usage. The one you see in the caption shortcode in the my messages before, or here as a screenshot showing wp image caption configuration per image usage:
https://www.dropbox.com/s/0quytytzgghenbr/WP_Image_Caption_per_image_usage.png?dl=0

Some updates would be really great to be able to use some custom captions.

@r-brown
Copy link
Member

r-brown commented Oct 12, 2019

Sure @Manni79 we'll keep this issue open and try to improve here in one of the future releases.

Backup dropbox image
image

@r-brown r-brown changed the title Any chance to show the caption as text and not the copyright place-holder for specific images Show the caption as text and not the copyright place-holder for specific images Oct 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement hacktoberfest Hacktoberfest ready issue
Development

No branches or pull requests

2 participants