简体   繁体   English

自定义WordPress插件不带任何URL

[英]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页的原因

  • Path is not exist anymore or updated 路径已不存在或已更新
  • User doesn't have permission to see that content (Editor and Subscriber) 用户无权查看该内容(编辑者和订阅者)
  • custom redirect in function.php 在function.php中的自定义重定向

Solution: 解:

  • Update Paramlinks (Settings->paramlinks->Select url ->save changes) 更新参数链接(设置->参数链接->选择网址->保存更改)
  • 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.

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