Ticket #12119: 12119.diff
File 12119.diff, 2.8 KB (added by , 15 years ago) |
---|
-
wp-includes/link-template.php
1732 1732 } 1733 1733 1734 1734 /** 1735 * Retrieve the home url .1735 * Retrieve the home url for the current site. 1736 1736 * 1737 1737 * Returns the 'home' option with the appropriate protocol, 'https' if 1738 1738 * is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is … … 1741 1741 * @package WordPress 1742 1742 * @since 3.0 1743 1743 * 1744 * @uses get_home_url() 1744 1745 * @param string $path (optional) Path relative to the home url. 1745 1746 * @param string $scheme (optional) Scheme to give the home url context. Currently 'http','https' 1746 1747 * @return string Home url link with optional path appended. 1747 1748 */ 1748 1749 function home_url( $path = '', $scheme = null ) { 1750 return get_home_url(null, $path, $scheme); 1751 } 1752 1753 /** 1754 * Retrieve the home url for a given site. 1755 * 1756 * Returns the 'home' option with the appropriate protocol, 'https' if 1757 * is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is 1758 * overridden. 1759 * 1760 * @package WordPress 1761 * @since 3.0 1762 * 1763 * @param int $blog_id (optional) Blog ID. Defaults to current blog. 1764 * @param string $path (optional) Path relative to the home url. 1765 * @param string $scheme (optional) Scheme to give the home url context. Currently 'http','https' 1766 * @return string Home url link with optional path appended. 1767 */ 1768 function get_home_url( $blog_id = null, $path = '', $scheme = null ) { 1749 1769 $orig_scheme = $scheme; 1750 1770 $scheme = is_ssl() && !is_admin() ? 'https' : 'http'; 1751 $url = str_replace( 'http://', "$scheme://", get_option('home') );1752 1771 1772 if ( empty($blog_id) || !is_multisite() ) 1773 $home = get_option('home'); 1774 else 1775 $home = get_blogaddress_by_id($blog_id); 1776 1777 $url = str_replace( 'http://', "$scheme://", $home ); 1778 1753 1779 if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false ) 1754 1780 $url .= '/' . ltrim( $path, '/' ); 1755 1781 1756 return apply_filters( 'home_url', $url, $path, $orig_scheme );1782 return apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id ); 1757 1783 } 1758 1784 1759 1785 /** -
wp-admin/ms-sites.php
82 82 ?> 83 83 <div class="wrap"> 84 84 <?php screen_icon(); ?> 85 <h2><?php _e('Edit Site'); ?> - <a href=' http://<?php echo $details->domain . $details->path; ?>'>http://<?php echo $details->domain . $details->path; ?></a></h2>85 <h2><?php _e('Edit Site'); ?> - <a href='<?php echo get_home_url($id); ?>'><?php echo get_home_url($id); ?></a></h2> 86 86 <form method="post" action="ms-edit.php?action=updateblog"> 87 87 <?php wp_nonce_field('editblog'); ?> 88 88 <input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" />