简体   繁体   English

如何使Wordpress插件与帖子和页面互动

[英]How to make a wordpress plugin interact with posts & pages

I started to really sit down and learn PHP about a week ago, so I'm a tad new at this. 大约一周前,我开始真正坐下来学习PHP,因此在这方面我是一个新手。 Anyways I'm trying to figure out how I can make my WordPress plugin interact with posts & pages. 无论如何,我试图弄清楚如何使我的WordPress插件与帖子和页面进行交互。

Essentially I am defining a keyword & then making that keyword a hyperlink. 本质上,我先定义一个关键字,然后使该关键字成为超链接。 I know there are other plugins out there that already do this, but I'm not sure how they actually get the content from the PHP file to edit the posts & pages. 我知道那里已经有其他插件可以执行此操作,但是我不确定它们实际上如何从PHP文件中获取内容来编辑帖子和页面。

Any help on how to do this would be much appreciated, thanks! 感谢您提供有关如何执行此操作的任何帮助,谢谢!

You need to identify what WP hook you need, depending on what you want to do and when you want to do it. 您需要根据需要执行的操作以及执行操作的时间来确定所需的WP挂钩 Then attach a function that does what you need. 然后附加一个可以满足您需求的功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM