$value ) {
if ( ! in_array( $attribute, $omit, true ) && ! empty( $value ) ) {
return true;
}
}
return false;
}
/**
* Adds email schema attributes.
*
* @param array $attr Array containing the email block attributes.
* @param string $content String containing the email block content.
*
* @return string
*/
public static function render_email( $attr, $content ) {
$content = self::has_attributes( $attr, array( 'className' ) ) ?
str_replace( 'href="mailto:', 'itemprop="email" href="mailto:', $content ) :
'';
return $content;
}
/**
* Adds phone schema attributes. Also wraps the tel link in a span so that
* it's recognized as a telephone number in Google's Structured Data.
*
* @param array $attr Array containing the phone block attributes.
* @param string $content String containing the phone block content.
*
* @return string
*/
public static function render_phone( $attr, $content ) {
if ( self::has_attributes( $attr, array( 'className' ) ) ) {
return str_replace(
array( '