Dorokhov.codes

05. Functions by categories

/**
 * 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' );