$value ) { if ( '' !== $value ) { $output[] = $key . '="' . esc_attr( $value ) . '"'; } } return implode( ' ', $output ); } function wp_json_encode( $value, $flags = 0 ) { return json_encode( $value, $flags ); } function safecss_filter_attr( $style ) { ap_record( 'filtered_css', $style ); $safe = array(); foreach ( explode( ';', $style ) as $declaration ) { if ( preg_match( '/^\s*(width|height|color)\s*:\s*([a-z0-9.%# -]+)\s*$/i', $declaration ) ) { $safe[] = trim( $declaration ); } } return implode( ';', $safe ); } function wp_register_script( $handle, $src, $deps, $version, $footer ) { $GLOBALS['ap_test']['scripts'][ $handle ] = compact( 'src', 'deps', 'version', 'footer' ); } function wp_register_style( $handle, $src, $deps, $version ) { $GLOBALS['ap_test']['styles'][ $handle ] = compact( 'src', 'deps', 'version' ); } function wp_add_inline_script( $handle, $source, $position ) { ap_record( 'inline_scripts', compact( 'handle', 'source', 'position' ) ); } function wp_set_script_translations( $handle, $domain, $path ) { ap_record( 'translations', compact( 'handle', 'domain', 'path' ) ); } function register_block_type( $path, $args ) { ap_record( 'blocks', compact( 'path', 'args' ) ); } function wp_enqueue_script( $handle ) { $GLOBALS['ap_test']['enqueued_scripts'][ $handle ] = true; } function wp_enqueue_style( $handle ) { $GLOBALS['ap_test']['enqueued_styles'][ $handle ] = true; } function wp_style_is( $handle, $status ) { return ! empty( $GLOBALS['ap_test'][ 'done' === $status ? 'printed_styles' : 'enqueued_styles' ][ $handle ] ); } function wp_print_styles( $handles ) { foreach ( $handles as $handle ) { $GLOBALS['ap_test']['printed_styles'][ $handle ] = true; ap_record( 'style_print_calls', $handle ); } } function has_shortcode( $content, $tag ) { return false !== strpos( $content, '[' . $tag ); } function has_block( $name, $content ) { return false !== strpos( $content, '