Retrieve Path of admin.php

Is there a better way of retrieving the path of admin.php and the url of wp-admin.css?

What I can think of is:

$adminphppath = ABSPATH . '\wp-admin\admin.php';
$admincssurl = get_bloginfo('wpurl') . '/wp-admin/css/wp-admin.css";

But, some may be changing the admin path for security. So I need a more reliable way.

[Edit] I need the system path for admin.php, not url. Because I need to include it.

2 Answers
2

You can use admin_url() function for wp-admin.css file and ABSPATH for admin.php.

$admin_php_path = ABSPATH . '/wp-admin/admin.php';
$admin_css_url = admin_url( 'css/wp-admin.css' );

Leave a Comment