関数 wp_die()
2014/12/05
定義ファイル :/blog/wp-includes/functions.php 12
wp_die()
エラーメッセージを表示する
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 44 45 46 47 | /** * Kill WordPress execution and display HTML message with error message. * * This function complements the die() PHP function. The difference is that * HTML will be displayed to the user. It is recommended to use this function * only, when the execution should not continue any further. It is not * recommended to call this function very often and try to handle as many errors * as possible silently. * * @since 2.0.4 * * @param string $message Optional. Error message. Default empty. * @param string $title Optional. Error title. Default empty. * @param string|array $args Optional. Arguments to control behavior. Default empty array. */ function wp_die( $message = '', $title = '', $args = array() ) { if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { /** * Filter callback for killing WordPress execution for AJAX requests. * * @since 3.4.0 * * @param callback $function Callback function name. */ $function = apply_filters( 'wp_die_ajax_handler', '_ajax_wp_die_handler' ); } elseif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) { /** * Filter callback for killing WordPress execution for XML-RPC requests. * * @since 3.4.0 * * @param callback $function Callback function name. */ $function = apply_filters( 'wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler' ); } else { /** * Filter callback for killing WordPress execution for all non-AJAX, non-XML-RPC requests. * * @since 3.0.0 * * @param callback $function Callback function name. */ $function = apply_filters( 'wp_die_handler', '_default_wp_die_handler' ); } call_user_func( $function, $message, $title, $args ); } |