PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.5.2
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.5.2
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / vendor / team-updraft / lib-onboarding-wizard / Wizard / Onboarding / src / utils / Hyperlink.js

Hyperlink.js in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 4.5.2, at vendor/team-updraft/lib-onboarding-wizard/Wizard/Onboarding/src/utils/Hyperlink.js

35 lines 964 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 *
3 * We can't replace hyperlinks into text with sprintf or with replace() because you will get encoded HTML in the output.
4 * This function is a workaround to allow us to have strings with hyperlinks in them, so the translatability is improved.
5 */
6 const Hyperlink = ({className, text, target, url, rel}) => {
7 let label_pre = '';
8 let label_post = '';
9 let link_text = '';
10 if (text.indexOf('%s') !== -1) {
11 let parts = text.split(/%s/);
12 label_pre = parts[0];
13 link_text = parts[1];
14 label_post = parts[2];
15 } else {
16 link_text = text;
17 }
18 className = className ? className : 'teamupdraft-link';
19
20 return (
21 <>
22 {label_pre}
23 <a
24 className={className}
25 target={target}
26 rel={rel}
27 href={url}>
28 {link_text}
29 </a>
30 {label_post}
31 </>
32 );
33 }
34 export default Hyperlink;
35