arrow_back
Back

WordPress core functions reference: URLs, posts, and helpers

Andrew Dorokhov Andrew Dorokhov schedule 1 min read
menu_book Table of Contents
/**
 * Retrieves the URL to the admin area for the current site:
 * Output example: "http://localhost:8001/wp-admin/"
 */
admin_url();

/**
 * Output example: "http://localhost:8001/wp-admin/post.php"
 */
admin_url( 'post.php' );

/**
 * Build a URL.
 * Result: "https://example.com?key=value"
 */
add_query_arg( 'key', 'value', 'https://example.com' );

/**
 * Result: "https://example.com?key1=value1&key2=value2"
 */
add_query_arg( [
    'key1' => 'value1',
    'key2' => 'value2',
], 'https://example.com' );
code

Need Help with Development?

Happy to help — reach out via the contacts or go straight to my Upwork profile.

work View Upwork Profile arrow_forward
Next Article

WordPress coding standards: PHP, JavaScript, HTML, and CSS

arrow_forward