$value ) { $schema['recipeIngredient'][ $key ] = wp_strip_all_tags( $value ); } } if ( isset( $data['recipe-instructions'] ) && ! empty( $data['recipe-instructions'] ) ) { foreach ( $data['recipe-instructions'] as $key => $value ) { if ( isset( $value['steps'] ) && ! empty( $value['steps'] ) ) { $schema['recipeInstructions'][ $key ]['@type'] = 'HowToStep'; $schema['recipeInstructions'][ $key ]['text'] = wp_strip_all_tags( $value['steps'] ); if ( isset( $value['name'] ) && ! empty( $value['name'] ) ) { $schema['recipeInstructions'][ $key ]['name'] = wp_strip_all_tags( $value['name'] ); } if ( isset( $value['url'] ) && ! empty( $value['url'] ) ) { $schema['recipeInstructions'][ $key ]['url'] = wp_strip_all_tags( $value['url'] ); } if ( isset( $value['image'] ) && ! empty( $value['image'] ) ) { $schema['recipeInstructions'][ $key ]['image'] = BSF_AIOSRS_Pro_Schema_Template::get_image_schema( $value['image'], 'URL' ); } } } } if ( isset( $data['recipe-video'] ) && ! empty( $data['recipe-video'] ) ) { foreach ( $data['recipe-video'] as $key => $value ) { if ( isset( $value['video-name'] ) && ! empty( $value['video-name'] ) ) { $schema['video'][ $key ]['@type'] = 'VideoObject'; if ( isset( $value['video-name'] ) && ! empty( $value['video-name'] ) ) { $schema['video'][ $key ]['name'] = wp_strip_all_tags( $value['video-name'] ); } if ( isset( $value['video-desc'] ) && ! empty( $value['video-desc'] ) ) { $schema['video'][ $key ]['description'] = wp_strip_all_tags( $value['video-desc'] ); } if ( isset( $value['video-image'] ) && ! empty( $value['video-image'] ) ) { $schema['video'][ $key ]['thumbnailUrl'] = BSF_AIOSRS_Pro_Schema_Template::get_image_schema( $value['video-image'], 'URL' ); } if ( isset( $value['recipe-video-content-url'] ) && ! empty( $value['recipe-video-content-url'] ) ) { $schema['video'][ $key ]['contentUrl'] = esc_url( $value['recipe-video-content-url'] ); } if ( isset( $value['recipe-video-embed-url'] ) && ! empty( $value['recipe-video-embed-url'] ) ) { $schema['video'][ $key ]['embedUrl'] = esc_url( $value['recipe-video-embed-url'] ); } if ( isset( $value['recipe-video-duration'] ) && ! empty( $value['recipe-video-duration'] ) ) { $schema['video'][ $key ]['duration'] = wp_strip_all_tags( $value['recipe-video-duration'] ); } if ( isset( $value['recipe-video-upload-date'] ) && ! empty( $value['recipe-video-upload-date'] ) ) { $schema['video'][ $key ]['uploadDate'] = wp_strip_all_tags( $value['recipe-video-upload-date'] ); } if ( isset( $value['recipe-video-interaction-count'] ) && ! empty( $value['recipe-video-interaction-count'] ) ) { $schema['video'][ $key ]['interactionCount'] = wp_strip_all_tags( $value['recipe-video-interaction-count'] ); } if ( isset( $value['recipe-video-expires-date'] ) && ! empty( $value['recipe-video-expires-date'] ) ) { $schema['video'][ $key ]['expires'] = wp_strip_all_tags( $value['recipe-video-expires-date'] ); } } } } return apply_filters( 'wp_schema_pro_schema_recipe', $schema, $data, $post ); } } }