WordPressを読む 10-22 /blog/wp-includes/functions.php 22
2014/11/29
目次
/blog/wp-includes/functions.php 22
読込元 : /blog/wp-settings.php
読込元 : /blog/wp-load.php
関数
_device_can_upload()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | /** * Test if the current device has the capability to upload files. * * @since 3.4.0 * @access private * * @return bool true|false Whether the device is able to upload files. */ function _device_can_upload() { if ( ! wp_is_mobile() ) return true; $ua = $_SERVER['HTTP_USER_AGENT']; if ( strpos($ua, 'iPhone') !== false || strpos($ua, 'iPad') !== false || strpos($ua, 'iPod') !== false ) { return preg_match( '#OS ([\d_]+) like Mac OS X#', $ua, $version ) && version_compare( $version[1], '6', '>=' ); } return true; } |
関数
wp_is_stream()
1 2 3 4 5 6 7 8 9 10 11 12 | /** * Test if a given path is a stream URL * * @param string $path The resource path or URL. * @return bool True if the path is a stream URL. */ function wp_is_stream( $path ) { $wrappers = stream_get_wrappers(); $wrappers_re = '(' . join('|', $wrappers) . ')'; return preg_match( "!^$wrappers_re://!", $path ) === 1; } |
関数
wp_checkdate()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | /** * Test if the supplied date is valid for the Gregorian calendar. * * @since 3.5.0 * * @see checkdate() * * @param int $month Month number. * @param int $day Day number. * @param int $year Year number. * @param string $source_date The date to filter. * @return bool True if valid date, false if not valid date. */ function wp_checkdate( $month, $day, $year, $source_date ) { /** * Filter whether the given date is valid for the Gregorian calendar. * * @since 3.5.0 * * @param bool $checkdate Whether the given date is valid. * @param string $source_date Date to check. */ return apply_filters( 'wp_checkdate', checkdate( $month, $day, $year ), $source_date ); } |
関数
wp_auth_check_load()
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 | /** * Load the auth check for monitoring whether the user is still logged in. * * Can be disabled with remove_action( 'admin_enqueue_scripts', 'wp_auth_check_load' ); * * This is disabled for certain screens where a login screen could cause an * inconvenient interruption. A filter called wp_auth_check_load can be used * for fine-grained control. * * @since 3.6.0 */ function wp_auth_check_load() { if ( ! is_admin() && ! is_user_logged_in() ) return; if ( defined( 'IFRAME_REQUEST' ) ) return; $screen = get_current_screen(); $hidden = array( 'update', 'update-network', 'update-core', 'update-core-network', 'upgrade', 'upgrade-network', 'network' ); $show = ! in_array( $screen->id, $hidden ); /** * Filter whether to load the authentication check. * * Passing a falsey value to the filter will effectively short-circuit * loading the authentication check. * * @since 3.6.0 * * @param bool $show Whether to load the authentication check. * @param WP_Screen $screen The current screen object. */ if ( apply_filters( 'wp_auth_check_load', $show, $screen ) ) { wp_enqueue_style( 'wp-auth-check' ); wp_enqueue_script( 'wp-auth-check' ); add_action( 'admin_print_footer_scripts', 'wp_auth_check_html', 5 ); add_action( 'wp_print_footer_scripts', 'wp_auth_check_html', 5 ); } } |