/
No results found. Try again with different words?
Search must be at least 3 characters.
- How to Add an Extra Field for a Particular Schema Type in Schema Pro?
- How to enable/disable schema markup from post/page?
- How to Add Ratings using Shortcode in Schema Pro?
- How to disable a specific schema markup from post/page?
- How to Add Schema Markup on Subcategories
- How to Disable the White Label Settings Permanently?
- How to Disable Corporate Contact Schema?
- How to Remove Home List Item from Breadcrumblist Schema?
- How to Remove Shop Item Link from BreadcrumbList Schema on Product Page?
- How to Test a Schema Snippet?
- Mapping Your Schema Fields in Schema Pro
- How to Add an Extra Field for a Particular Schema Type in Schema Pro?
- How to Use the Schema Pro plugin?
- What is the All-in-one Schema Pro plugin?
- How to map required fields with Custom Fields?
- How to create a Custom Fields using Schema Pro?
- How to target specific areas of the website?
- How to enable/disable schema markup from post/page?
- How to Add Ratings using Shortcode in Schema Pro?
- How to implement Breadcrumbs with Schema Pro?
- Disable Schema Markup on AMP Pages/Posts for Reader Mode
- Plugin Settings for Schema Pro
- Restrict Schema Pro Settings for Specific User Roles
- How to Remove Home List Item from Breadcrumblist Schema?
- How to Delete Schema Data?
- Regenerate Schema
- How to Configure Schema on a Single Page/Post?
- Skip Rendering Invalid Schema
- How to Handle Errors & Warnings in a Testing Tool?
- How To Configure WooCommerce With Schema Pro?
- Bringing Repeater Fields Controls on Pages/Posts
- Adding WooCommerce Review Field Schema Markup
- Add Custom Schema Markup With Schema Pro
- Compatibility with External plugins
- How to Rollback a Schema Pro Plugin to the Previous Version
- How to White Label Schema Pro
- How to Add a Schema markup for an Article on your website?
- What is the Difference between the Free and Pro Plugin?
- How to map fields with custom fields from third party plugins?
- How to Accept User Ratings from Users in Schema Pro?
- How to Update Schema Pro?
- How to Register Your Copy of Schema Pro? (License Registration)
- Selecting Organization Type in the Setup Wizard
- Schema Pro Setup Wizard
- Getting Started with Schema Pro
- How To Install Schema Pro Plugin
- How to Add a Schema markup for an Event page?
- How to Add a Schema markup for a Review page?
- How to Add a Schema markup for a Local Business Page?
- How to Add a Schema markup for a Service Page?
- How to Add a Schema markup for a Product page?
- How to Add a Schema markup for a Course page?
- How to Add a Schema markup for a Recipe page?
- How to Add a Schema markup for a Person or About Page?
- How to Add a Schema markup for a Job Posting page?
- How to Add a Schema markup for a Video Object?
How to Add an Extra Field for a Particular Schema Type in Schema Pro?
Schema Pro allows you to add an extra field for a particular schema type.
You will need to use 2 filters to be able to add an extra field.
- wp_schema_pro_schema_meta_fields: This filter is used to add your extra field for mapping.
- wp_schema_pro_schema_{$schema_type}: This filter is used to map the extra field with schema field. Here $schema_type should be replaced with your schema type for which you wish to add an extra field. You can use the following schema types.
article
,book
,course
,event
,job_posting
,local_business
,review
,person
,product
,
recipe
,service
,software_application
,video_object
Here is an example you can refer to:
Example: Add a field workExample
in local_business
Schema type. Add following code in your functions.php file. Here work-example
is used as a key for the workExample
field.
add_action( 'after_setup_theme', 'add_my_custom_meta_field' ); function add_my_custom_meta_field() { add_filter( 'wp_schema_pro_schema_meta_fields', 'my_extra_schema_field' ); add_filter( 'wp_schema_pro_schema_local_business', 'my_extra_schema_field_mapping', 10, 3 ); } /** * Add fields for mapping. * * @param array $fields Mapping fields array. * @return array */ function my_extra_schema_field( $fields ) { $fields['bsf-aiosrs-local-business']['subkeys']['work-example'] = array( // `bsf-aiosrs-book` used for Book, `bsf-aiosrs-event` will for Event like that. 'label' => esc_html__( 'workExample', 'wp-schema-pro' ), // Label to display in Mapping fields 'type' => 'text', // text/date/image 'default' => 'none', 'required' => true, // true/false. ); return $fields; } /** * Mapping extra field for schema markup. * * @param array $schema Schema array. * @param array $data Mapping fields array. * @return array */ function my_extra_schema_field_mapping( $schema, $data, $post ) { if ( isset( $data['work-example'] ) && ! empty( $data['work-example'] ) ) { // For date/text type field $schema['workExample'] = esc_html( $data['work-example'] ); // For image type field // $schema['workExample'] = BSF_AIOSRS_Pro_Schema_Template::get_image_schema( $data['work-example'] ); } return $schema; }
Was this doc helpful?
What went wrong?
We don't respond to the article feedback, we use it to improve our support content.
On this page