WordPressを読む 10-23 /blog/wp-includes/functions.php 23
2014/11/29
目次
/blog/wp-includes/functions.php 23
読込元 : /blog/wp-settings.php
読込元 : /blog/wp-load.php
関数
wp_auth_check_html()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | /** * Output the HTML that shows the wp-login dialog when the user is no longer logged in. * * @since 3.6.0 */ function wp_auth_check_html() { $login_url = wp_login_url(); $current_domain = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST']; $same_domain = ( strpos( $login_url, $current_domain ) === 0 ); /** * Filter whether the authentication check originated at the same domain. * * @since 3.6.0 * * @param bool $same_domain Whether the authentication check originated at the same domain. */ $same_domain = apply_filters( 'wp_auth_check_same_domain', $same_domain ); $wrap_class = $same_domain ? 'hidden' : 'hidden fallback'; ?> <div id="wp-auth-check-wrap" class="<?php echo $wrap_class; ?>"> <div id="wp-auth-check-bg"></div> <div id="wp-auth-check"> <div class="wp-auth-check-close" tabindex="0" title="<?php esc_attr_e('Close'); ?>"></div> <?php if ( $same_domain ) { ?> <div id="wp-auth-check-form" data-src="<?php echo esc_url( add_query_arg( array( 'interim-login' => 1 ), $login_url ) ); ?>"></div> <?php } ?> <div class="wp-auth-fallback"> <p><b class="wp-auth-fallback-expired" tabindex="0"><?php _e('Session expired'); ?></b></p> <p><a href="<?php echo esc_url( $login_url ); ?>" target="_blank"><?php _e('Please log in again.'); ?></a> <?php _e('The login page will open in a new window. After logging in you can close it and return to this page.'); ?></p> </div> </div> </div> <?php } |
関数
wp_auth_check()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | /** * Check whether a user is still logged in, for the heartbeat. * * Send a result that shows a log-in box if the user is no longer logged in, * or if their cookie is within the grace period. * * @since 3.6.0 * * @param array|object $response The Heartbeat response object or array. * @return array|object $response The Heartbeat response object or array with 'wp-auth-check' * value set. */ function wp_auth_check( $response ) { $response['wp-auth-check'] = is_user_logged_in() && empty( $GLOBALS['login_grace_period'] ); return $response; } |
関数
get_tag_regex()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | /** * Return RegEx body to liberally match an opening HTML tag. * * Matches an opening HTML tag that: * 1. Is self-closing or * 2. Has no body but has a closing tag of the same name or * 3. Contains a body and a closing tag of the same name * * Note: this RegEx does not balance inner tags and does not attempt * to produce valid HTML * * @since 3.6.0 * * @param string $tag An HTML tag name. Example: 'video'. * @return string Tag RegEx. */ function get_tag_regex( $tag ) { if ( empty( $tag ) ) return; return sprintf( '<?php1$s[^<]*(?:>[\s\S]*<\/%1$s>|\s*\/>)', tag_escape( $tag ) ); } |
関数
_canonical_charset()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | /** * Retrieve a canonical form of the provided charset appropriate for passing to PHP * functions such as htmlspecialchars() and charset html attributes. * * @since 3.6.0 * @access private * * @see http://core.trac.wordpress.org/ticket/23688 * * @param string $charset A charset name. * @return string The canonical form of the charset. */ function _canonical_charset( $charset ) { if ( 'UTF-8' === $charset || 'utf-8' === $charset || 'utf8' === $charset || 'UTF8' === $charset ) return 'UTF-8'; if ( 'ISO-8859-1' === $charset || 'iso-8859-1' === $charset || 'iso8859-1' === $charset || 'ISO8859-1' === $charset ) return 'ISO-8859-1'; return $charset; } |