| 开发者 | jashjacob |
|---|---|
| 更新时间 | 2026年8月29日 16:14 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[credits link="https://example.com"]Source Name[/credits]
Via attribution:
[credits link="https://example.com" type="via"]Via Name[/credits]
With a name attribute (instead of wrapped text):
[credits name="TechZei" link="https://example.com"]
Full set of attributes:
name — the attribution name to display. Defaults to the shortcode's inner content.link — the URL the credit links to (escaped with esc_url()).source — an optional secondary label shown alongside the name.type — source or via badge prefix.badge_color, link_color, link_text_color — hex color overrides for the accent styling.[credits link="https://example.com" type="source" badge_color="#0073aa" link_color="#f0f0f0" link_text_color="#0073aa"]Source Name[/credits]
Block Usage
/credits to insert the Credits Link block (credits/shortcode)..zip file..zip, or upload the extracted credits-shortcode folder to your /wp-content/plugins/ directory via FTP/SFTP.Yes. Use the Accent Color Settings in the block sidebar, the color attributes on the shortcode, or override the CSS classes (.cre_cate, .cre_cate_link) in Appearance > Customize > Additional CSS. The plugin enqueues minimal default styles that are easy to override.
Yes. Insert multiple blocks or shortcodes anywhere in a post or page — each one renders its own independent credit line, so you can list several sources.
Shortcode output stops being rendered, so existing [credits] tags will appear as plain text inside your post content. Your posts are not modified; simply re-activate the plugin to restore the rendered credit lines.
Per-instance colors can be set with the badge_color, link_color, and link_text_color attributes (hex values) or via the block sidebar color pickers. Site-wide defaults can be overridden with custom CSS targeting the same classes.
No, links use standard anchor markup with escaped URLs. If you need nofollow for SEO reasons, you can filter the output with your own markup filter or use a third-party link-management plugin; the credit line is plain HTML so any standard link-filtering plugin will apply to it.
credits-shortcode text domain; translators welcome.block.json metadata with apiVersion 3.esc_url_raw, sanitize_text_field, sanitize_key, sanitize_hex_color).esc_url() for href, esc_html() for text, esc_attr( safecss_filter_attr() ) for inline CSS.wp_kses().credits/shortcode).