最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Modify Url for Edit Post Screen in Custom Post Type

matteradmin6PV0评论

Ive looked at the questions that may have already answered what im needing and came up short...Im modifying a plugin and the custom post-type name shows in the url when adding a new post.

But..when I edit a post, the url shows up like this: /wp-admin/post.php?post=2059&action=edit

With 2059 being the post ID. What I would like is when editing the post for the url to contain the custom post-type name also.

So instead of above, it would show something like: /wp-admin/admin.php?page=custom_pt_name&post=2059&action=edit or /wp-admin/admin.php?post_type=custom_pt_name&post=2059&action=edit

I appreciate the help

Ive looked at the questions that may have already answered what im needing and came up short...Im modifying a plugin and the custom post-type name shows in the url when adding a new post.

But..when I edit a post, the url shows up like this: /wp-admin/post.php?post=2059&action=edit

With 2059 being the post ID. What I would like is when editing the post for the url to contain the custom post-type name also.

So instead of above, it would show something like: /wp-admin/admin.php?page=custom_pt_name&post=2059&action=edit or /wp-admin/admin.php?post_type=custom_pt_name&post=2059&action=edit

I appreciate the help

Share Improve this question asked Apr 11, 2019 at 23:37 captainMcaptainM 217 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You cannot do this without modifying WordPress core files.

Post a comment

comment list (0)

  1. No comments so far