下午好,
我正在练习创建一个WordPress插件,到目前为止,通过安装该插件并通过以下代码将其显示在管理员用户的管理栏中,我已经取得了进展。
if( !defined( 'ABSPATH' ) ) exit;
/**
* Print SEO tags in the header
*
* @return void
*/
function opt_menu_cactaceas() {
?>
<h1>Registrador de Cactaceas</h1>
<p>En el siguiente formulario podra registrar diferentes cactaceas</p>
<p> Formulario 1 </p>
<?php
}
function agregar_a_menu() {
add_menu_page('Pluging Cactaceas', 'Plug. Cactaceas', 'manage_options', 'plugin_cactaceas_link', 'opt_menu_cactaceas');
}
add_action("admin_menu", "agregar_a_menu");
我当前的目标是在加载页面时能够做到这一点(例如,mydomain.com/form-仅一页,并且不会与任何文章相关联),该插件将呈现一个随后记录信息的表单在我已经配置的bd Wordpress的表中。
进行一些测试,我设法找到了“ the_content”挂钩过滤器,通过以下代码,该过滤器允许我呈现HTML标签,但仅在创建的文章中呈现,但我希望HTML标签直接在页面上呈现,因此一无所获。
function wetuts_author_bio( $content ) {
return $content . "<h1>hola diego</h1>";
}
add_filter('the_content', 'wetuts_author_bio');
我的问题是,他们是否知道任何钩子或钩子表,其中与页面呈现相关联的钩子显示给我,因为我找不到任何钩子或钩子表。仅找到“ the_content”的钩子在呈现文章时(进入文章时)开始运行,因此对我没有用。
我希望我的解释不会让我感到头晕,感谢您的支持。问候。