admin_url('post-new.php');
The admin_url
function will handle generating most of the link, you just need to give it the final component. You can pass in GET
parameters as well. Just look at the backend URL to see what you need.
admin_url('post-new.php?post_type=page');
Or using add_query_arg
as suggested by @Rarst …
add_query_arg(array('post_type'=>'page'),admin_url('post-new.php'));
It is overkill for simple URLs but useful for dynamic ones.
Related Posts:
- Add confirmation popup on “Move to Trash”
- Getting Whitescreen when publishing a post [closed]
- Edit post & page option does not display on latest wordpress
- How to add a custom class attribute into code wrapper? [duplicate]
- Setting posts_per_page for taxonomy term template
- Change post order random through out the entire WordPress
- Classic editor throws 403 error based on post content
- How to display the link (title) and thumbnail post?
- Force the “Choose from the most used tags” meta box section to always be expanded
- Show the content that is after the excerpt using child theme
- Display Meta Values in Custom Filter – Admin Custom Posts
- How to allow users to post only in certain category and hide elements from edit page?
- How to do set post permalinks using 6 digit random unique function?
- Can’t get buddypress notifications in front-end; why do I get this error?
- Lost draft under all posts and drafts
- How do I display some posts fully on the homepage, and some as an excerpt only?
- How to change the color theme per post?
- Send post id through ajax and get the post content back
- Simultaneous admin updates causes custom fields to not update
- Hook in to add new post link wp admin?
- Display post x of y within category
- Force authors to Preview a post before publishing
- WordPress Automatic Filename Changer
- plugin to post from admin to flickr [closed]
- Highlight static blog page link in header
- Order posts alphabetically: how to set order=asc in mysql query?
- Remove Content after
- Shortcodes on my website stops working after theme update [closed]
- Retrieve only posts from a specific user in wp-admin/edit.php
- Adding an Archive button to posts page for administrators
- Block editors annoying warnings
- Develop Admin Panel Page
- How show categories in admin and get that selected to show posts in index
- Change all author links in Blog roll
- WordPress website loads more posts than expected
- disable Tab post on nav-menus page (Admin)
- Adding bootstrap classes to video shortcodes
- Change post-slug using wordpress API? Change permalink of a post using php / jquery?
- Every second post different class in blog view
- Format latest/newest post differently
- is_page Funtion for Posts ?
- Post type no single page
- Get post meta retrieving wrong value
- Adding a user’s ID behind the tag ref link address
- The_excerpt() doesn’t parse – how to change that?
- Fast publishing in wordpress
- How to only publish posts with image in it
- Which file do I need to edit the All Posts page in the admin area?
- Isn’t the way posts are displayed very unefficient?
- Add custom text automatically on each post
- How to identify and hide/remove an element from a WordPress page [closed]
- How to change the layout of posts when viewing all posts by tag [closed]
- How do you search for a post or page with a certain url on the WordPress admin panel?
- How to check in functions.php if there is data in a WP_Query?
- How to get the old WordPress Draft Editor view back with the Word count?
- restrict incrementation of post vies count when refreshing the page
- Change the color of the Password Protected Post titles
- Defined function isn’t showed on page
- WordPress 302 Redirect to Random Product/Post/Page
- Images showing up in Post Editor, but not in Published Post
- How to create a page that shows the last 10 posts?
- $_GET parametters not working in an specific template
- Bolding several words at once
- Custom Articles page only showing a limited number of posts per page
- Using system date format
- Get post by tag
- Add code to a specific post’s content
- Related Posts function not working
- the_content() Not Grabbing All Content
- Un-highlight Blog Menu Item when Category Menu Item is Selected
- “options.php” not found
- Is it advisable to use $post->comment_count instead of get_comments_number( $post_id )
- Related Posts: Changing Function For Posts Per Page
- How do I link a Post Type to a Template in Masterplan?
- Query function not executed between element [closed]
- Change the background of each post according to the category
- Optimize CPT-function with a loop
- Sort All Posts by Category Name in the Admin Panel?
- saving/reading custom field value does not work – no value gets POSTed
- Same post appears in related Posts?
- List latest posts with least comments in WP-Admin
- Internal linking to posts permalink fail because of spaces and stripe at postname
- Lightbox on wordpress post page
- How do I allow certain users to make a certain type of post?
- Have h2 tag not show up if there are no blog posts
- WordPress as CMS: How to manage/handle images assigned to a post as full-sized background images in a slideshow?
- Making a wordpress page print friendly
- Page of posts made to look like homepage
- Some blog posts containing source code fail to save draft or publish
- Help on conditional statement to accompany wp_insert_post function please?
- How to implement a WordPress comments function?
- How would I got about calling a php file every time someone publishes a new post?
- How to add content above footer in posts from specific category
- Set Default Post as Parent Child (Nested) Relation
- Display a specific category in a focused area of my site
- I need to create “View Profile” and “Edit Profile” links by incorporating the Post Title/ID, but can’t seem to manage it
- WP_Query outputs wrong post in custom post type
- Cannot create new posts or upload images using media manager
- user_has_cap filter allows “edit_others_posts” but not is not allowing updating/publishing
- how to show comments only author which send own posts in wordpress