-
-
Save hellofromtonya/63e402fac8210db79a23c1d9bcd5e2f3 to your computer and use it in GitHub Desktop.
setup_common_wp_stubs()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Setup the stubs for the common WordPress escaping and internationalization functions. | |
*/ | |
protected function setup_common_wp_stubs() { | |
// Common escaping functions. | |
Monkey\Functions\stubs( array( | |
'esc_attr', | |
'esc_html', | |
'esc_textarea', | |
'esc_url', | |
'wp_kses_post', | |
) ); | |
// Common internationalization functions. | |
Monkey\Functions\stubs( array( | |
'__', | |
'esc_html__', | |
'esc_html_x', | |
'esc_attr_x', | |
) ); | |
foreach ( array( 'esc_attr_e', 'esc_html_e', '_e' ) as $wp_function ) { | |
Monkey\Functions\when( $wp_function )->echoArg(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment