rebase on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:23:21 -04:00
parent d37566ffb6
commit d096058d7d
4789 changed files with 254611 additions and 307223 deletions

View File

@@ -36,33 +36,25 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Article' ) ) {
$schema['mainEntityOfPage']['@id'] = esc_url( $data['main-entity'] );
}
if ( isset( $data['name'] ) && ! empty( $data['name'] ) ) {
$schema['headline'] = wp_strip_all_tags( $data['name'] );
}
$schema['headline'] = ! empty( $data['name'] ) ? wp_strip_all_tags( (string)$data['name'] ) : NULL;
if ( isset( $data['image'] ) && ! empty( $data['image'] ) ) {
$schema['image'] = BSF_AIOSRS_Pro_Schema_Template::get_image_schema( $data['image'] );
}
if ( isset( $data['published-date'] ) && ! empty( $data['published-date'] ) ) {
$schema['datePublished'] = wp_strip_all_tags( $data['published-date'] );
}
$schema['datePublished'] = ! empty( $data['published-date'] ) ? wp_strip_all_tags( (string)$data['published-date'] ) : NULL;
if ( isset( $data['modified-date'] ) && ! empty( $data['modified-date'] ) ) {
$schema['dateModified'] = wp_strip_all_tags( $data['modified-date'] );
}
$schema['dateModified'] = ! empty( $data['modified-date'] ) ? wp_strip_all_tags( (string)$data['modified-date'] ) : NULL;
if ( isset( $data['author'] ) && ! empty( $data['author'] ) ) {
if ( ! empty( $data['author'] ) ) {
$schema['author']['@type'] = 'Person';
$schema['author']['name'] = wp_strip_all_tags( $data['author'] );
if ( isset( $data['author-url'] ) && ! empty( $data['author-url'] ) ) {
$schema['author']['url'] = wp_strip_all_tags( $data['author-url'] );
}
$schema['author']['name'] = wp_strip_all_tags( (string)$data['author'] );
$schema['author']['url'] = ! empty( $data['author-url'] ) ? wp_strip_all_tags( (string)$data['author-url'] ) : NULL;
}
if ( isset( $data['orgnization-name'] ) && ! empty( $data['orgnization-name'] ) ) {
if ( ! empty( $data['orgnization-name'] ) ) {
$schema['publisher']['@type'] = 'Organization';
$schema['publisher']['name'] = wp_strip_all_tags( $data['orgnization-name'] );
$schema['publisher']['name'] = wp_strip_all_tags( (string)$data['orgnization-name'] );
}
if ( isset( $data['site-logo'] ) && ! empty( $data['site-logo'] ) ) {
@@ -88,9 +80,7 @@ if ( ! class_exists( 'BSF_AIOSRS_Pro_Schema_Article' ) ) {
}
}
if ( isset( $data['description'] ) && ! empty( $data['description'] ) ) {
$schema['description'] = wp_strip_all_tags( $data['description'] );
}
$schema['description'] = ! empty( $data['description'] ) ? wp_strip_all_tags( (string)$data['description'] ) : NULL;
return apply_filters( 'wp_schema_pro_schema_article', $schema, $data, $post );
}