[英]Custom WordPress plugin not taking any URL
I have created my own plugin.I have created add user form, show user listing, but when I give EDIT link to user, it's not working. 我创建了自己的插件,创建了添加用户表单,显示用户列表,但是当我给用户提供EDIT链接时,它不起作用。 It says page not found.
它说找不到页面。
<a href="dashbid-events.php" style="color:blue;">Edit | <a href="#" id="eventdelete_<?php echo $row['id'];?>" onclick="delete_event(this.id)" style="color: blue;">Delete</a>
Reason for 404 Page Not Found 找不到404页的原因
Solution: 解:
While develop plugin must use constant instead of static path 虽然开发插件必须使用常量而不是静态路径
plugin_dir_url( __FILE__ ) . 'assets/foo-styles.css'
This plugin_dir_url( __FILE__ )
function gives you full path upto plugin direcoty 这个
plugin_dir_url( __FILE__ )
函数为您提供了完整的路径,直至插件目录
Return URL 返回网址
<host>/wp-content/plugins/example_plugin
在href
属性中为dashbid-events.php
文件提供完整的URL,而不是相对路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.