Version Description
(04 June 2020) =
- Fixed: Placement: Post type equal to page should not apply to custom front page #1038
- Fixed: Uncaught Error: [ ] operator not supported for strings in admin_section/settings.php line 23 #1037
- Fixed: fix an issue with Image block of Gutenberg #1035
- Fixed: WP Recipe card is not visible in Structured data test for the amp post - Proper parent conditioning #1034
- Fixed: Review schema is added in the markup when it is not enabled on the post - Taqyeem compatibility. #1036
- Fixed: Description includes HTML in the itemlist-webpage schema. #1024
- Added: Image resizer option in gutenberg how-to(SASWP) Block #1018
- Added: Buddhist schema type #985
- Added: Estimated salary property in Jobposting schema type. #989
- Enhancement: Rating form rating value should be 5 by default. #1033
Download this release
Release Info
Developer | magazine3 |
Plugin | Schema & Structured Data for WP & AMP |
Version | 1.9.39 |
Comparing to | |
See all releases |
Code changes from version 1.9.38 to 1.9.39
- admin_section/common-function.php +5 -2
- admin_section/js/review-form.js +1 -1
- admin_section/js/review-form.min.js +1 -1
- admin_section/js/saswp-frontend.js +1 -1
- admin_section/settings.php +11 -6
- admin_section/structure_admin.php +2 -8
- core/array-list/schema-properties.php +108 -1
- core/array-list/schemas.php +2 -1
- core/global.php +1 -0
- modules/gutenberg/assets/blocks/howto.js +190 -17
- modules/gutenberg/assets/css/editor.css +7 -0
- modules/reviews/reviews_form.php +15 -6
- output/compatibility.php +11 -9
- output/function.php +23 -13
- output/markup.php +42 -0
- output/other-schema.php +7 -3
- output/output.php +21 -1
- output/service.php +65 -13
- readme.txt +15 -1
- structured-data-for-wp.php +2 -2
admin_section/common-function.php
CHANGED
@@ -2807,8 +2807,10 @@ function saswp_remove_anonymous_object_filter_or_action( $tag, $class, $method,
|
|
2807 |
return;
|
2808 |
}
|
2809 |
|
2810 |
-
|
2811 |
-
|
|
|
|
|
2812 |
|
2813 |
foreach ( $filter as $identifier => $function )
|
2814 |
{
|
@@ -2839,6 +2841,7 @@ function saswp_remove_anonymous_object_filter_or_action( $tag, $class, $method,
|
|
2839 |
}
|
2840 |
}
|
2841 |
}
|
|
|
2842 |
}
|
2843 |
|
2844 |
function saswp_get_field_note($pname){
|
2807 |
return;
|
2808 |
}
|
2809 |
|
2810 |
+
if(is_array($filters)){
|
2811 |
+
|
2812 |
+
foreach ( $filters as $priority => $filter )
|
2813 |
+
{
|
2814 |
|
2815 |
foreach ( $filter as $identifier => $function )
|
2816 |
{
|
2841 |
}
|
2842 |
}
|
2843 |
}
|
2844 |
+
}
|
2845 |
}
|
2846 |
|
2847 |
function saswp_get_field_note($pname){
|
admin_section/js/review-form.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
jQuery(document).ready(function($){
|
2 |
|
3 |
jQuery(".saswp-rating-front-div").rateYo({
|
4 |
-
rating :
|
5 |
fullStar: true,
|
6 |
onSet: function (rating, rateYoInstance) {
|
7 |
$(this).next().val(rating);
|
1 |
jQuery(document).ready(function($){
|
2 |
|
3 |
jQuery(".saswp-rating-front-div").rateYo({
|
4 |
+
rating : 5,
|
5 |
fullStar: true,
|
6 |
onSet: function (rating, rateYoInstance) {
|
7 |
$(this).next().val(rating);
|
admin_section/js/review-form.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(n){jQuery(".saswp-rating-front-div").rateYo({rating:
|
1 |
+
jQuery(document).ready(function(n){jQuery(".saswp-rating-front-div").rateYo({rating:5,fullStar:!0,onSet:function(t,e){n(this).next().val(t)}}),jQuery(".saswp-rv-form-btn a").on("click",function(t){t.preventDefault(),n(".saswp-review-submission-form").slideToggle("fast")})});
|
admin_section/js/saswp-frontend.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
jQuery(document).ready(function($){
|
2 |
|
3 |
jQuery("#saswp-comment-rating-div").rateYo({
|
4 |
-
rating :
|
5 |
fullStar: true,
|
6 |
onSet: function (rating, rateYoInstance) {
|
7 |
$(this).next().val(rating);
|
1 |
jQuery(document).ready(function($){
|
2 |
|
3 |
jQuery("#saswp-comment-rating-div").rateYo({
|
4 |
+
rating : 5,
|
5 |
fullStar: true,
|
6 |
onSet: function (rating, rateYoInstance) {
|
7 |
$(this).next().val(rating);
|
admin_section/settings.php
CHANGED
@@ -18,13 +18,18 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
18 |
add_action( 'plugin_action_links_' . plugin_basename( SASWP_DIR_NAME_FILE ), 'saswp_plugin_action_links' );
|
19 |
|
20 |
function saswp_plugin_action_links( $links ) {
|
21 |
-
|
22 |
-
$nonce = wp_create_nonce( 'saswp_install_wizard_nonce' );
|
23 |
-
$links[] = '<a href="' . esc_url( admin_url( 'edit.php?post_type=saswp&page=structured_data_options' ) ) . '">' . esc_html__( 'Settings', 'schema-and-structured-data-for-wp' ) . '</a>';
|
24 |
-
$links[] = '<a href="'. esc_url( admin_url( 'plugins.php?page=saswp-setup-wizard' ).'&_saswp_nonce='.$nonce).'">' . esc_html__( 'Setup Wizard', 'schema-and-structured-data-for-wp' ) . '</a>';
|
25 |
-
$links[] = '<a target="_blank" href="http://structured-data-for-wp.com/docs/">' . esc_html__( 'Documentation', 'schema-and-structured-data-for-wp' ) . '</a>';
|
26 |
-
return $links;
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|
29 |
|
30 |
function saswp_ext_installed_status(){
|
18 |
add_action( 'plugin_action_links_' . plugin_basename( SASWP_DIR_NAME_FILE ), 'saswp_plugin_action_links' );
|
19 |
|
20 |
function saswp_plugin_action_links( $links ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
+
$nonce = wp_create_nonce( 'saswp_install_wizard_nonce' );
|
23 |
+
|
24 |
+
if(is_array($links)){
|
25 |
+
|
26 |
+
$links[] = '<a href="' . esc_url( admin_url( 'edit.php?post_type=saswp&page=structured_data_options' ) ) . '">' . esc_html__( 'Settings', 'schema-and-structured-data-for-wp' ) . '</a>';
|
27 |
+
$links[] = '<a href="'. esc_url( admin_url( 'plugins.php?page=saswp-setup-wizard' ).'&_saswp_nonce='.$nonce).'">' . esc_html__( 'Setup Wizard', 'schema-and-structured-data-for-wp' ) . '</a>';
|
28 |
+
$links[] = '<a target="_blank" href="http://structured-data-for-wp.com/docs/">' . esc_html__( 'Documentation', 'schema-and-structured-data-for-wp' ) . '</a>';
|
29 |
+
|
30 |
+
}
|
31 |
+
|
32 |
+
return $links;
|
33 |
}
|
34 |
|
35 |
function saswp_ext_installed_status(){
|
admin_section/structure_admin.php
CHANGED
@@ -311,18 +311,12 @@ function saswp_comparison_logic_checker($input){
|
|
311 |
|
312 |
$current_post_type = '';
|
313 |
|
314 |
-
if( (is_singular() || is_admin()
|
315 |
|
316 |
$current_post_type = get_post_type($post->ID);
|
317 |
|
318 |
}
|
319 |
-
|
320 |
-
if(function_exists('ampforwp_is_front_page') && ampforwp_is_front_page()){
|
321 |
-
|
322 |
-
$current_post_type = 'page';
|
323 |
-
|
324 |
-
}
|
325 |
-
|
326 |
if ( $comparison == 'equal' ) {
|
327 |
|
328 |
if ( $current_post_type == $data ) {
|
311 |
|
312 |
$current_post_type = '';
|
313 |
|
314 |
+
if( (is_singular() || is_admin()) && is_object($post) && !is_front_page()){
|
315 |
|
316 |
$current_post_type = get_post_type($post->ID);
|
317 |
|
318 |
}
|
319 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
if ( $comparison == 'equal' ) {
|
321 |
|
322 |
if ( $current_post_type == $data ) {
|
core/array-list/schema-properties.php
CHANGED
@@ -3405,6 +3405,89 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
|
|
3405 |
|
3406 |
);
|
3407 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3408 |
|
3409 |
case 'Church':
|
3410 |
|
@@ -3680,7 +3763,31 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
|
|
3680 |
'attributes' => array(
|
3681 |
'placeholder' => 'Hour'
|
3682 |
)
|
3683 |
-
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3684 |
|
3685 |
|
3686 |
);
|
3405 |
|
3406 |
);
|
3407 |
break;
|
3408 |
+
|
3409 |
+
case 'BuddhistTemple':
|
3410 |
+
|
3411 |
+
$meta_field = array(
|
3412 |
+
array(
|
3413 |
+
'label' => 'Name',
|
3414 |
+
'id' => 'saswp_buddhisttemple_schema_name_'.$schema_id,
|
3415 |
+
'type' => 'text',
|
3416 |
+
'attributes' => array(
|
3417 |
+
'placeholder' => 'Name'
|
3418 |
+
),
|
3419 |
+
),
|
3420 |
+
array(
|
3421 |
+
'label' => 'Description',
|
3422 |
+
'id' => 'saswp_buddhisttemple_schema_description_'.$schema_id,
|
3423 |
+
'type' => 'textarea',
|
3424 |
+
'attributes' => array(
|
3425 |
+
'placeholder' => 'Description'
|
3426 |
+
),
|
3427 |
+
),
|
3428 |
+
array(
|
3429 |
+
'label' => 'Image',
|
3430 |
+
'id' => 'saswp_buddhisttemple_schema_image_'.$schema_id,
|
3431 |
+
'type' => 'media',
|
3432 |
+
),
|
3433 |
+
array(
|
3434 |
+
'label' => 'URL',
|
3435 |
+
'id' => 'saswp_buddhisttemple_schema_url_'.$schema_id,
|
3436 |
+
'type' => 'text',
|
3437 |
+
'default' => get_permalink()
|
3438 |
+
),
|
3439 |
+
array(
|
3440 |
+
'label' => 'Has Map',
|
3441 |
+
'id' => 'saswp_buddhisttemple_schema_hasmap_'.$schema_id,
|
3442 |
+
'type' => 'text',
|
3443 |
+
),
|
3444 |
+
array(
|
3445 |
+
'label' => 'Is Accessible For Free',
|
3446 |
+
'id' => 'saswp_buddhisttemple_schema_is_accesible_free_'.$schema_id,
|
3447 |
+
'type' => 'select',
|
3448 |
+
'options' => array(
|
3449 |
+
'true' => 'True',
|
3450 |
+
'false' => 'False',
|
3451 |
+
)
|
3452 |
+
),
|
3453 |
+
array(
|
3454 |
+
'label' => 'Maximum Attendee Capacity',
|
3455 |
+
'id' => 'saswp_buddhisttemple_schema_maximum_a_capacity_'.$schema_id,
|
3456 |
+
'type' => 'text',
|
3457 |
+
),
|
3458 |
+
array(
|
3459 |
+
'label' => 'Address Locality',
|
3460 |
+
'id' => 'saswp_buddhisttemple_schema_locality_'.$schema_id,
|
3461 |
+
'type' => 'text',
|
3462 |
+
),
|
3463 |
+
array(
|
3464 |
+
'label' => 'Address Region',
|
3465 |
+
'id' => 'saswp_buddhisttemple_schema_region_'.$schema_id,
|
3466 |
+
'type' => 'text',
|
3467 |
+
),
|
3468 |
+
array(
|
3469 |
+
'label' => 'Address Country',
|
3470 |
+
'id' => 'saswp_buddhisttemple_schema_country_'.$schema_id,
|
3471 |
+
'type' => 'text',
|
3472 |
+
),
|
3473 |
+
array(
|
3474 |
+
'label' => 'Address PostalCode',
|
3475 |
+
'id' => 'saswp_buddhisttemple_schema_postal_code_'.$schema_id,
|
3476 |
+
'type' => 'text',
|
3477 |
+
),
|
3478 |
+
array(
|
3479 |
+
'label' => 'Latitude',
|
3480 |
+
'id' => 'saswp_buddhisttemple_schema_latitude_'.$schema_id,
|
3481 |
+
'type' => 'text',
|
3482 |
+
),
|
3483 |
+
array(
|
3484 |
+
'label' => 'Longitude',
|
3485 |
+
'id' => 'saswp_buddhisttemple_schema_longitude_'.$schema_id,
|
3486 |
+
'type' => 'text',
|
3487 |
+
),
|
3488 |
+
|
3489 |
+
);
|
3490 |
+
break;
|
3491 |
|
3492 |
case 'Church':
|
3493 |
|
3763 |
'attributes' => array(
|
3764 |
'placeholder' => 'Hour'
|
3765 |
)
|
3766 |
+
),
|
3767 |
+
array(
|
3768 |
+
'label' => 'Estimated Salary Currency',
|
3769 |
+
'id' => 'saswp_jobposting_schema_es_currency_'.$schema_id,
|
3770 |
+
'type' => 'text',
|
3771 |
+
'attributes' => array(
|
3772 |
+
'placeholder' => 'USD'
|
3773 |
+
)
|
3774 |
+
),
|
3775 |
+
array(
|
3776 |
+
'label' => 'Estimated Salary Value',
|
3777 |
+
'id' => 'saswp_jobposting_schema_es_value_'.$schema_id,
|
3778 |
+
'type' => 'text',
|
3779 |
+
'attributes' => array(
|
3780 |
+
'placeholder' => '40.00'
|
3781 |
+
)
|
3782 |
+
),
|
3783 |
+
array(
|
3784 |
+
'label' => 'Estimated Salary Unit Text',
|
3785 |
+
'id' => 'saswp_jobposting_schema_es_unittext_'.$schema_id,
|
3786 |
+
'type' => 'text',
|
3787 |
+
'attributes' => array(
|
3788 |
+
'placeholder' => 'Hour'
|
3789 |
+
)
|
3790 |
+
)
|
3791 |
|
3792 |
|
3793 |
);
|
core/array-list/schemas.php
CHANGED
@@ -67,8 +67,9 @@ return array(
|
|
67 |
'LandmarksOrHistoricalBuildings' => 'LandmarksOrHistoricalBuildings',
|
68 |
),
|
69 |
'PlaceOfWorship' => array(
|
70 |
-
'
|
71 |
'Church' => 'Church',
|
|
|
72 |
'Mosque' => 'Mosque',
|
73 |
),
|
74 |
'Thing' => array(
|
67 |
'LandmarksOrHistoricalBuildings' => 'LandmarksOrHistoricalBuildings',
|
68 |
),
|
69 |
'PlaceOfWorship' => array(
|
70 |
+
'BuddhistTemple' => 'BuddhistTemple',
|
71 |
'Church' => 'Church',
|
72 |
+
'HinduTemple' => 'HinduTemple',
|
73 |
'Mosque' => 'Mosque',
|
74 |
),
|
75 |
'Thing' => array(
|
core/global.php
CHANGED
@@ -51,6 +51,7 @@ $without_aggregate = array(
|
|
51 |
'LandmarksOrHistoricalBuildings',
|
52 |
'PsychologicalTreatment',
|
53 |
'HinduTemple',
|
|
|
54 |
'Church',
|
55 |
'Mosque',
|
56 |
'Person',
|
51 |
'LandmarksOrHistoricalBuildings',
|
52 |
'PsychologicalTreatment',
|
53 |
'HinduTemple',
|
54 |
+
'BuddhistTemple',
|
55 |
'Church',
|
56 |
'Mosque',
|
57 |
'Person',
|
modules/gutenberg/assets/blocks/howto.js
CHANGED
@@ -2,17 +2,10 @@
|
|
2 |
( function( blocks, element, editor, components, i18n ) {
|
3 |
|
4 |
const { __ } = i18n;
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
var IconButton = components.IconButton;
|
10 |
-
var AlignmentToolbar = editor.AlignmentToolbar;
|
11 |
-
var BlockControls = editor.BlockControls;
|
12 |
-
var TextControl = components.TextControl;
|
13 |
-
var InspectorControls = editor.InspectorControls;
|
14 |
-
var ToggleControl = components.ToggleControl;
|
15 |
-
var PanelBody = components.PanelBody;
|
16 |
|
17 |
blocks.registerBlockType( 'saswp/how-to-block', {
|
18 |
title: __('How To (SASWP)', 'schema-and-structured-data-for-wp'),
|
@@ -25,7 +18,7 @@
|
|
25 |
multiple: false
|
26 |
},
|
27 |
|
28 |
-
attributes: {
|
29 |
hasDuration:{
|
30 |
type:'boolean',
|
31 |
default:false
|
@@ -84,6 +77,23 @@
|
|
84 |
imageUrl: {
|
85 |
type: 'string'
|
86 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
index: {
|
88 |
type: 'number',
|
89 |
attribute: 'data-index',
|
@@ -133,8 +143,9 @@
|
|
133 |
},
|
134 |
edit: function(props) {
|
135 |
|
136 |
-
|
137 |
-
|
|
|
138 |
|
139 |
//List of function for the current blocks starts here
|
140 |
|
@@ -354,7 +365,7 @@
|
|
354 |
el(MediaUpload, {
|
355 |
onSelect: function(media){
|
356 |
|
357 |
-
const image = '<img src="'+media.url+'" alt="'+media.alt+'" key="'+media.id+'"/>';
|
358 |
|
359 |
const oldAttributes = attributes;
|
360 |
const oldItems = attributes.items;
|
@@ -365,6 +376,9 @@
|
|
365 |
oldItems[index]['description'] = value['description']+image;
|
366 |
oldItems[index]['imageUrl'] = media.url;
|
367 |
oldItems[index]['imageId'] = media.id;
|
|
|
|
|
|
|
368 |
|
369 |
}
|
370 |
|
@@ -453,6 +467,164 @@
|
|
453 |
|
454 |
}
|
455 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
456 |
function saswpGetMover(item){
|
457 |
|
458 |
if(!item.isSelected){
|
@@ -562,8 +734,9 @@
|
|
562 |
});
|
563 |
}
|
564 |
}
|
565 |
-
),
|
566 |
el('div', {className:'saswp-how-to-step-controls-container'},
|
|
|
567 |
saswpGetMover(item),
|
568 |
saswpGetButtons(item)
|
569 |
)
|
@@ -772,7 +945,7 @@
|
|
772 |
}
|
773 |
},
|
774 |
)
|
775 |
-
)
|
776 |
),
|
777 |
el(
|
778 |
BlockControls,
|
2 |
( function( blocks, element, editor, components, i18n ) {
|
3 |
|
4 |
const { __ } = i18n;
|
5 |
+
const { RichText, MediaUpload, AlignmentToolbar, BlockControls, InspectorControls} = editor;
|
6 |
+
const {TextControl, ToggleControl, PanelBody, IconButton, SelectControl} = components;
|
7 |
+
|
8 |
+
const el = element.createElement;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
blocks.registerBlockType( 'saswp/how-to-block', {
|
11 |
title: __('How To (SASWP)', 'schema-and-structured-data-for-wp'),
|
18 |
multiple: false
|
19 |
},
|
20 |
|
21 |
+
attributes: {
|
22 |
hasDuration:{
|
23 |
type:'boolean',
|
24 |
default:false
|
77 |
imageUrl: {
|
78 |
type: 'string'
|
79 |
},
|
80 |
+
image_size: {
|
81 |
+
type: 'string',
|
82 |
+
default: 'full'
|
83 |
+
},
|
84 |
+
image_sizes: {
|
85 |
+
type: 'object'
|
86 |
+
},
|
87 |
+
image_height: {
|
88 |
+
type: 'number'
|
89 |
+
},
|
90 |
+
image_width: {
|
91 |
+
type: 'number'
|
92 |
+
},
|
93 |
+
image_selected: {
|
94 |
+
type: 'boolean',
|
95 |
+
default:false
|
96 |
+
},
|
97 |
index: {
|
98 |
type: 'number',
|
99 |
attribute: 'data-index',
|
143 |
},
|
144 |
edit: function(props) {
|
145 |
|
146 |
+
const attributes = props.attributes;
|
147 |
+
|
148 |
+
const alignment = props.attributes.alignment;
|
149 |
|
150 |
//List of function for the current blocks starts here
|
151 |
|
365 |
el(MediaUpload, {
|
366 |
onSelect: function(media){
|
367 |
|
368 |
+
const image = '<img style="height:'+media.height+'px; width: '+media.width+'px;" src="'+media.url+'" alt="'+media.alt+'" key="'+media.id+'"/>';
|
369 |
|
370 |
const oldAttributes = attributes;
|
371 |
const oldItems = attributes.items;
|
376 |
oldItems[index]['description'] = value['description']+image;
|
377 |
oldItems[index]['imageUrl'] = media.url;
|
378 |
oldItems[index]['imageId'] = media.id;
|
379 |
+
oldItems[index]['image_sizes'] = media.sizes;
|
380 |
+
oldItems[index]['image_height']= media.height;
|
381 |
+
oldItems[index]['image_width'] = media.width;
|
382 |
|
383 |
}
|
384 |
|
467 |
|
468 |
}
|
469 |
|
470 |
+
function saswpReplaceImage(desc, image){
|
471 |
+
|
472 |
+
let modified_desc = desc.replace(/<img (.*?)\/>/g, image);
|
473 |
+
modified_desc = desc.replace(/<img (.*?)>/g, image);
|
474 |
+
|
475 |
+
return modified_desc;
|
476 |
+
}
|
477 |
+
|
478 |
+
function saswpImageUpdate(value, item, height, width, image_type){
|
479 |
+
|
480 |
+
let image_url;
|
481 |
+
let image;
|
482 |
+
|
483 |
+
switch (value) {
|
484 |
+
|
485 |
+
case 'full':
|
486 |
+
|
487 |
+
if(image_type != null){
|
488 |
+
height = item.image_sizes.full.height;
|
489 |
+
width = item.image_sizes.full.width;
|
490 |
+
}
|
491 |
+
|
492 |
+
image_url = item.image_sizes.full.url;
|
493 |
+
image = '<img style="height:'+height+'px; width: '+width+'px;" src="'+item.image_sizes.full.url+'" key="'+item.image_sizes.full.url+'" />';
|
494 |
+
break;
|
495 |
+
|
496 |
+
case 'large':
|
497 |
+
|
498 |
+
if(image_type != null){
|
499 |
+
height = item.image_sizes.large.height;
|
500 |
+
width = item.image_sizes.large.width;
|
501 |
+
}
|
502 |
+
|
503 |
+
image_url = item.image_sizes.large.url;
|
504 |
+
image = '<img style="height:'+height+'px; width: '+width+'px;" src="'+item.image_sizes.large.url+'" key="'+item.image_sizes.large.url+'" />';
|
505 |
+
break;
|
506 |
+
|
507 |
+
case 'medium':
|
508 |
+
|
509 |
+
if(image_type != null){
|
510 |
+
height = item.image_sizes.medium.height;
|
511 |
+
width = item.image_sizes.medium.width;
|
512 |
+
}
|
513 |
+
|
514 |
+
image_url = item.image_sizes.medium.url;
|
515 |
+
image = '<img style="height:'+height+'px; width: '+width+'px;" src="'+item.image_sizes.medium.url+'" key="'+item.image_sizes.medium.url+'" />';
|
516 |
+
break;
|
517 |
+
|
518 |
+
case 'thumbnail':
|
519 |
+
|
520 |
+
if(image_type != null){
|
521 |
+
height = item.image_sizes.thumbnail.height;
|
522 |
+
width = item.image_sizes.thumbnail.width;
|
523 |
+
}
|
524 |
+
|
525 |
+
image_url = item.image_sizes.thumbnail.url;
|
526 |
+
image = '<img style="height:'+height+'px; width: '+width+'px;" src="'+item.image_sizes.thumbnail.url+'" key="'+item.image_sizes.thumbnail.url+'" />';
|
527 |
+
break;
|
528 |
+
|
529 |
+
default:
|
530 |
+
break;
|
531 |
+
}
|
532 |
+
|
533 |
+
var newObject = Object.assign({}, item, {
|
534 |
+
image_size: value,
|
535 |
+
image_height: height,
|
536 |
+
image_width: width,
|
537 |
+
imageUrl : image_url,
|
538 |
+
description : saswpReplaceImage(item.description, image)
|
539 |
+
});
|
540 |
+
return newObject;
|
541 |
+
}
|
542 |
+
|
543 |
+
function saswpImageSettings(item){
|
544 |
+
|
545 |
+
if(item.isSelected && item.imageUrl != ''){
|
546 |
+
return el(InspectorControls,
|
547 |
+
{
|
548 |
+
className:'saswp-how-to-inspector',
|
549 |
+
key: 'inspector'
|
550 |
+
},
|
551 |
+
el(PanelBody,
|
552 |
+
{className:'saswp-how-to-panel-body',
|
553 |
+
title:__('Image Settings', 'schema-and-structured-data-for-wp')
|
554 |
+
},
|
555 |
+
el(SelectControl,{
|
556 |
+
value : item.image_size,
|
557 |
+
label: __('Image Size', 'schema-and-structured-data-for-wp'),
|
558 |
+
options:[
|
559 |
+
{ label: 'Full Size', value: 'full' },
|
560 |
+
{ label: 'Large', value: 'large' },
|
561 |
+
{ label: 'Medium', value: 'medium' },
|
562 |
+
{ label: 'Thumbnail', value: 'thumbnail' },
|
563 |
+
] ,
|
564 |
+
onChange: function(value){
|
565 |
+
|
566 |
+
var newObject = saswpImageUpdate(value, item, '', '', 'image_type');
|
567 |
+
|
568 |
+
return props.setAttributes({
|
569 |
+
items: [].concat(_cloneArray(props.attributes.items.filter(function (itemFilter) {
|
570 |
+
return itemFilter.index != item.index;
|
571 |
+
})), [newObject])
|
572 |
+
});
|
573 |
+
}
|
574 |
+
}),
|
575 |
+
el('p',{
|
576 |
+
className: 'saswp-how-to-dimesion-p'
|
577 |
+
}, 'Image Dimensions'),
|
578 |
+
el('div', {
|
579 |
+
className: "saswp-how-to-dimension"
|
580 |
+
},
|
581 |
+
el( TextControl, {
|
582 |
+
className:'saswp-how-to-image-dimension',
|
583 |
+
label:'Height',
|
584 |
+
type: 'number',
|
585 |
+
min:0,
|
586 |
+
placeholder: __('20', 'schema-and-structured-data-for-wp'),
|
587 |
+
value: item.image_height,
|
588 |
+
onChange: function( value ) {
|
589 |
+
|
590 |
+
var newObject = saswpImageUpdate(item.image_size, item, value, item.image_width, null);
|
591 |
+
|
592 |
+
return props.setAttributes({
|
593 |
+
items: [].concat(_cloneArray(props.attributes.items.filter(function (itemFilter) {
|
594 |
+
return itemFilter.index != item.index;
|
595 |
+
})), [newObject])
|
596 |
+
});
|
597 |
+
}
|
598 |
+
}
|
599 |
+
),
|
600 |
+
el( TextControl, {
|
601 |
+
className:'saswp-how-to-image-dimension',
|
602 |
+
label:'Width',
|
603 |
+
type: 'number',
|
604 |
+
min:0,
|
605 |
+
placeholder: __('20', 'schema-and-structured-data-for-wp'),
|
606 |
+
value: item.image_width,
|
607 |
+
onChange: function( value ) {
|
608 |
+
|
609 |
+
var newObject = saswpImageUpdate(item.image_size, item, item.image_height, value, null);
|
610 |
+
|
611 |
+
return props.setAttributes({
|
612 |
+
items: [].concat(_cloneArray(props.attributes.items.filter(function (itemFilter) {
|
613 |
+
return itemFilter.index != item.index;
|
614 |
+
})), [newObject])
|
615 |
+
});
|
616 |
+
}
|
617 |
+
}
|
618 |
+
),
|
619 |
+
)
|
620 |
+
)
|
621 |
+
);
|
622 |
+
}else{
|
623 |
+
return null;
|
624 |
+
}
|
625 |
+
|
626 |
+
|
627 |
+
}
|
628 |
function saswpGetMover(item){
|
629 |
|
630 |
if(!item.isSelected){
|
734 |
});
|
735 |
}
|
736 |
}
|
737 |
+
),
|
738 |
el('div', {className:'saswp-how-to-step-controls-container'},
|
739 |
+
saswpImageSettings(item),
|
740 |
saswpGetMover(item),
|
741 |
saswpGetButtons(item)
|
742 |
)
|
945 |
}
|
946 |
},
|
947 |
)
|
948 |
+
)
|
949 |
),
|
950 |
el(
|
951 |
BlockControls,
|
modules/gutenberg/assets/css/editor.css
CHANGED
@@ -163,3 +163,10 @@ and open the template in the editor.
|
|
163 |
/*
|
164 |
Course Block css ends here
|
165 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
/*
|
164 |
Course Block css ends here
|
165 |
*/
|
166 |
+
.saswp-how-to-dimension{
|
167 |
+
display: flex;
|
168 |
+
justify-content: space-between;
|
169 |
+
}
|
170 |
+
.saswp-how-to-image-dimension{
|
171 |
+
margin: 3px;
|
172 |
+
}
|
modules/reviews/reviews_form.php
CHANGED
@@ -41,14 +41,23 @@ class SASWP_Reviews_Form {
|
|
41 |
}
|
42 |
|
43 |
public function saswp_review_form_blacklist_sanitizer($data){
|
|
|
|
|
44 |
|
45 |
if(function_exists('ampforwp_is_amp_endpoint')){
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
}
|
54 |
|
41 |
}
|
42 |
|
43 |
public function saswp_review_form_blacklist_sanitizer($data){
|
44 |
+
|
45 |
+
global $post;
|
46 |
|
47 |
if(function_exists('ampforwp_is_amp_endpoint')){
|
48 |
+
|
49 |
+
if(preg_match( '/\[saswp\-reviews\-form\]/', $post->post_content, $match ) || preg_match( '/\[saswp\-reviews\-form onbutton\=\"1\"\]/', $post->post_content, $match )){
|
50 |
+
|
51 |
+
if(!empty($match)){
|
52 |
+
|
53 |
+
require_once SASWP_PLUGIN_DIR_PATH .'core/3rd-party/class-amp-review-form-blacklist.php';
|
54 |
+
unset($data['AMPFORWP_Blacklist_Sanitizer']);
|
55 |
+
unset($data['AMP_Blacklist_Sanitizer']);
|
56 |
+
$data[ 'AMP_Review_Form_Blacklist' ] = array();
|
57 |
+
|
58 |
+
}
|
59 |
+
|
60 |
+
}
|
61 |
|
62 |
}
|
63 |
|
output/compatibility.php
CHANGED
@@ -60,7 +60,10 @@ class saswp_output_compatibility{
|
|
60 |
|
61 |
public function saswp_override_schema_markup(){
|
62 |
|
|
|
|
|
63 |
global $sd_data;
|
|
|
64 |
if(!empty($this->_plugins_list)){
|
65 |
|
66 |
foreach ($this->_plugins_list as $key => $plugins){
|
@@ -104,9 +107,9 @@ class saswp_output_compatibility{
|
|
104 |
|
105 |
}
|
106 |
|
107 |
-
}
|
108 |
-
|
109 |
// Theme ends here
|
|
|
110 |
|
111 |
}
|
112 |
|
@@ -157,10 +160,7 @@ class saswp_output_compatibility{
|
|
157 |
}
|
158 |
public function saswp_event_on_override(){
|
159 |
|
160 |
-
}
|
161 |
-
public function saswp_schemaforfaqs_override(){
|
162 |
-
saswp_remove_anonymous_object_filter_or_action('wp_head', 'Schema_Faqs', 'schema_faqs_head', 'action');
|
163 |
-
}
|
164 |
public function saswp_wordpress_news_override(){
|
165 |
}
|
166 |
public function saswp_total_recipe_generator_override(){
|
@@ -189,9 +189,8 @@ class saswp_output_compatibility{
|
|
189 |
}
|
190 |
|
191 |
}
|
192 |
-
|
193 |
-
|
194 |
-
public function saswp_taqyeem_override(){
|
195 |
remove_filter('tie_taqyeem_after_review_box', 'taqyeem_review_rich_snippet');
|
196 |
}
|
197 |
|
@@ -455,6 +454,9 @@ class saswp_output_compatibility{
|
|
455 |
public function wordpress_news_on_activation(){
|
456 |
$this->saswp_update_option_on_compatibility_activation('saswp-wordpress-news');
|
457 |
}
|
|
|
|
|
|
|
458 |
public function total_recipe_generator_on_activation(){
|
459 |
$this->saswp_update_option_on_compatibility_activation('saswp-total-recipe-generator');
|
460 |
}
|
60 |
|
61 |
public function saswp_override_schema_markup(){
|
62 |
|
63 |
+
if(!is_admin()){
|
64 |
+
|
65 |
global $sd_data;
|
66 |
+
|
67 |
if(!empty($this->_plugins_list)){
|
68 |
|
69 |
foreach ($this->_plugins_list as $key => $plugins){
|
107 |
|
108 |
}
|
109 |
|
110 |
+
}
|
|
|
111 |
// Theme ends here
|
112 |
+
}
|
113 |
|
114 |
}
|
115 |
|
160 |
}
|
161 |
public function saswp_event_on_override(){
|
162 |
|
163 |
+
}
|
|
|
|
|
|
|
164 |
public function saswp_wordpress_news_override(){
|
165 |
}
|
166 |
public function saswp_total_recipe_generator_override(){
|
189 |
}
|
190 |
|
191 |
}
|
192 |
+
|
193 |
+
public function saswp_taqyeem_override(){
|
|
|
194 |
remove_filter('tie_taqyeem_after_review_box', 'taqyeem_review_rich_snippet');
|
195 |
}
|
196 |
|
454 |
public function wordpress_news_on_activation(){
|
455 |
$this->saswp_update_option_on_compatibility_activation('saswp-wordpress-news');
|
456 |
}
|
457 |
+
public function schemaforfaqs_on_activation(){
|
458 |
+
$this->saswp_update_option_on_compatibility_activation('saswp-schemaforfaqs');
|
459 |
+
}
|
460 |
public function total_recipe_generator_on_activation(){
|
461 |
$this->saswp_update_option_on_compatibility_activation('saswp-total-recipe-generator');
|
462 |
}
|
output/function.php
CHANGED
@@ -40,24 +40,34 @@ function saswp_schema_markup_hook_on_init() {
|
|
40 |
}
|
41 |
|
42 |
add_action('cooked_amp_head', 'saswp_schema_markup_output');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
-
remove_action( 'amp_post_template_head', 'amp_post_template_add_schemaorg_metadata',99,1);
|
45 |
-
remove_action( 'amp_post_template_footer', 'amp_post_template_add_schemaorg_metadata',99,1);
|
46 |
-
remove_action( 'wp_footer', 'orbital_markup_site');
|
47 |
-
add_filter( 'amp_schemaorg_metadata', '__return_empty_array' );
|
48 |
-
add_filter( 'hunch_schema_markup', '__return_false');
|
49 |
-
|
50 |
if(class_exists('BSF_AIOSRS_Pro_Markup')){
|
51 |
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
56 |
|
57 |
}
|
58 |
|
59 |
if(isset($sd_data['saswp-wp-recipe-maker']) && $sd_data['saswp-wp-recipe-maker'] == 1){
|
60 |
-
|
|
|
|
|
61 |
}
|
62 |
|
63 |
if(isset($sd_data['saswp-microdata-cleanup']) && $sd_data['saswp-microdata-cleanup'] == 1){
|
@@ -254,7 +264,7 @@ function saswp_get_all_schema_markup_output() {
|
|
254 |
$output .= ",";
|
255 |
$output .= "\n\n";
|
256 |
}
|
257 |
-
if(!empty($gutenberg_how_to)){
|
258 |
|
259 |
$output .= saswp_json_print_format($gutenberg_how_to);
|
260 |
$output .= ",";
|
@@ -2421,4 +2431,4 @@ function saswp_get_loop_markup($i) {
|
|
2421 |
$response = array('schema_properties' => $schema_properties, 'itemlist' => $itemlist_arr);
|
2422 |
|
2423 |
return $response;
|
2424 |
-
}
|
40 |
}
|
41 |
|
42 |
add_action('cooked_amp_head', 'saswp_schema_markup_output');
|
43 |
+
|
44 |
+
if(saswp_global_option()){
|
45 |
+
|
46 |
+
remove_action( 'amp_post_template_head', 'amp_post_template_add_schemaorg_metadata',99,1);
|
47 |
+
remove_action( 'amp_post_template_footer', 'amp_post_template_add_schemaorg_metadata',99,1);
|
48 |
+
remove_action( 'wp_footer', 'orbital_markup_site');
|
49 |
+
add_filter( 'amp_schemaorg_metadata', '__return_empty_array' );
|
50 |
+
add_filter( 'hunch_schema_markup', '__return_false');
|
51 |
+
|
52 |
+
}
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
if(class_exists('BSF_AIOSRS_Pro_Markup')){
|
55 |
|
56 |
+
if(saswp_global_option()){
|
57 |
+
|
58 |
+
remove_action( 'wp_head', array( BSF_AIOSRS_Pro_Markup::get_instance(), 'schema_markup' ),10);
|
59 |
+
remove_action( 'wp_head', array( BSF_AIOSRS_Pro_Markup::get_instance(), 'global_schemas_markup' ),10);
|
60 |
+
remove_action( 'wp_footer', array( BSF_AIOSRS_Pro_Markup::get_instance(), 'schema_markup' ),10);
|
61 |
+
remove_action( 'wp_footer', array( BSF_AIOSRS_Pro_Markup::get_instance(), 'global_schemas_markup' ),10);
|
62 |
+
|
63 |
+
}
|
64 |
|
65 |
}
|
66 |
|
67 |
if(isset($sd_data['saswp-wp-recipe-maker']) && $sd_data['saswp-wp-recipe-maker'] == 1){
|
68 |
+
if(saswp_global_option()){
|
69 |
+
add_filter( 'wprm_recipe_metadata', '__return_false' );
|
70 |
+
}
|
71 |
}
|
72 |
|
73 |
if(isset($sd_data['saswp-microdata-cleanup']) && $sd_data['saswp-microdata-cleanup'] == 1){
|
264 |
$output .= ",";
|
265 |
$output .= "\n\n";
|
266 |
}
|
267 |
+
if(!empty($gutenberg_how_to) && is_singular()){
|
268 |
|
269 |
$output .= saswp_json_print_format($gutenberg_how_to);
|
270 |
$output .= ",";
|
2431 |
$response = array('schema_properties' => $schema_properties, 'itemlist' => $itemlist_arr);
|
2432 |
|
2433 |
return $response;
|
2434 |
+
}
|
output/markup.php
CHANGED
@@ -1725,6 +1725,12 @@ function saswp_job_posting_schema_markup($schema_id, $schema_post_id, $all_post_
|
|
1725 |
$input1['baseSalary']['value']['@type'] = 'QuantitativeValue';
|
1726 |
$input1['baseSalary']['value']['value'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_bs_value_'.$schema_id, 'saswp_array');
|
1727 |
$input1['baseSalary']['value']['unitText'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_bs_unittext_'.$schema_id, 'saswp_array');
|
|
|
|
|
|
|
|
|
|
|
|
|
1728 |
|
1729 |
if(isset($all_post_meta['saswp_jobposting_schema_validthrough_'.$schema_id][0]) && date('Y-m-d',strtotime($all_post_meta['saswp_jobposting_schema_validthrough_'.$schema_id][0])) < date('Y-m-d')){
|
1730 |
$input1 = array();
|
@@ -1805,6 +1811,42 @@ function saswp_church_schema_markup($schema_id, $schema_post_id, $all_post_meta)
|
|
1805 |
|
1806 |
}
|
1807 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1808 |
function saswp_hindu_temple_schema_markup($schema_id, $schema_post_id, $all_post_meta){
|
1809 |
|
1810 |
$input1 = array();
|
1725 |
$input1['baseSalary']['value']['@type'] = 'QuantitativeValue';
|
1726 |
$input1['baseSalary']['value']['value'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_bs_value_'.$schema_id, 'saswp_array');
|
1727 |
$input1['baseSalary']['value']['unitText'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_bs_unittext_'.$schema_id, 'saswp_array');
|
1728 |
+
|
1729 |
+
$input1['estimatedSalary']['@type'] = 'MonetaryAmount';
|
1730 |
+
$input1['estimatedSalary']['currency'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_es_currency_'.$schema_id, 'saswp_array');
|
1731 |
+
$input1['estimatedSalary']['value']['@type'] = 'QuantitativeValue';
|
1732 |
+
$input1['estimatedSalary']['value']['value'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_es_value_'.$schema_id, 'saswp_array');
|
1733 |
+
$input1['estimatedSalary']['value']['unitText'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_es_unittext_'.$schema_id, 'saswp_array');
|
1734 |
|
1735 |
if(isset($all_post_meta['saswp_jobposting_schema_validthrough_'.$schema_id][0]) && date('Y-m-d',strtotime($all_post_meta['saswp_jobposting_schema_validthrough_'.$schema_id][0])) < date('Y-m-d')){
|
1736 |
$input1 = array();
|
1811 |
|
1812 |
}
|
1813 |
|
1814 |
+
function saswp_buddhist_temple_schema_markup($schema_id, $schema_post_id, $all_post_meta){
|
1815 |
+
|
1816 |
+
$input1 = array();
|
1817 |
+
|
1818 |
+
$howto_image = get_post_meta( get_the_ID(), 'saswp_buddhisttemple_schema_image_'.$schema_id.'_detail',true);
|
1819 |
+
|
1820 |
+
$input1['@context'] = saswp_context_url();
|
1821 |
+
$input1['@type'] = 'BuddhistTemple';
|
1822 |
+
$input1['@id'] = trailingslashit(get_permalink()).'#BuddhistTemple';
|
1823 |
+
$input1['url'] = saswp_remove_warnings($all_post_meta, 'saswp_buddhisttemple_schema_url_'.$schema_id, 'saswp_array');
|
1824 |
+
$input1['name'] = saswp_remove_warnings($all_post_meta, 'saswp_buddhisttemple_schema_name_'.$schema_id, 'saswp_array');
|
1825 |
+
$input1['description'] = saswp_remove_warnings($all_post_meta, 'saswp_buddhisttemple_schema_description_'.$schema_id, 'saswp_array');
|
1826 |
+
|
1827 |
+
if(!(empty($howto_image))){
|
1828 |
+
|
1829 |
+
$input1['image']['@type'] = 'ImageObject';
|
1830 |
+
$input1['image']['url'] = isset($howto_image['thumbnail']) ? esc_url($howto_image['thumbnail']):'';
|
1831 |
+
$input1['image']['height'] = isset($howto_image['width']) ? esc_attr($howto_image['width']) :'';
|
1832 |
+
$input1['image']['width'] = isset($howto_image['height']) ? esc_attr($howto_image['height']) :'';
|
1833 |
+
|
1834 |
+
}
|
1835 |
+
|
1836 |
+
$input1['isAccessibleForFree'] = saswp_remove_warnings($all_post_meta, 'saswp_buddhisttemple_schema_is_accesible_free_'.$schema_id, 'saswp_array');
|
1837 |
+
$input1['maximumAttendeeCapacity'] = saswp_remove_warnings($all_post_meta, 'saswp_buddhisttemple_schema_maximum_a_capacity_'.$schema_id, 'saswp_array');
|
1838 |
+
$input1['hasMap'] = saswp_remove_warnings($all_post_meta, 'saswp_buddhisttemple_schema_hasmap_'.$schema_id, 'saswp_array');
|
1839 |
+
|
1840 |
+
$input1['address']['@type'] = 'PostalAddress';
|
1841 |
+
$input1['address']['addressCountry'] = saswp_remove_warnings($all_post_meta, 'saswp_buddhisttemple_schema_country_'.$schema_id, 'saswp_array');
|
1842 |
+
$input1['address']['addressLocality'] = saswp_remove_warnings($all_post_meta, 'saswp_buddhisttemple_schema_locality_'.$schema_id, 'saswp_array');
|
1843 |
+
$input1['address']['addressRegion'] = saswp_remove_warnings($all_post_meta, 'saswp_buddhisttemple_schema_region_'.$schema_id, 'saswp_array');
|
1844 |
+
$input1['address']['PostalCode'] = saswp_remove_warnings($all_post_meta, 'saswp_buddhisttemple_schema_postal_code_'.$schema_id, 'saswp_array');
|
1845 |
+
|
1846 |
+
return $input1;
|
1847 |
+
|
1848 |
+
}
|
1849 |
+
|
1850 |
function saswp_hindu_temple_schema_markup($schema_id, $schema_post_id, $all_post_meta){
|
1851 |
|
1852 |
$input1 = array();
|
output/other-schema.php
CHANGED
@@ -16,7 +16,7 @@ function saswp_schema_for_faqs_schema(){
|
|
16 |
$input1 = array();
|
17 |
$saswp_faq = array();
|
18 |
|
19 |
-
if(isset($sd_data['saswp-schemaforfaqs']) && $sd_data['saswp-schemaforfaqs'] == 1 && class_exists('Schema_Faqs')){
|
20 |
|
21 |
$post_meta = get_post_meta($post->ID, 'schema_faqs_ques_ans_data', true);
|
22 |
$post_meta = str_replace("\'","'",$post_meta);
|
@@ -65,8 +65,12 @@ function saswp_taqyeem_review_rich_snippet(){
|
|
65 |
|
66 |
if(isset($sd_data['saswp-taqyeem']) && $sd_data['saswp-taqyeem'] == 1 && function_exists('taqyeem_review_get_rich_snippet')){
|
67 |
|
68 |
-
$
|
69 |
-
|
|
|
|
|
|
|
|
|
70 |
}
|
71 |
|
72 |
return apply_filters('saswp_modify_taqeem_default_schema', $input1);
|
16 |
$input1 = array();
|
17 |
$saswp_faq = array();
|
18 |
|
19 |
+
if(isset($sd_data['saswp-schemaforfaqs']) && $sd_data['saswp-schemaforfaqs'] == 1 && class_exists('Schema_Faqs') && !saswp_non_amp()){
|
20 |
|
21 |
$post_meta = get_post_meta($post->ID, 'schema_faqs_ques_ans_data', true);
|
22 |
$post_meta = str_replace("\'","'",$post_meta);
|
65 |
|
66 |
if(isset($sd_data['saswp-taqyeem']) && $sd_data['saswp-taqyeem'] == 1 && function_exists('taqyeem_review_get_rich_snippet')){
|
67 |
|
68 |
+
$get_meta = get_post_custom( $post->ID );
|
69 |
+
|
70 |
+
if( !empty( $get_meta['taq_review_position'][0] ) ){
|
71 |
+
$input1 = taqyeem_review_get_rich_snippet();
|
72 |
+
}
|
73 |
+
|
74 |
}
|
75 |
|
76 |
return apply_filters('saswp_modify_taqeem_default_schema', $input1);
|
output/output.php
CHANGED
@@ -557,6 +557,24 @@ function saswp_schema_output() {
|
|
557 |
|
558 |
break;
|
559 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
560 |
case 'HinduTemple':
|
561 |
|
562 |
$input1['@context'] = saswp_context_url();
|
@@ -620,7 +638,9 @@ function saswp_schema_output() {
|
|
620 |
$input1['jobLocation']['@type'] = 'Place';
|
621 |
$input1['jobLocation']['address']['@type'] = 'PostalAddress';
|
622 |
$input1['baseSalary']['@type'] = 'MonetaryAmount';
|
623 |
-
$input1['baseSalary']['value']['@type'] = 'QuantitativeValue';
|
|
|
|
|
624 |
|
625 |
$input1 = apply_filters('saswp_modify_jobposting_schema_output', $input1 );
|
626 |
|
557 |
|
558 |
break;
|
559 |
|
560 |
+
case 'BuddhistTemple':
|
561 |
+
|
562 |
+
$input1['@context'] = saswp_context_url();
|
563 |
+
$input1['@type'] = 'BuddhistTemple';
|
564 |
+
$input1['@id'] = trailingslashit(saswp_get_permalink()).'#BuddhistTemple';
|
565 |
+
$input1['address']['@type'] = 'PostalAddress';
|
566 |
+
|
567 |
+
$input1 = apply_filters('saswp_modify_buddhist_temple_schema_output', $input1 );
|
568 |
+
|
569 |
+
$input1 = saswp_get_modified_markup($input1, $schema_type, $schema_post_id, $schema_options);
|
570 |
+
|
571 |
+
if($modified_schema == 1){
|
572 |
+
|
573 |
+
$input1 = saswp_buddhist_temple_schema_markup($schema_post_id, get_the_ID(), $all_post_meta);
|
574 |
+
}
|
575 |
+
|
576 |
+
break;
|
577 |
+
|
578 |
case 'HinduTemple':
|
579 |
|
580 |
$input1['@context'] = saswp_context_url();
|
638 |
$input1['jobLocation']['@type'] = 'Place';
|
639 |
$input1['jobLocation']['address']['@type'] = 'PostalAddress';
|
640 |
$input1['baseSalary']['@type'] = 'MonetaryAmount';
|
641 |
+
$input1['baseSalary']['value']['@type'] = 'QuantitativeValue';
|
642 |
+
$input1['estimatedSalary']['@type'] = 'MonetaryAmount';
|
643 |
+
$input1['estimatedSalary']['value']['@type'] = 'QuantitativeValue';
|
644 |
|
645 |
$input1 = apply_filters('saswp_modify_jobposting_schema_output', $input1 );
|
646 |
|
output/service.php
CHANGED
@@ -1279,21 +1279,21 @@ Class saswp_output_service{
|
|
1279 |
$input1['offers']['url'] = $custom_fields['saswp_event_schema_url'];
|
1280 |
}
|
1281 |
|
1282 |
-
if(isset($custom_fields['
|
1283 |
|
1284 |
$input1['organizer']['@type'] = 'Organization';
|
1285 |
|
1286 |
-
if(isset($custom_fields['
|
1287 |
-
$input1['organizer']['name'] = $custom_fields['
|
1288 |
}
|
1289 |
-
if(isset($custom_fields['
|
1290 |
-
$input1['organizer']['url'] = $custom_fields['
|
1291 |
}
|
1292 |
-
if(isset($custom_fields['
|
1293 |
-
$input1['organizer']['email'] = $custom_fields['
|
1294 |
}
|
1295 |
-
if(isset($custom_fields['
|
1296 |
-
$input1['organizer']['telephone'] = $custom_fields['
|
1297 |
}
|
1298 |
}
|
1299 |
|
@@ -2116,6 +2116,49 @@ Class saswp_output_service{
|
|
2116 |
}
|
2117 |
|
2118 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2119 |
|
2120 |
case 'Church':
|
2121 |
|
@@ -2568,6 +2611,15 @@ Class saswp_output_service{
|
|
2568 |
if(isset($custom_fields['saswp_jobposting_schema_bs_unittext'])){
|
2569 |
$input1['baseSalary']['value']['unitText'] = $custom_fields['saswp_jobposting_schema_bs_unittext'];
|
2570 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2571 |
if(isset($custom_fields['saswp_jobposting_schema_validthrough']) && date('Y-m-d',strtotime($custom_fields['saswp_jobposting_schema_validthrough'])) < date('Y-m-d') ){
|
2572 |
$input1 = array();
|
2573 |
}
|
@@ -2782,15 +2834,15 @@ Class saswp_output_service{
|
|
2782 |
|
2783 |
if($product->get_short_description() && $product->get_description()){
|
2784 |
|
2785 |
-
$product_desc = $product->get_short_description().' '
|
2786 |
|
2787 |
}else if($product->get_description()){
|
2788 |
|
2789 |
-
$product_desc =
|
2790 |
|
2791 |
}else{
|
2792 |
|
2793 |
-
$product_desc =
|
2794 |
|
2795 |
}
|
2796 |
|
@@ -2798,7 +2850,7 @@ Class saswp_output_service{
|
|
2798 |
$product_desc = saswp_get_the_excerpt();
|
2799 |
}
|
2800 |
|
2801 |
-
$product_details['product_description'] = $product_desc;
|
2802 |
|
2803 |
if($product->get_attributes()){
|
2804 |
|
1279 |
$input1['offers']['url'] = $custom_fields['saswp_event_schema_url'];
|
1280 |
}
|
1281 |
|
1282 |
+
if(isset($custom_fields['saswp_event_schema_organizer_name']) || isset($custom_fields['saswp_event_schema_organizer_url']) || isset($custom_fields['saswp_event_schema_organizer_email']) || isset($custom_fields['saswp_event_schema_organizer_phone'])){
|
1283 |
|
1284 |
$input1['organizer']['@type'] = 'Organization';
|
1285 |
|
1286 |
+
if(isset($custom_fields['saswp_event_schema_organizer_name'])){
|
1287 |
+
$input1['organizer']['name'] = $custom_fields['saswp_event_schema_organizer_name'];
|
1288 |
}
|
1289 |
+
if(isset($custom_fields['saswp_event_schema_organizer_url'])){
|
1290 |
+
$input1['organizer']['url'] = $custom_fields['saswp_event_schema_organizer_url'];
|
1291 |
}
|
1292 |
+
if(isset($custom_fields['saswp_event_schema_organizer_email'])){
|
1293 |
+
$input1['organizer']['email'] = $custom_fields['saswp_event_schema_organizer_email'];
|
1294 |
}
|
1295 |
+
if(isset($custom_fields['saswp_event_schema_organizer_phone'])){
|
1296 |
+
$input1['organizer']['telephone'] = $custom_fields['saswp_event_schema_organizer_phone'];
|
1297 |
}
|
1298 |
}
|
1299 |
|
2116 |
}
|
2117 |
|
2118 |
break;
|
2119 |
+
|
2120 |
+
case 'BuddhistTemple':
|
2121 |
+
|
2122 |
+
if(isset($custom_fields['saswp_buddhisttemple_schema_name'])){
|
2123 |
+
$input1['name'] = $custom_fields['saswp_buddhisttemple_schema_name'];
|
2124 |
+
}
|
2125 |
+
if(isset($custom_fields['saswp_buddhisttemple_schema_description'])){
|
2126 |
+
$input1['description'] = wp_strip_all_tags(strip_shortcodes( $custom_fields['saswp_buddhisttemple_schema_description'] ));
|
2127 |
+
}
|
2128 |
+
if(isset($custom_fields['saswp_buddhisttemple_schema_image'])){
|
2129 |
+
$input1['image'] = $custom_fields['saswp_buddhisttemple_schema_image'];
|
2130 |
+
}
|
2131 |
+
if(isset($custom_fields['saswp_buddhisttemple_schema_url'])){
|
2132 |
+
$input1['url'] = $custom_fields['saswp_buddhisttemple_schema_url'];
|
2133 |
+
}
|
2134 |
+
if(isset($custom_fields['saswp_buddhisttemple_schema_hasmap'])){
|
2135 |
+
$input1['hasMap'] = $custom_fields['saswp_buddhisttemple_schema_hasmap'];
|
2136 |
+
}
|
2137 |
+
if(isset($custom_fields['saswp_buddhisttemple_schema_is_accesible_free'])){
|
2138 |
+
$input1['isAccessibleForFree'] = $custom_fields['saswp_buddhisttemple_schema_is_accesible_free'];
|
2139 |
+
}
|
2140 |
+
if(isset($custom_fields['saswp_buddhisttemple_schema_maximum_a_capacity'])){
|
2141 |
+
$input1['maximumAttendeeCapacity'] = $custom_fields['saswp_buddhisttemple_schema_maximum_a_capacity'];
|
2142 |
+
}
|
2143 |
+
if(isset($custom_fields['saswp_buddhisttemple_schema_locality'])){
|
2144 |
+
$input1['address']['addressLocality'] = $custom_fields['saswp_buddhisttemple_schema_locality'];
|
2145 |
+
}
|
2146 |
+
if(isset($custom_fields['saswp_buddhisttemple_schema_region'])){
|
2147 |
+
$input1['address']['addressRegion'] = $custom_fields['saswp_buddhisttemple_schema_region'];
|
2148 |
+
}
|
2149 |
+
if(isset($custom_fields['saswp_buddhisttemple_schema_country'])){
|
2150 |
+
$input1['address']['addressCountry'] = $custom_fields['saswp_buddhisttemple_schema_country'];
|
2151 |
+
}
|
2152 |
+
if(isset($custom_fields['saswp_buddhisttemple_schema_postal_code'])){
|
2153 |
+
$input1['address']['PostalCode'] = $custom_fields['saswp_buddhisttemple_schema_postal_code'];
|
2154 |
+
}
|
2155 |
+
if(isset($custom_fields['saswp_buddhisttemple_schema_latitude']) && isset($custom_fields['saswp_buddhisttemple_schema_longitude'])){
|
2156 |
+
$input1['geo']['@type'] = 'GeoCoordinates';
|
2157 |
+
$input1['geo']['latitude'] = $custom_fields['saswp_buddhisttemple_schema_latitude'];
|
2158 |
+
$input1['geo']['longitude'] = $custom_fields['saswp_buddhisttemple_schema_longitude'];
|
2159 |
+
}
|
2160 |
+
|
2161 |
+
break;
|
2162 |
|
2163 |
case 'Church':
|
2164 |
|
2611 |
if(isset($custom_fields['saswp_jobposting_schema_bs_unittext'])){
|
2612 |
$input1['baseSalary']['value']['unitText'] = $custom_fields['saswp_jobposting_schema_bs_unittext'];
|
2613 |
}
|
2614 |
+
if(isset($custom_fields['saswp_jobposting_schema_es_currency'])){
|
2615 |
+
$input1['estimatedSalary']['currency'] = $custom_fields['saswp_jobposting_schema_es_currency'];
|
2616 |
+
}
|
2617 |
+
if(isset($custom_fields['saswp_jobposting_schema_es_value'])){
|
2618 |
+
$input1['estimatedSalary']['value']['value'] = $custom_fields['saswp_jobposting_schema_es_value'];
|
2619 |
+
}
|
2620 |
+
if(isset($custom_fields['saswp_jobposting_schema_es_unittext'])){
|
2621 |
+
$input1['estimatedSalary']['value']['unitText'] = $custom_fields['saswp_jobposting_schema_es_unittext'];
|
2622 |
+
}
|
2623 |
if(isset($custom_fields['saswp_jobposting_schema_validthrough']) && date('Y-m-d',strtotime($custom_fields['saswp_jobposting_schema_validthrough'])) < date('Y-m-d') ){
|
2624 |
$input1 = array();
|
2625 |
}
|
2834 |
|
2835 |
if($product->get_short_description() && $product->get_description()){
|
2836 |
|
2837 |
+
$product_desc = $product->get_short_description().' '.$product->get_description();
|
2838 |
|
2839 |
}else if($product->get_description()){
|
2840 |
|
2841 |
+
$product_desc = $product->get_description();
|
2842 |
|
2843 |
}else{
|
2844 |
|
2845 |
+
$product_desc = get_the_excerpt();
|
2846 |
|
2847 |
}
|
2848 |
|
2850 |
$product_desc = saswp_get_the_excerpt();
|
2851 |
}
|
2852 |
|
2853 |
+
$product_details['product_description'] = wp_strip_all_tags(strip_shortcodes($product_desc));
|
2854 |
|
2855 |
if($product->get_attributes()){
|
2856 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: magazine3
|
|
3 |
Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.4
|
6 |
-
Stable tag: 1.9.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -120,6 +120,20 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
|
|
120 |
|
121 |
== Changelog ==
|
122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
= 1.9.38 (29 May 2020) =
|
124 |
|
125 |
* Fixed: Warning is showing - The organizer field is recommended in event schema #1006
|
3 |
Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.4
|
6 |
+
Stable tag: 1.9.39
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
120 |
|
121 |
== Changelog ==
|
122 |
|
123 |
+
= 1.9.39 (04 June 2020) =
|
124 |
+
|
125 |
+
* Fixed: Placement: Post type equal to page should not apply to custom front page #1038
|
126 |
+
* Fixed: Uncaught Error: [ ] operator not supported for strings in admin_section/settings.php line 23 #1037
|
127 |
+
* Fixed: fix an issue with Image block of Gutenberg #1035
|
128 |
+
* Fixed: WP Recipe card is not visible in Structured data test for the amp post - Proper parent conditioning #1034
|
129 |
+
* Fixed: Review schema is added in the markup when it is not enabled on the post - Taqyeem compatibility. #1036
|
130 |
+
* Fixed: Description includes HTML in the itemlist-webpage schema. #1024
|
131 |
+
* Added: Image resizer option in gutenberg how-to(SASWP) Block #1018
|
132 |
+
* Added: Buddhist schema type #985
|
133 |
+
* Added: Estimated salary property in Jobposting schema type. #989
|
134 |
+
* Enhancement: Rating form rating value should be 5 by default. #1033
|
135 |
+
|
136 |
+
|
137 |
= 1.9.38 (29 May 2020) =
|
138 |
|
139 |
* Fixed: Warning is showing - The organizer field is recommended in event schema #1006
|
structured-data-for-wp.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Schema & Structured Data for WP & AMP
|
4 |
Description: Schema & Structured Data adds Google Rich Snippets markup according to Schema.org guidelines to structure your site for SEO. (AMP Compatible)
|
5 |
-
Version: 1.9.
|
6 |
Text Domain: schema-and-structured-data-for-wp
|
7 |
Domain Path: /languages
|
8 |
Author: Magazine3
|
@@ -13,7 +13,7 @@ License: GPL2
|
|
13 |
// Exit if accessed directly.
|
14 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
15 |
|
16 |
-
define('SASWP_VERSION', '1.9.
|
17 |
define('SASWP_DIR_NAME_FILE', __FILE__ );
|
18 |
define('SASWP_DIR_NAME', dirname( __FILE__ ));
|
19 |
define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
|
2 |
/*
|
3 |
Plugin Name: Schema & Structured Data for WP & AMP
|
4 |
Description: Schema & Structured Data adds Google Rich Snippets markup according to Schema.org guidelines to structure your site for SEO. (AMP Compatible)
|
5 |
+
Version: 1.9.39
|
6 |
Text Domain: schema-and-structured-data-for-wp
|
7 |
Domain Path: /languages
|
8 |
Author: Magazine3
|
13 |
// Exit if accessed directly.
|
14 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
15 |
|
16 |
+
define('SASWP_VERSION', '1.9.39');
|
17 |
define('SASWP_DIR_NAME_FILE', __FILE__ );
|
18 |
define('SASWP_DIR_NAME', dirname( __FILE__ ));
|
19 |
define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
|