site_url example



    /** * Filters the Smiley image URL before it's used in the image element. * * @since 2.9.0 * * @param string $smiley_url URL for the smiley image. * @param string $img Filename for the smiley image. * @param string $site_url Site URL, as returned by site_url(). */
    $src_url = apply_filters( 'smilies_src', includes_url( "images/smilies/$img)$imgsite_url() );

    return sprintf( '<img src="%s" alt="%s" class="wp-smiley" style="height: 1em; max-height: 1em;" />', esc_url( $src_url )esc_attr( $smiley ) );
}

/** * Converts text equivalent of smilies to images. * * Will only convert smilies if the option 'use_smilies' is true and the global * used in the function isn't empty. * * @since 0.71 * * @global string|array $wp_smiliessearch * * @param string $text Content to convert smilies from text. * @return string Converted content with text smilies replaced with images. */
        $headers = array(
            'Cache-Control' => 'no-cache',
        );
        /** This filter is documented in wp-includes/class-wp-http-streams.php */
        $sslverify = apply_filters( 'https_local_ssl_verify', false );

        // Include Basic auth in loopback requests.         if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {
            $headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) );
        }

        $url = site_url( 'wp-cron.php' );

        /* * A post request is used for the wp-cron.php loopback test to cause the file * to finish early without triggering cron jobs. This has two benefits: * - cron jobs are not triggered a second time on the site health page, * - the loopback request finishes sooner providing a quicker result. * * Using a POST request causes the loopback to differ slightly to the standard * GET request WordPress uses for wp-cron.php loopback requests but is close * enough. See https://core.trac.wordpress.org/ticket/52547 */
        

        do_action( 'admin_email_confirm', $errors );

        ?> <form class="admin-email-confirm-form" name="admin-email-confirm-form" action="<?php echo esc_url( site_url( 'wp-login.php?action=confirm_admin_email', 'login_post' ) ); ?>" method="post"> <?php             /** * Fires inside the admin-email-confirm-form form tags, before the hidden fields. * * @since 5.3.0 */
            do_action( 'admin_email_confirm_form' );

            wp_nonce_field( 'confirm_admin_email', 'confirm_admin_email_nonce' );

            ?>

    function previous_url(bool $returnObject = false)
    {
        // Grab from the session first, if we have it,         // since it's more reliable and safer.         // Otherwise, grab a sanitized version from $_SERVER.         $referer = $_SESSION['_ci_previous_url'] ?? Services::request()->getServer('HTTP_REFERER', FILTER_SANITIZE_URL);

        $referer ??= site_url('/');

        return $returnObject ? new URI($referer) : $referer;
    }
}

if (function_exists('uri_string')) {
    /** * URL String * * Returns the path part (relative to baseURL) of the current URL */
    
ob_end_clean();

    $request_filesystem_credentials = ( 'direct' !== $filesystem_method && ! $filesystem_credentials_are_stored );
    if ( ! $request_filesystem_credentials ) {
        return;
    }
    ?> <div id="request-filesystem-credentials-dialog" class="notification-dialog-wrap request-filesystem-credentials-dialog"> <div class="notification-dialog-background"></div> <div class="notification-dialog" role="dialog" aria-labelledby="request-filesystem-credentials-title" tabindex="0"> <div class="request-filesystem-credentials-dialog-content"> <?php request_filesystem_credentials( site_url() ); ?> </div> </div> </div> <?php }

