Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the prompt box of publishing right to copy the content of articles

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article is to share with you about how to copy the content of the article pop-up publishing rights prompt box. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.

Code one

A prompt box for beautification through SweetAlert

Add the following code to the end of the current theme template function functions.php file:

Function zm_copyright_tips () {echo'; echo'; echo 'document.body.oncopy = function () {swal ("copy successfully!", "be sure to keep the original link and state the source, thank you for your cooperation!", "success");};} add_action (' wp_footer', 'zm_copyright_tips', 100)

The effect is as shown in the figure:

Code 2:

Simple prompt box

If you think loading JS and CSS will affect the speed, you can also directly use the following code to call the browser's own prompt box, using the same method as above:

Function zm_copyright_tips () {echo 'document.body.oncopy=function () {alert ("copy successfully! please be sure to keep the original link, state the source, thank you for your cooperation!");}';} add_action ('wp_footer',' zm_copyright_tips', 100)

The effect is as shown in the figure:

The above code is directly called by the public library outside the chain, and the JS and CSS of the outer chain can also be downloaded locally to further beautify and modify the style.

Thank you for reading! On how to copy the content of the article pop-up publishing rights prompt box to share here, I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report