admin_url
Filters the admin area URL.
Использование
add_filter( 'admin_url', 'wp_kama_admin_url_filter', 10, 4 ); /** * Function for `admin_url` filter-hook. * * @param string $url The complete admin area URL including scheme and path. * @param string $path Path relative to the admin area URL. Blank string if no path is specified. * @param int|null $blog_id Site ID, or null for the current site. * @param string|null $scheme The scheme to use. Accepts 'http', 'https', 'admin', or null. * * @return string */ function wp_kama_admin_url_filter( $url, $path, $blog_id, $scheme ){ // filter... return $url; }
- $url(строка)
- The complete admin area URL including scheme and path.
- $path(строка)
- Path relative to the admin area URL. Blank string if no path is specified.
- $blog_id(int|null)
- Site ID, or null for the current site.
- $scheme(строка|null)
- The scheme to use. Accepts 'http', 'https', 'admin', or null.
По умолчанию: 'admin', which obeys force_ssl_admin() and is_ssl()
Список изменений
С версии 2.8.0 | Введена. |
С версии 5.8.0 | The $scheme parameter was added. |
Где вызывается хук
admin_url
wp-includes/link-template.php 3599
return apply_filters( 'admin_url', $url, $path, $blog_id, $scheme );