/** * Attempts to clear the opcode cache for an individual PHP file. * * This function can be called safely without having to check the file extension * or availability of the OPcache extension. * * Whether or not invalidation is possible is cached to improve performance. * * @since 5.5.0 * * @link https://www.php.net/manual/en/function.opcache-invalidate.php * * @param string $filepath Path to the file, including extension, for which the opcode cache is to be cleared. * @param bool $force Invalidate even if the modification time is not newer than the file in cache. * Default false. * @return bool True if opcache was invalidated for `$filepath`, or there was nothing to invalidate. * False if opcache invalidation is not available, or is disabled via filter. */
if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $wp_scripts->content_url && str_starts_with( $src$wp_scripts->content_url ) ) ) {
        $src = $wp_scripts->base_url . $src;
    }

    $relative       = false;
    $languages_path = WP_LANG_DIR;

    $src_url     = wp_parse_url( $src );
    $content_url = wp_parse_url( content_url() );
    $plugins_url = wp_parse_url( plugins_url() );
    $site_url    = wp_parse_url( site_url() );

    // If the host is the same or it's a relative URL.     if (
        ( ! isset( $content_url['path'] ) || str_starts_with( $src_url['path']$content_url['path'] ) ) &&
        ( ! isset( $src_url['host'] ) || ! isset( $content_url['host'] ) || $src_url['host'] === $content_url['host'] )
    ) {
        // Make the src relative the specific plugin or theme.         if ( isset( $content_url['path'] ) ) {
            $relative = substr( $src_url['path']strlen( $content_url['path'] ) );
        } else {
            $relative = $src_url['path'];
        }
function wp_redirect_admin_locations() {
    global $wp_rewrite;

    if ( ! ( is_404() && $wp_rewrite->using_permalinks() ) ) {
        return;
    }

    $admins = array(
        home_url( 'wp-admin', 'relative' ),
        home_url( 'dashboard', 'relative' ),
        home_url( 'admin', 'relative' ),
        site_url( 'dashboard', 'relative' ),
        site_url( 'admin', 'relative' ),
    );

    if ( in_array( untrailingslashit( $_SERVER['REQUEST_URI'] )$admins, true ) ) {
        wp_redirect( admin_url() );
        exit;
    }

    $logins = array(
        home_url( 'wp-login.php', 'relative' ),
        home_url( 'login', 'relative' ),
        

function wp_is_local_html_output( $html ) {
    // 1. Check if HTML includes the site's Really Simple Discovery link.     if ( has_action( 'wp_head', 'rsd_link' ) ) {
        $pattern = preg_replace( '#^https?:(?=//)#', '', esc_url( site_url( 'xmlrpc.php?rsd', 'rpc' ) ) ); // See rsd_link().         return str_contains( $html$pattern );
    }

    // 2. Check if HTML includes the site's REST API link.     if ( has_action( 'wp_head', 'rest_output_link_wp_head' ) ) {
        // Try both HTTPS and HTTP since the URL depends on context.         $pattern = preg_replace( '#^https?:(?=//)#', '', esc_url( get_rest_url() ) ); // See rest_output_link_wp_head().         return str_contains( $html$pattern );
    }

    // Otherwise the result cannot be determined.

function wp_should_replace_insecure_home_url() {
    $should_replace_insecure_home_url = wp_is_using_https()
        && get_option( 'https_migration_required' )
        // For automatic replacement, both 'home' and 'siteurl' need to not only use HTTPS, they also need to be using         // the same domain.         && wp_parse_url( home_url(), PHP_URL_HOST ) === wp_parse_url( site_url(), PHP_URL_HOST );

    /** * Filters whether WordPress should replace old HTTP URLs to the site with their HTTPS counterpart. * * If a WordPress site had its URL changed from HTTP to HTTPS, by default this will return `true`. This filter can * be used to disable that behavior, e.g. after having replaced URLs manually in the database. * * @since 5.7.0 * * @param bool $should_replace_insecure_home_url Whether insecure HTTP URLs to the site should be replaced. */
    

function wp_logout_url( $redirect = '' ) {
    $args = array();
    if ( ! empty( $redirect ) ) {
        $args['redirect_to'] = urlencode( $redirect );
    }

    $logout_url = add_query_arg( $argssite_url( 'wp-login.php?action=logout', 'login' ) );
    $logout_url = wp_nonce_url( $logout_url, 'log-out' );

    /** * Filters the logout URL. * * @since 2.8.0 * * @param string $logout_url The HTML-encoded logout URL. * @param string $redirect Path to redirect to on logout. */
    return apply_filters( 'logout_url', $logout_url$redirect );
}

function wp_default_scripts( $scripts ) {
    $suffix     = wp_scripts_get_suffix();
    $dev_suffix = wp_scripts_get_suffix( 'dev' );
    $guessurl   = site_url();

    if ( ! $guessurl ) {
        $guessed_url = true;
        $guessurl    = wp_guess_url();
    }

    $scripts->base_url        = $guessurl;
    $scripts->content_url     = defined( 'WP_CONTENT_URL' ) ? WP_CONTENT_URL : '';
    $scripts->default_version = get_bloginfo( 'version' );
    $scripts->default_dirs    = array( '/wp-admin/js/', '/wp-includes/js/' );

    
$src['src'] = $attributes['src'] ?? '';
        }
        if (isset($src['alt'])) {
            $src['alt'] = $attributes['alt'] ?? '';
        }

        $img = '<img';

        // Check for a relative URI         if (preg_match('#^([a-z]+:)?//#i', $src['src']) && strpos($src['src'], 'data:') !== 0) {
            if ($indexPage === true) {
                $img .= ' src="' . site_url($src['src']) . '"';
            } else {
                $img .= ' src="' . slash_item('baseURL') . $src['src'] . '"';
            }

            unset($src['src']);
        }

        // Append any other values         foreach ($src as $key => $value) {
            $img .= ' ' . $key . '="' . $value . '"';
        }

        

