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]
- How to add an admin notice upon post save/update
- How to change the case of all post titles to “Title Case”
- Function to execute when a post is moved to trash .
- Fatal error: Call to undefined function post_exists()
- using slug instead of ID in admin edit post url
- Code to auto expire posts after 30 days
- Post X of Y in single.php / sidebar.php
- Keep a fluid max number of posts on site
- Custom colors for post rows based on post meta value
- How to add an admin function only to posts, not pages?
- How to Display Post View Count
- Remove double space after a period
- How to place HTML below the title of the (custom) post overview
- When paginating a Page with the tag, how can the 2nd and subsequent page styles be customised?
- Convert a complex webpage into WP theme
- Hiding posts in a list from specified categories
- Run a function when post is deleted?
- Checking is user author of number of posts?
- Create cron job without a plugin?
- Diplay comment date on WP_Post_Comments_List_Table
- Change default Posts page
- How to rename “Publish” metabox title in post screen
- Animated gif for a thumbs
- Add icon/badge next to posttitle of specific category
- Converting a dynamic piece of code using WordPress Loop into a static one using Post ID
- I am unable to publish/update post
- Disable inline_edit() on edit.php
- Why aren’t my posts/pages showing up in my WordPress Theme?
- Show the content that is after the excerpt using child theme
- How to allow users to post only in certain category and hide elements from edit page?
- How do I display some posts fully on the homepage, and some as an excerpt only?
- Force authors to Preview a post before publishing
- Order posts alphabetically: how to set order=asc in mysql query?
- Shortcodes on my website stops working after theme update [closed]
- Develop Admin Panel Page
- WordPress website loads more posts than expected
- Post type no single page
- Adding a user’s ID behind the tag ref link address
- Which file do I need to edit the All Posts page in the admin area?
- Isn’t the way posts are displayed very unefficient?
- 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?
- restrict incrementation of post vies count when refreshing the page
- Change the color of the Password Protected Post titles
- How to create a page that shows the last 10 posts?
- $_GET parametters not working in an specific template
- Bolding several words at once
- Get post by tag
- Related Posts function not working
- the_content() Not Grabbing All Content
- Query function not executed between element [closed]
- saving/reading custom field value does not work – no value gets POSTed
- 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?
- Display a specific category in a focused area of my site
- Cannot create new posts or upload images using media manager
- How to put the author of the post in the comments?
- Check if almost 10 year old – working code is up to date
- the wp_post_update isn’t working all the time
- Remove pagination if search returns empty
- Remove status ‘archived’ from the default post and page view
- Remove HTML tags from all posts
- Redirecting to “All Posts” after post publish or update
- Save All Post Permalink From A Specific Category into a .txt file
- How to delete/customize imported demo content from a theme or add my own?
- How to Display Most View Post in the template file?
- Set featured image on creating new post
- Show post excerpt
- How do I apply a wordpress function to something with no ID inside an archive page?
- Show author bio box
- Display author bio box
- Check if user has avatar
- Can the_post_navigation() be outside of the loop?
- How can I filter the post of a CPT by taxonomy Term in admin meta-box dropdown?
- How to enable comments meta box for other author posts?
- Post preview in iframe without saving the post
- Call image from post on index page?
- How do I get thumbnails?
- Run function after post is updated
- Latest Posts not in the right order
- When Author add new post change default status to pending
- fire action when post is being edited as well as saved?
- Getting rid of the blog page entirely
- List direct children of page
- Notify Author of the post if admin deletes his post and perform some function
- Permalink remain the same on each page
- Enqueue CSS on custom posts’ backend area
- What does WordPress mean by they have full rights to content [closed]
- Password protection doesn’t prompt for password on pages
- Get posts after calculating meta key
- Post Format Status [closed]
- How to remove a date from wordpress post
- wordpress pinboard theme [closed]
- Display posts with id equal to relationship value
- How to sort posts alphabetically based on a specific parent category