Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu...
File: link-template.php
*/
[3500] Fix | Delete
function get_site_url( $blog_id = null, $path = '', $scheme = null ) {
[3501] Fix | Delete
if ( empty( $blog_id ) || ! is_multisite() ) {
[3502] Fix | Delete
$url = get_option( 'siteurl' );
[3503] Fix | Delete
} else {
[3504] Fix | Delete
switch_to_blog( $blog_id );
[3505] Fix | Delete
$url = get_option( 'siteurl' );
[3506] Fix | Delete
restore_current_blog();
[3507] Fix | Delete
}
[3508] Fix | Delete
[3509] Fix | Delete
$url = set_url_scheme( $url, $scheme );
[3510] Fix | Delete
[3511] Fix | Delete
if ( $path && is_string( $path ) ) {
[3512] Fix | Delete
$url .= '/' . ltrim( $path, '/' );
[3513] Fix | Delete
}
[3514] Fix | Delete
[3515] Fix | Delete
/**
[3516] Fix | Delete
* Filters the site URL.
[3517] Fix | Delete
*
[3518] Fix | Delete
* @since 2.7.0
[3519] Fix | Delete
*
[3520] Fix | Delete
* @param string $url The complete site URL including scheme and path.
[3521] Fix | Delete
* @param string $path Path relative to the site URL. Blank string if no path is specified.
[3522] Fix | Delete
* @param string|null $scheme Scheme to give the site URL context. Accepts 'http', 'https', 'login',
[3523] Fix | Delete
* 'login_post', 'admin', 'relative' or null.
[3524] Fix | Delete
* @param int|null $blog_id Site ID, or null for the current site.
[3525] Fix | Delete
*/
[3526] Fix | Delete
return apply_filters( 'site_url', $url, $path, $scheme, $blog_id );
[3527] Fix | Delete
}
[3528] Fix | Delete
[3529] Fix | Delete
/**
[3530] Fix | Delete
* Retrieves the URL to the admin area for the current site.
[3531] Fix | Delete
*
[3532] Fix | Delete
* @since 2.6.0
[3533] Fix | Delete
*
[3534] Fix | Delete
* @param string $path Optional. Path relative to the admin URL. Default empty.
[3535] Fix | Delete
* @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl().
[3536] Fix | Delete
* 'http' or 'https' can be passed to force those schemes.
[3537] Fix | Delete
* @return string Admin URL link with optional path appended.
[3538] Fix | Delete
*/
[3539] Fix | Delete
function admin_url( $path = '', $scheme = 'admin' ) {
[3540] Fix | Delete
return get_admin_url( null, $path, $scheme );
[3541] Fix | Delete
}
[3542] Fix | Delete
[3543] Fix | Delete
/**
[3544] Fix | Delete
* Retrieves the URL to the admin area for a given site.
[3545] Fix | Delete
*
[3546] Fix | Delete
* @since 3.0.0
[3547] Fix | Delete
*
[3548] Fix | Delete
* @param int|null $blog_id Optional. Site ID. Default null (current site).
[3549] Fix | Delete
* @param string $path Optional. Path relative to the admin URL. Default empty.
[3550] Fix | Delete
* @param string $scheme Optional. The scheme to use. Accepts 'http' or 'https',
[3551] Fix | Delete
* to force those schemes. Default 'admin', which obeys
[3552] Fix | Delete
* force_ssl_admin() and is_ssl().
[3553] Fix | Delete
* @return string Admin URL link with optional path appended.
[3554] Fix | Delete
*/
[3555] Fix | Delete
function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) {
[3556] Fix | Delete
$url = get_site_url( $blog_id, 'wp-admin/', $scheme );
[3557] Fix | Delete
[3558] Fix | Delete
if ( $path && is_string( $path ) ) {
[3559] Fix | Delete
$url .= ltrim( $path, '/' );
[3560] Fix | Delete
}
[3561] Fix | Delete
[3562] Fix | Delete
/**
[3563] Fix | Delete
* Filters the admin area URL.
[3564] Fix | Delete
*
[3565] Fix | Delete
* @since 2.8.0
[3566] Fix | Delete
* @since 5.8.0 The `$scheme` parameter was added.
[3567] Fix | Delete
*
[3568] Fix | Delete
* @param string $url The complete admin area URL including scheme and path.
[3569] Fix | Delete
* @param string $path Path relative to the admin area URL. Blank string if no path is specified.
[3570] Fix | Delete
* @param int|null $blog_id Site ID, or null for the current site.
[3571] Fix | Delete
* @param string|null $scheme The scheme to use. Accepts 'http', 'https',
[3572] Fix | Delete
* 'admin', or null. Default 'admin', which obeys force_ssl_admin() and is_ssl().
[3573] Fix | Delete
*/
[3574] Fix | Delete
return apply_filters( 'admin_url', $url, $path, $blog_id, $scheme );
[3575] Fix | Delete
}
[3576] Fix | Delete
[3577] Fix | Delete
/**
[3578] Fix | Delete
* Retrieves the URL to the includes directory.
[3579] Fix | Delete
*
[3580] Fix | Delete
* @since 2.6.0
[3581] Fix | Delete
*
[3582] Fix | Delete
* @param string $path Optional. Path relative to the includes URL. Default empty.
[3583] Fix | Delete
* @param string|null $scheme Optional. Scheme to give the includes URL context. Accepts
[3584] Fix | Delete
* 'http', 'https', or 'relative'. Default null.
[3585] Fix | Delete
* @return string Includes URL link with optional path appended.
[3586] Fix | Delete
*/
[3587] Fix | Delete
function includes_url( $path = '', $scheme = null ) {
[3588] Fix | Delete
$url = site_url( '/' . WPINC . '/', $scheme );
[3589] Fix | Delete
[3590] Fix | Delete
if ( $path && is_string( $path ) ) {
[3591] Fix | Delete
$url .= ltrim( $path, '/' );
[3592] Fix | Delete
}
[3593] Fix | Delete
[3594] Fix | Delete
/**
[3595] Fix | Delete
* Filters the URL to the includes directory.
[3596] Fix | Delete
*
[3597] Fix | Delete
* @since 2.8.0
[3598] Fix | Delete
* @since 5.8.0 The `$scheme` parameter was added.
[3599] Fix | Delete
*
[3600] Fix | Delete
* @param string $url The complete URL to the includes directory including scheme and path.
[3601] Fix | Delete
* @param string $path Path relative to the URL to the wp-includes directory. Blank string
[3602] Fix | Delete
* if no path is specified.
[3603] Fix | Delete
* @param string|null $scheme Scheme to give the includes URL context. Accepts
[3604] Fix | Delete
* 'http', 'https', 'relative', or null. Default null.
[3605] Fix | Delete
*/
[3606] Fix | Delete
return apply_filters( 'includes_url', $url, $path, $scheme );
[3607] Fix | Delete
}
[3608] Fix | Delete
[3609] Fix | Delete
/**
[3610] Fix | Delete
* Retrieves the URL to the content directory.
[3611] Fix | Delete
*
[3612] Fix | Delete
* @since 2.6.0
[3613] Fix | Delete
*
[3614] Fix | Delete
* @param string $path Optional. Path relative to the content URL. Default empty.
[3615] Fix | Delete
* @return string Content URL link with optional path appended.
[3616] Fix | Delete
*/
[3617] Fix | Delete
function content_url( $path = '' ) {
[3618] Fix | Delete
$url = set_url_scheme( WP_CONTENT_URL );
[3619] Fix | Delete
[3620] Fix | Delete
if ( $path && is_string( $path ) ) {
[3621] Fix | Delete
$url .= '/' . ltrim( $path, '/' );
[3622] Fix | Delete
}
[3623] Fix | Delete
[3624] Fix | Delete
/**
[3625] Fix | Delete
* Filters the URL to the content directory.
[3626] Fix | Delete
*
[3627] Fix | Delete
* @since 2.8.0
[3628] Fix | Delete
*
[3629] Fix | Delete
* @param string $url The complete URL to the content directory including scheme and path.
[3630] Fix | Delete
* @param string $path Path relative to the URL to the content directory. Blank string
[3631] Fix | Delete
* if no path is specified.
[3632] Fix | Delete
*/
[3633] Fix | Delete
return apply_filters( 'content_url', $url, $path );
[3634] Fix | Delete
}
[3635] Fix | Delete
[3636] Fix | Delete
/**
[3637] Fix | Delete
* Retrieves a URL within the plugins or mu-plugins directory.
[3638] Fix | Delete
*
[3639] Fix | Delete
* Defaults to the plugins directory URL if no arguments are supplied.
[3640] Fix | Delete
*
[3641] Fix | Delete
* @since 2.6.0
[3642] Fix | Delete
*
[3643] Fix | Delete
* @param string $path Optional. Extra path appended to the end of the URL, including
[3644] Fix | Delete
* the relative directory if $plugin is supplied. Default empty.
[3645] Fix | Delete
* @param string $plugin Optional. A full path to a file inside a plugin or mu-plugin.
[3646] Fix | Delete
* The URL will be relative to its directory. Default empty.
[3647] Fix | Delete
* Typically this is done by passing `__FILE__` as the argument.
[3648] Fix | Delete
* @return string Plugins URL link with optional paths appended.
[3649] Fix | Delete
*/
[3650] Fix | Delete
function plugins_url( $path = '', $plugin = '' ) {
[3651] Fix | Delete
[3652] Fix | Delete
$path = wp_normalize_path( $path );
[3653] Fix | Delete
$plugin = wp_normalize_path( $plugin );
[3654] Fix | Delete
$mu_plugin_dir = wp_normalize_path( WPMU_PLUGIN_DIR );
[3655] Fix | Delete
[3656] Fix | Delete
if ( ! empty( $plugin ) && str_starts_with( $plugin, $mu_plugin_dir ) ) {
[3657] Fix | Delete
$url = WPMU_PLUGIN_URL;
[3658] Fix | Delete
} else {
[3659] Fix | Delete
$url = WP_PLUGIN_URL;
[3660] Fix | Delete
}
[3661] Fix | Delete
[3662] Fix | Delete
$url = set_url_scheme( $url );
[3663] Fix | Delete
[3664] Fix | Delete
if ( ! empty( $plugin ) && is_string( $plugin ) ) {
[3665] Fix | Delete
$folder = dirname( plugin_basename( $plugin ) );
[3666] Fix | Delete
if ( '.' !== $folder ) {
[3667] Fix | Delete
$url .= '/' . ltrim( $folder, '/' );
[3668] Fix | Delete
}
[3669] Fix | Delete
}
[3670] Fix | Delete
[3671] Fix | Delete
if ( $path && is_string( $path ) ) {
[3672] Fix | Delete
$url .= '/' . ltrim( $path, '/' );
[3673] Fix | Delete
}
[3674] Fix | Delete
[3675] Fix | Delete
/**
[3676] Fix | Delete
* Filters the URL to the plugins directory.
[3677] Fix | Delete
*
[3678] Fix | Delete
* @since 2.8.0
[3679] Fix | Delete
*
[3680] Fix | Delete
* @param string $url The complete URL to the plugins directory including scheme and path.
[3681] Fix | Delete
* @param string $path Path relative to the URL to the plugins directory. Blank string
[3682] Fix | Delete
* if no path is specified.
[3683] Fix | Delete
* @param string $plugin The plugin file path to be relative to. Blank string if no plugin
[3684] Fix | Delete
* is specified.
[3685] Fix | Delete
*/
[3686] Fix | Delete
return apply_filters( 'plugins_url', $url, $path, $plugin );
[3687] Fix | Delete
}
[3688] Fix | Delete
[3689] Fix | Delete
/**
[3690] Fix | Delete
* Retrieves the site URL for the current network.
[3691] Fix | Delete
*
[3692] Fix | Delete
* Returns the site URL with the appropriate protocol, 'https' if
[3693] Fix | Delete
* is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is
[3694] Fix | Delete
* overridden.
[3695] Fix | Delete
*
[3696] Fix | Delete
* @since 3.0.0
[3697] Fix | Delete
*
[3698] Fix | Delete
* @see set_url_scheme()
[3699] Fix | Delete
*
[3700] Fix | Delete
* @param string $path Optional. Path relative to the site URL. Default empty.
[3701] Fix | Delete
* @param string|null $scheme Optional. Scheme to give the site URL context. Accepts
[3702] Fix | Delete
* 'http', 'https', or 'relative'. Default null.
[3703] Fix | Delete
* @return string Site URL link with optional path appended.
[3704] Fix | Delete
*/
[3705] Fix | Delete
function network_site_url( $path = '', $scheme = null ) {
[3706] Fix | Delete
if ( ! is_multisite() ) {
[3707] Fix | Delete
return site_url( $path, $scheme );
[3708] Fix | Delete
}
[3709] Fix | Delete
[3710] Fix | Delete
$current_network = get_network();
[3711] Fix | Delete
[3712] Fix | Delete
if ( 'relative' === $scheme ) {
[3713] Fix | Delete
$url = $current_network->path;
[3714] Fix | Delete
} else {
[3715] Fix | Delete
$url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme );
[3716] Fix | Delete
}
[3717] Fix | Delete
[3718] Fix | Delete
if ( $path && is_string( $path ) ) {
[3719] Fix | Delete
$url .= ltrim( $path, '/' );
[3720] Fix | Delete
}
[3721] Fix | Delete
[3722] Fix | Delete
/**
[3723] Fix | Delete
* Filters the network site URL.
[3724] Fix | Delete
*
[3725] Fix | Delete
* @since 3.0.0
[3726] Fix | Delete
*
[3727] Fix | Delete
* @param string $url The complete network site URL including scheme and path.
[3728] Fix | Delete
* @param string $path Path relative to the network site URL. Blank string if
[3729] Fix | Delete
* no path is specified.
[3730] Fix | Delete
* @param string|null $scheme Scheme to give the URL context. Accepts 'http', 'https',
[3731] Fix | Delete
* 'relative' or null.
[3732] Fix | Delete
*/
[3733] Fix | Delete
return apply_filters( 'network_site_url', $url, $path, $scheme );
[3734] Fix | Delete
}
[3735] Fix | Delete
[3736] Fix | Delete
/**
[3737] Fix | Delete
* Retrieves the home URL for the current network.
[3738] Fix | Delete
*
[3739] Fix | Delete
* Returns the home URL with the appropriate protocol, 'https' is_ssl()
[3740] Fix | Delete
* and 'http' otherwise. If `$scheme` is 'http' or 'https', `is_ssl()` is
[3741] Fix | Delete
* overridden.
[3742] Fix | Delete
*
[3743] Fix | Delete
* @since 3.0.0
[3744] Fix | Delete
*
[3745] Fix | Delete
* @param string $path Optional. Path relative to the home URL. Default empty.
[3746] Fix | Delete
* @param string|null $scheme Optional. Scheme to give the home URL context. Accepts
[3747] Fix | Delete
* 'http', 'https', or 'relative'. Default null.
[3748] Fix | Delete
* @return string Home URL link with optional path appended.
[3749] Fix | Delete
*/
[3750] Fix | Delete
function network_home_url( $path = '', $scheme = null ) {
[3751] Fix | Delete
if ( ! is_multisite() ) {
[3752] Fix | Delete
return home_url( $path, $scheme );
[3753] Fix | Delete
}
[3754] Fix | Delete
[3755] Fix | Delete
$current_network = get_network();
[3756] Fix | Delete
$orig_scheme = $scheme;
[3757] Fix | Delete
[3758] Fix | Delete
if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ), true ) ) {
[3759] Fix | Delete
$scheme = is_ssl() ? 'https' : 'http';
[3760] Fix | Delete
}
[3761] Fix | Delete
[3762] Fix | Delete
if ( 'relative' === $scheme ) {
[3763] Fix | Delete
$url = $current_network->path;
[3764] Fix | Delete
} else {
[3765] Fix | Delete
$url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme );
[3766] Fix | Delete
}
[3767] Fix | Delete
[3768] Fix | Delete
if ( $path && is_string( $path ) ) {
[3769] Fix | Delete
$url .= ltrim( $path, '/' );
[3770] Fix | Delete
}
[3771] Fix | Delete
[3772] Fix | Delete
/**
[3773] Fix | Delete
* Filters the network home URL.
[3774] Fix | Delete
*
[3775] Fix | Delete
* @since 3.0.0
[3776] Fix | Delete
*
[3777] Fix | Delete
* @param string $url The complete network home URL including scheme and path.
[3778] Fix | Delete
* @param string $path Path relative to the network home URL. Blank string
[3779] Fix | Delete
* if no path is specified.
[3780] Fix | Delete
* @param string|null $orig_scheme Scheme to give the URL context. Accepts 'http', 'https',
[3781] Fix | Delete
* 'relative' or null.
[3782] Fix | Delete
*/
[3783] Fix | Delete
return apply_filters( 'network_home_url', $url, $path, $orig_scheme );
[3784] Fix | Delete
}
[3785] Fix | Delete
[3786] Fix | Delete
/**
[3787] Fix | Delete
* Retrieves the URL to the admin area for the network.
[3788] Fix | Delete
*
[3789] Fix | Delete
* @since 3.0.0
[3790] Fix | Delete
*
[3791] Fix | Delete
* @param string $path Optional path relative to the admin URL. Default empty.
[3792] Fix | Delete
* @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin()
[3793] Fix | Delete
* and is_ssl(). 'http' or 'https' can be passed to force those schemes.
[3794] Fix | Delete
* @return string Admin URL link with optional path appended.
[3795] Fix | Delete
*/
[3796] Fix | Delete
function network_admin_url( $path = '', $scheme = 'admin' ) {
[3797] Fix | Delete
if ( ! is_multisite() ) {
[3798] Fix | Delete
return admin_url( $path, $scheme );
[3799] Fix | Delete
}
[3800] Fix | Delete
[3801] Fix | Delete
$url = network_site_url( 'wp-admin/network/', $scheme );
[3802] Fix | Delete
[3803] Fix | Delete
if ( $path && is_string( $path ) ) {
[3804] Fix | Delete
$url .= ltrim( $path, '/' );
[3805] Fix | Delete
}
[3806] Fix | Delete
[3807] Fix | Delete
/**
[3808] Fix | Delete
* Filters the network admin URL.
[3809] Fix | Delete
*
[3810] Fix | Delete
* @since 3.0.0
[3811] Fix | Delete
* @since 5.8.0 The `$scheme` parameter was added.
[3812] Fix | Delete
*
[3813] Fix | Delete
* @param string $url The complete network admin URL including scheme and path.
[3814] Fix | Delete
* @param string $path Path relative to the network admin URL. Blank string if
[3815] Fix | Delete
* no path is specified.
[3816] Fix | Delete
* @param string|null $scheme The scheme to use. Accepts 'http', 'https',
[3817] Fix | Delete
* 'admin', or null. Default is 'admin', which obeys force_ssl_admin() and is_ssl().
[3818] Fix | Delete
*/
[3819] Fix | Delete
return apply_filters( 'network_admin_url', $url, $path, $scheme );
[3820] Fix | Delete
}
[3821] Fix | Delete
[3822] Fix | Delete
/**
[3823] Fix | Delete
* Retrieves the URL to the admin area for the current user.
[3824] Fix | Delete
*
[3825] Fix | Delete
* @since 3.0.0
[3826] Fix | Delete
*
[3827] Fix | Delete
* @param string $path Optional. Path relative to the admin URL. Default empty.
[3828] Fix | Delete
* @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin()
[3829] Fix | Delete
* and is_ssl(). 'http' or 'https' can be passed to force those schemes.
[3830] Fix | Delete
* @return string Admin URL link with optional path appended.
[3831] Fix | Delete
*/
[3832] Fix | Delete
function user_admin_url( $path = '', $scheme = 'admin' ) {
[3833] Fix | Delete
$url = network_site_url( 'wp-admin/user/', $scheme );
[3834] Fix | Delete
[3835] Fix | Delete
if ( $path && is_string( $path ) ) {
[3836] Fix | Delete
$url .= ltrim( $path, '/' );
[3837] Fix | Delete
}
[3838] Fix | Delete
[3839] Fix | Delete
/**
[3840] Fix | Delete
* Filters the user admin URL for the current user.
[3841] Fix | Delete
*
[3842] Fix | Delete
* @since 3.1.0
[3843] Fix | Delete
* @since 5.8.0 The `$scheme` parameter was added.
[3844] Fix | Delete
*
[3845] Fix | Delete
* @param string $url The complete URL including scheme and path.
[3846] Fix | Delete
* @param string $path Path relative to the URL. Blank string if
[3847] Fix | Delete
* no path is specified.
[3848] Fix | Delete
* @param string|null $scheme The scheme to use. Accepts 'http', 'https',
[3849] Fix | Delete
* 'admin', or null. Default is 'admin', which obeys force_ssl_admin() and is_ssl().
[3850] Fix | Delete
*/
[3851] Fix | Delete
return apply_filters( 'user_admin_url', $url, $path, $scheme );
[3852] Fix | Delete
}
[3853] Fix | Delete
[3854] Fix | Delete
/**
[3855] Fix | Delete
* Retrieves the URL to the admin area for either the current site or the network depending on context.
[3856] Fix | Delete
*
[3857] Fix | Delete
* @since 3.1.0
[3858] Fix | Delete
*
[3859] Fix | Delete
* @param string $path Optional. Path relative to the admin URL. Default empty.
[3860] Fix | Delete
* @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin()
[3861] Fix | Delete
* and is_ssl(). 'http' or 'https' can be passed to force those schemes.
[3862] Fix | Delete
* @return string Admin URL link with optional path appended.
[3863] Fix | Delete
*/
[3864] Fix | Delete
function self_admin_url( $path = '', $scheme = 'admin' ) {
[3865] Fix | Delete
if ( is_network_admin() ) {
[3866] Fix | Delete
$url = network_admin_url( $path, $scheme );
[3867] Fix | Delete
} elseif ( is_user_admin() ) {
[3868] Fix | Delete
$url = user_admin_url( $path, $scheme );
[3869] Fix | Delete
} else {
[3870] Fix | Delete
$url = admin_url( $path, $scheme );
[3871] Fix | Delete
}
[3872] Fix | Delete
[3873] Fix | Delete
/**
[3874] Fix | Delete
* Filters the admin URL for the current site or network depending on context.
[3875] Fix | Delete
*
[3876] Fix | Delete
* @since 4.9.0
[3877] Fix | Delete
*
[3878] Fix | Delete
* @param string $url The complete URL including scheme and path.
[3879] Fix | Delete
* @param string $path Path relative to the URL. Blank string if no path is specified.
[3880] Fix | Delete
* @param string $scheme The scheme to use.
[3881] Fix | Delete
*/
[3882] Fix | Delete
return apply_filters( 'self_admin_url', $url, $path, $scheme );
[3883] Fix | Delete
}
[3884] Fix | Delete
[3885] Fix | Delete
/**
[3886] Fix | Delete
* Sets the scheme for a URL.
[3887] Fix | Delete
*
[3888] Fix | Delete
* @since 3.4.0
[3889] Fix | Delete
* @since 4.4.0 The 'rest' scheme was added.
[3890] Fix | Delete
*
[3891] Fix | Delete
* @param string $url Absolute URL that includes a scheme
[3892] Fix | Delete
* @param string|null $scheme Optional. Scheme to give $url. Currently 'http', 'https', 'login',
[3893] Fix | Delete
* 'login_post', 'admin', 'relative', 'rest', 'rpc', or null. Default null.
[3894] Fix | Delete
* @return string URL with chosen scheme.
[3895] Fix | Delete
*/
[3896] Fix | Delete
function set_url_scheme( $url, $scheme = null ) {
[3897] Fix | Delete
$orig_scheme = $scheme;
[3898] Fix | Delete
[3899] Fix | Delete
if ( ! $scheme ) {
[3900] Fix | Delete
$scheme = is_ssl() ? 'https' : 'http';
[3901] Fix | Delete
} elseif ( 'admin' === $scheme || 'login' === $scheme || 'login_post' === $scheme || 'rpc' === $scheme ) {
[3902] Fix | Delete
$scheme = is_ssl() || force_ssl_admin() ? 'https' : 'http';
[3903] Fix | Delete
} elseif ( 'http' !== $scheme && 'https' !== $scheme && 'relative' !== $scheme ) {
[3904] Fix | Delete
$scheme = is_ssl() ? 'https' : 'http';
[3905] Fix | Delete
}
[3906] Fix | Delete
[3907] Fix | Delete
$url = trim( $url );
[3908] Fix | Delete
if ( str_starts_with( $url, '//' ) ) {
[3909] Fix | Delete
$url = 'http:' . $url;
[3910] Fix | Delete
}
[3911] Fix | Delete
[3912] Fix | Delete
if ( 'relative' === $scheme ) {
[3913] Fix | Delete
$url = ltrim( preg_replace( '#^\w+://[^/]*#', '', $url ) );
[3914] Fix | Delete
if ( '' !== $url && '/' === $url[0] ) {
[3915] Fix | Delete
$url = '/' . ltrim( $url, "/ \t\n\r\0\x0B" );
[3916] Fix | Delete
}
[3917] Fix | Delete
} else {
[3918] Fix | Delete
$url = preg_replace( '#^\w+://#', $scheme . '://', $url );
[3919] Fix | Delete
}
[3920] Fix | Delete
[3921] Fix | Delete
/**
[3922] Fix | Delete
* Filters the resulting URL after setting the scheme.
[3923] Fix | Delete
*
[3924] Fix | Delete
* @since 3.4.0
[3925] Fix | Delete
*
[3926] Fix | Delete
* @param string $url The complete URL including scheme and path.
[3927] Fix | Delete
* @param string $scheme Scheme applied to the URL. One of 'http', 'https', or 'relative'.
[3928] Fix | Delete
* @param string|null $orig_scheme Scheme requested for the URL. One of 'http', 'https', 'login',
[3929] Fix | Delete
* 'login_post', 'admin', 'relative', 'rest', 'rpc', or null.
[3930] Fix | Delete
*/
[3931] Fix | Delete
return apply_filters( 'set_url_scheme', $url, $scheme, $orig_scheme );
[3932] Fix | Delete
}
[3933] Fix | Delete
[3934] Fix | Delete
/**
[3935] Fix | Delete
* Retrieves the URL to the user's dashboard.
[3936] Fix | Delete
*
[3937] Fix | Delete
* If a user does not belong to any site, the global user dashboard is used. If the user
[3938] Fix | Delete
* belongs to the current site, the dashboard for the current site is returned. If the user
[3939] Fix | Delete
* cannot edit the current site, the dashboard to the user's primary site is returned.
[3940] Fix | Delete
*
[3941] Fix | Delete
* @since 3.1.0
[3942] Fix | Delete
*
[3943] Fix | Delete
* @param int $user_id Optional. User ID. Defaults to current user.
[3944] Fix | Delete
* @param string $path Optional path relative to the dashboard. Use only paths known to
[3945] Fix | Delete
* both site and user admins. Default empty.
[3946] Fix | Delete
* @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin()
[3947] Fix | Delete
* and is_ssl(). 'http' or 'https' can be passed to force those schemes.
[3948] Fix | Delete
* @return string Dashboard URL link with optional path appended.
[3949] Fix | Delete
*/
[3950] Fix | Delete
function get_dashboard_url( $user_id = 0, $path = '', $scheme = 'admin' ) {
[3951] Fix | Delete
$user_id = $user_id ? (int) $user_id : get_current_user_id();
[3952] Fix | Delete
[3953] Fix | Delete
$blogs = get_blogs_of_user( $user_id );
[3954] Fix | Delete
[3955] Fix | Delete
if ( is_multisite() && ! user_can( $user_id, 'manage_network' ) && empty( $blogs ) ) {
[3956] Fix | Delete
$url = user_admin_url( $path, $scheme );
[3957] Fix | Delete
} elseif ( ! is_multisite() ) {
[3958] Fix | Delete
$url = admin_url( $path, $scheme );
[3959] Fix | Delete
} else {
[3960] Fix | Delete
$current_blog = get_current_blog_id();
[3961] Fix | Delete
[3962] Fix | Delete
if ( $current_blog && ( user_can( $user_id, 'manage_network' ) || in_array( $current_blog, array_keys( $blogs ), true ) ) ) {
[3963] Fix | Delete
$url = admin_url( $path, $scheme );
[3964] Fix | Delete
} else {
[3965] Fix | Delete
$active = get_active_blog_for_user( $user_id );
[3966] Fix | Delete
if ( $active ) {
[3967] Fix | Delete
$url = get_admin_url( $active->blog_id, $path, $scheme );
[3968] Fix | Delete
} else {
[3969] Fix | Delete
$url = user_admin_url( $path, $scheme );
[3970] Fix | Delete
}
[3971] Fix | Delete
}
[3972] Fix | Delete
}
[3973] Fix | Delete
[3974] Fix | Delete
/**
[3975] Fix | Delete
* Filters the dashboard URL for a user.
[3976] Fix | Delete
*
[3977] Fix | Delete
* @since 3.1.0
[3978] Fix | Delete
*
[3979] Fix | Delete
* @param string $url The complete URL including scheme and path.
[3980] Fix | Delete
* @param int $user_id The user ID.
[3981] Fix | Delete
* @param string $path Path relative to the URL. Blank string if no path is specified.
[3982] Fix | Delete
* @param string $scheme Scheme to give the URL context. Accepts 'http', 'https', 'login',
[3983] Fix | Delete
* 'login_post', 'admin', 'relative' or null.
[3984] Fix | Delete
*/
[3985] Fix | Delete
return apply_filters( 'user_dashboard_url', $url, $user_id, $path, $scheme );
[3986] Fix | Delete
}
[3987] Fix | Delete
[3988] Fix | Delete
/**
[3989] Fix | Delete
* Retrieves the URL to the user's profile editor.
[3990] Fix | Delete
*
[3991] Fix | Delete
* @since 3.1.0
[3992] Fix | Delete
*
[3993] Fix | Delete
* @param int $user_id Optional. User ID. Defaults to current user.
[3994] Fix | Delete
* @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin()
[3995] Fix | Delete
* and is_ssl(). 'http' or 'https' can be passed to force those schemes.
[3996] Fix | Delete
* @return string Dashboard URL link with optional path appended.
[3997] Fix | Delete
*/
[3998] Fix | Delete
function get_edit_profile_url( $user_id = 0, $scheme = 'admin' ) {
[3999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function