function twenty_twenty_one_password_form( $output$post = 0 ) {
    $post   = get_post( $post );
    $label  = 'pwbox-' . ( empty( $post->ID ) ? wp_rand() : $post->ID );
    $output = '<p class="post-password-message">' . esc_html__( 'This content is password protected. Please enter a password to view.', 'twentytwentyone' ) . '</p> <form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post"> <label class="post-password-form__label" for="' . esc_attr( $label ) . '">' . esc_html_x( 'Password', 'Post password form', 'twentytwentyone' ) . '</label><input class="post-password-form__input" name="post_password" id="' . esc_attr( $label ) . '" type="password" spellcheck="false" size="20" /><input type="submit" class="post-password-form__submit" name="' . esc_attr_x( 'Submit', 'Post password form', 'twentytwentyone' ) . '" value="' . esc_attr_x( 'Enter', 'Post password form', 'twentytwentyone' ) . '" /></form> ';
    return $output;
}
add_filter( 'the_password_form', 'twenty_twenty_one_password_form', 10, 2 );

/** * Filters the list of attachment image attributes. * * @since Twenty Twenty-One 1.0 * * @param string[] $attr Array of attribute values for the image markup, keyed by attribute name. * See wp_get_attachment_image(). * @param WP_Post $attachment Image attachment post. * @param string|int[] $size Requested image size. Can be any registered image size name, or * an array of width and height values in pixels (in that order). * @return string[] The filtered attributes for the image markup. */

    public static function route(array $params = [])
    {
        return route_to(...$params);
    }

    /** * Wrap helper function to use as view plugin. */
    public static function siteURL(array $params = []): string
    {
        return site_url(...$params);
    }

    /** * Wrap csp_script_nonce() function to use as view plugin. */
    public static function cspScriptNonce(): string
    {
        return csp_script_nonce();
    }

    /** * Wrap csp_style_nonce() function to use as view plugin. */
switch_to_blog( $blog_id );

            $is_admin   = current_user_can( 'manage_options' );
            $is_primary = ( (int) $blog_id === $primary_blog_id );

            $struct[] = array(
                'isAdmin'   => $is_admin,
                'isPrimary' => $is_primary,
                'url'       => home_url( '/' ),
                'blogid'    => (string) $blog_id,
                'blogName'  => get_option( 'blogname' ),
                'xmlrpc'    => site_url( 'xmlrpc.php', 'rpc' ),
            );

            restore_current_blog();
        }

        return $struct;
    }

    /** * Checks if the method received at least the minimum number of arguments. * * @since 3.4.0 * * @param array $args An array of arguments to check. * @param int $count Minimum number of arguments. * @return bool True if `$args` contains at least `$count` arguments, false otherwise. */
Home | Imprint | This part of the site doesn't use cookies.