Schema & Structured Data for WP & AMP - Version 1.8.5

Version Description

(28 May 2019) =

  • Added: Person schema type #220
  • Added: Trip schema type #289
  • Added: JobPosting schema type #289
  • Added: Author fields should have description field #275
  • Added: Homepage selection in the "Placement" dropdown #280
  • Bug Fixed: Remove shortcode and share button text from schema markup description #250
  • Bug Fixed: Modify schema does not take default description #295
  • Bug Fixed: saswp-style.css should only load wherever its need #287
  • Bug Fixed: Unspecified Type error when defragmentation is enabled and website schema is disabled #291
  • Improvement: getimagesize function improvement #278
  • Improvement: Site Navigation Menu option should have list of menus to be added in schema markup #272
  • Improvement: If Yoast compatibility is on make sure, We skip the schema of the Yoast, not the whole metadata and og tags #288
  • Improvement: If target location is empty than by default target location should be post #292
  • Improvement: An option for adding own custom json schema markup on every post along with current schema #274
Download this release

Release Info

Developer magazine3
Plugin Icon 128x128 Schema & Structured Data for WP & AMP
Version 1.8.5
Comparing to
See all releases

Code changes from version 1.8.4 to 1.8.5

admin_section/ajax-selectbox.php CHANGED
@@ -50,6 +50,15 @@ function saswp_ajax_select_creator($data = '', $saved_data= '', $current_number
50
  unset($choices['saswp']);
51
 
52
  break;
 
 
 
 
 
 
 
 
 
53
 
54
  case "page":
55
 
50
  unset($choices['saswp']);
51
 
52
  break;
53
+
54
+ case "homepage":
55
+
56
+ $choices = array(
57
+ 'true' => 'True',
58
+ 'false' => 'False',
59
+ );
60
+
61
+ break;
62
 
63
  case "page":
64
 
admin_section/common-function.php CHANGED
@@ -1335,10 +1335,32 @@ function saswp_defaultSettings(){
1335
  return $settings;
1336
 
1337
  }
1338
- function saswp_frontend_enqueue(){
1339
- wp_enqueue_style( 'saswp-style', SASWP_PLUGIN_URL . 'admin_section/css/saswp-style.css', false , SASWP_VERSION );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1340
 
1341
  }
 
1342
  add_action( 'wp_enqueue_scripts', 'saswp_frontend_enqueue' );
1343
 
1344
  function saswp_enque_amp_script(){
@@ -1640,30 +1662,78 @@ function saswp_frontend_enqueue(){
1640
  return $aurthor_name;
1641
  }
1642
 
1643
- function saswp_get_attachment_details_by_url($url, $post_id = '',$count='') {
1644
 
1645
  $response = array();
1646
 
1647
- $cached_data = get_transient('saswp_imageobject_' .$post_id.'_'.$count );
1648
 
1649
  if (empty($cached_data)) {
1650
-
 
 
 
1651
  $image = @getimagesize($url);
1652
-
1653
- $response[0] = $image[0]; //width
1654
- $response[1] = $image[1]; //height
 
1655
 
1656
- if(empty($image) || $image == false){
1657
- $img_id = attachment_url_to_postid($url);
1658
- $imageDetail = wp_get_attachment_image_src( $img_id , 'full');
1659
- $response[0] = $imageDetail[1]; // width
1660
- $response[1] = $imageDetail[2]; // height
 
 
 
 
 
1661
  }
1662
- set_transient('saswp_imageobject_' .$post_id.'_'.$count, $response, 24*30*HOUR_IN_SECONDS );
 
1663
 
1664
  $cached_data = $response;
1665
  }
1666
 
1667
  return $cached_data;
1668
 
1669
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1335
  return $settings;
1336
 
1337
  }
1338
+ function saswp_frontend_enqueue(){
1339
+
1340
+ global $sd_data;
1341
+
1342
+
1343
+ if(isset($sd_data['saswp-review-module']) && $sd_data['saswp-review-module'] == 1){
1344
+
1345
+ $review_details = esc_sql ( get_post_meta(get_the_ID(), 'saswp_review_details', true));
1346
+
1347
+ if(isset($review_details['saswp-review-item-enable'])){
1348
+
1349
+ wp_enqueue_style( 'saswp-style', SASWP_PLUGIN_URL . 'admin_section/css/saswp-style.min.css', false , SASWP_VERSION );
1350
+
1351
+ }
1352
+
1353
+ }
1354
+
1355
+ if(isset($sd_data['saswp-google-review']) && $sd_data['saswp-google-review'] == 1 ){
1356
+
1357
+ wp_enqueue_style( 'saswp-style', SASWP_PLUGIN_URL . 'admin_section/css/saswp-style.min.css', false , SASWP_VERSION );
1358
+
1359
+ }
1360
+
1361
 
1362
  }
1363
+
1364
  add_action( 'wp_enqueue_scripts', 'saswp_frontend_enqueue' );
1365
 
1366
  function saswp_enque_amp_script(){
1662
  return $aurthor_name;
1663
  }
1664
 
1665
+ function saswp_get_attachment_details($attachments, $post_id = null) {
1666
 
1667
  $response = array();
1668
 
1669
+ $cached_data = get_transient('saswp_imageobject_' .$post_id);
1670
 
1671
  if (empty($cached_data)) {
1672
+
1673
+ foreach ($attachments as $url){
1674
+
1675
+ $image_data = array();
1676
  $image = @getimagesize($url);
1677
+
1678
+ $image_data[0] = $image[0]; //width
1679
+ $image_data[1] = $image[1]; //height
1680
+
1681
 
1682
+ if(empty($image) || $image == false){
1683
+
1684
+ $img_id = attachment_url_to_postid($url);
1685
+ $imageDetail = wp_get_attachment_image_src( $img_id , 'full');
1686
+ $image_data[0] = $imageDetail[1]; // width
1687
+ $image_data[1] = $imageDetail[2]; // height
1688
+
1689
+ }
1690
+
1691
+ $response[] = $image_data;
1692
  }
1693
+
1694
+ set_transient('saswp_imageobject_' .$post_id, $response, 24*30*HOUR_IN_SECONDS );
1695
 
1696
  $cached_data = $response;
1697
  }
1698
 
1699
  return $cached_data;
1700
 
1701
+ }
1702
+ /**
1703
+ * Here we are modifying the default excerpt
1704
+ * @global type $post
1705
+ * @return type
1706
+ */
1707
+ function saswp_get_the_excerpt() {
1708
+
1709
+ global $post;
1710
+ $excerpt = '';
1711
+ if(is_object($post)){
1712
+
1713
+ $excerpt = $post->post_excerpt;
1714
+
1715
+ if(empty($excerpt)){
1716
+
1717
+ $excerpt_length = apply_filters( 'excerpt_length', 55 );
1718
+
1719
+ $excerpt_more = '';
1720
+ $excerpt = wp_trim_words( $post->post_content, $excerpt_length, $excerpt_more );
1721
+ }
1722
+
1723
+ if(strpos($excerpt, "<p>")!==false){
1724
+
1725
+ $regex = '/<p>(.*?)<\/p>/';
1726
+ preg_match_all($regex, $excerpt, $matches);
1727
+
1728
+ if(is_array($matches[1])){
1729
+ $excerpt = implode(" ", $matches[1]);
1730
+ }
1731
+
1732
+ }
1733
+
1734
+ $excerpt = wp_strip_all_tags(strip_shortcodes($excerpt));
1735
+
1736
+ }
1737
+
1738
+ return $excerpt;
1739
+ }
admin_section/css/main-style.css CHANGED
@@ -965,7 +965,16 @@ Google review module ends here
965
  font-size: 20px;
966
  top: -5px;
967
  text-decoration:none;
968
- }
 
 
 
 
 
 
 
 
 
969
  /*** How to schema css starts here ***/
970
 
971
  .saswp-how-to-supply-table-div,
@@ -975,6 +984,7 @@ Google review module ends here
975
  .saswp-tvseries-season-table-div,
976
  .saswp-mc-symptom-table-div,
977
  .saswp-mc-risk_factor-table-div,
 
978
  .saswp-mc-cause-table-div
979
  {
980
  border: 1px solid #aaa;
@@ -989,5 +999,8 @@ Google review module ends here
989
  .saswp-table-create-onajax table th, .saswp-table-create-onajax table td{
990
  padding: 5px;
991
  }
 
 
 
992
 
993
  /*** How to schema css ends here ***/
965
  font-size: 20px;
966
  top: -5px;
967
  text-decoration:none;
968
+ }
969
+ .saswp-add-custom-schema-div{
970
+ margin-top: 10px;
971
+ border-top: 1px solid #eee;
972
+ padding-top: 5px;
973
+ }
974
+
975
+ .saswp-nav-menu-list label{
976
+ padding-left: 10px;
977
+ }
978
  /*** How to schema css starts here ***/
979
 
980
  .saswp-how-to-supply-table-div,
984
  .saswp-tvseries-season-table-div,
985
  .saswp-mc-symptom-table-div,
986
  .saswp-mc-risk_factor-table-div,
987
+ .saswp-trip-itinerary-table-div,
988
  .saswp-mc-cause-table-div
989
  {
990
  border: 1px solid #aaa;
999
  .saswp-table-create-onajax table th, .saswp-table-create-onajax table td{
1000
  padding: 5px;
1001
  }
1002
+ .saswp-table-create-onajax select{
1003
+ width: 98%;
1004
+ }
1005
 
1006
  /*** How to schema css ends here ***/
admin_section/css/saswp-style.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .saswp-pc-wrap{background-color:#004f74;padding:15px 15px 15px 30px;color:#fff;display:inline-flex;width:100%;flex-wrap:wrap;margin-bottom:20px}.saswp-pc-wrap .saswp-lst span{font-size:18px;font-weight:500;margin-bottom:10px;display:inline-block;line-height:1.3}.saswp-pc-wrap .saswp-lst{flex:1 0 42%}.saswp-pc-wrap .saswp-lst ul{margin:0}.saswp-pc-wrap .saswp-lst p{list-style-type:none;font-size:15px;font-weight:lighter;line-height:1.2;margin-bottom:10px;position:relative;padding-left:20px;color:#eee}.saswp-pc-wrap .saswp-lst p:before{content:'';position:absolute;width:8px;height:8px;background-color:#ccc;left:0;top:6px;border-radius:10px}.sgl .saswp-rvw{width:100%;margin-bottom:34px;font-size:13px;border-bottom:1px solid #ededed}.saswp-rvw-hd span,.saswp-rvw-sm span{background-color:#222;color:#fff;display:inline-block;font-size:15px}.saswp-rvw-hd span{line-height:1.4;padding:8px 12px 6px;margin:26px 0}.saswp-rvw td{padding:7px 14px}.saswp-rvw td,.sgl table td{border:1px solid #ededed}.saswp-rvw tbody{width:100%}.saswp-rvw-sm span{padding:8px 12px 6px;margin-bottom:13px;position:relative;line-height:1.2}.saswp-rvw-fs{line-height:1.5;font-size:48px;font-weight:600;margin-bottom:5px}.saswp-rvw-ov .ovs{font-size:11px;font-weight:600}.sgl .saswp-rvw tr td{background:#fff;width:100%}.sgl .saswp-rvw tr:hover td{background-color:#fcfcfc}.saswp-rvw .saswp-rvw-sm{padding:21px 14px}.str-ic{font-size:18px;line-height:1.2}.saswp-rvw-str{display:inline-flex;width:100%}.saswp-rvw-str .df-clr,.saswp-rvw-str .half-str,.saswp-rvw-str .str-ic{display:inline-block;width:20px;height:16px;background-repeat:no-repeat}.saswp-rvw-ov{text-align:center}.saswp-rvw-str .half-str{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cGF0aCBkPSJNNDgyLjIwNywxODYuOTczbC0xNTkuNjk5LTMzLjcwNUwyNDEuMTA0LDExLjgwM2wtODEuNDA0LDE0MS40NjVMMCwxODYuOTczbDEwOS4zODgsMTIxLjEzNEw5Mi4wOTQsNDcwLjQwNGwxNDkuMDEtNjYuNiAgbDE0OS4wMSw2Ni42bC0xNy4yOTQtMTYyLjI5Nkw0ODIuMjA3LDE4Ni45NzN6IE0yNDEuMTA0LDM3MC45NDNWNzEuOTUzbDYyLjA5LDEwNy45TDQyNSwyMDUuNTYxbC04My40MzMsOTIuMzkzbDEzLjE5MSwxMjMuNzg4ICBMMjQxLjEwNCwzNzAuOTQzeiIgZmlsbD0iI2ZmZDcwMCIvPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K)}.saswp-rvw-str .str-ic{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cG9seWdvbiBwb2ludHM9IjQ4Mi4yMDcsMTg2Ljk3MyAzMjIuNTA4LDE1My4yNjkgMjQxLjEwNCwxMS44MDMgMTU5LjY5OSwxNTMuMjY5IDAsMTg2Ljk3MyAxMDkuMzg4LDMwOC4xMDggOTIuMDk0LDQ3MC40MDQgICAyNDEuMTA0LDQwMy44MDMgMzkwLjExMyw0NzAuNDA0IDM3Mi44MTgsMzA4LjEwOCAiIGZpbGw9IiNmZmQ3MDAiLz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==)}.saswp-rvw-str .df-clr{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cG9seWdvbiBwb2ludHM9IjQ4Mi4yMDcsMTg2Ljk3MyAzMjIuNTA4LDE1My4yNjkgMjQxLjEwNCwxMS44MDMgMTU5LjY5OSwxNTMuMjY5IDAsMTg2Ljk3MyAxMDkuMzg4LDMwOC4xMDggOTIuMDk0LDQ3MC40MDQgICAyNDEuMTA0LDQwMy44MDMgMzkwLjExMyw0NzAuNDA0IDM3Mi44MTgsMzA4LjEwOCAiIGZpbGw9IiM2MzVlNjMiLz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==)}.saswp-g-review-header{margin-top:50px}.saswp-g-review-body{display:inline-grid;grid-template-columns:1fr 300px;grid-gap:30px;margin-top:30px;width:100%}.saswp-channel-list{margin-right:15px}.saswp-input-fields{display:inline-flex;align-items:center;margin-bottom:8px;width:100%}.saswp-input-fields label{width:130px}.saswp-panel h3{font-size:20px;line-height:1.4;color:#222;text-align:center;margin:10px 0 20px 0}.saswp-input-fields a.button-primary{margin-top:10px}.saswp-glg-review-body{display:grid;grid-template-columns:100px 1fr;grid-gap:20px;background:#fff;padding:20px;box-shadow:0 0 20px 1px #d2cccc;margin-bottom:30px}.saswp-g-plus{float:right;font-size:15px;width:20px;height:20px}.saswp-g-plus img{width:100%}.saswp-rtng{padding-left:5px;font-size:14px}.saswp-pt-dt{font-size:12px;color:#999;font-weight:600;margin-top:5px;display:inline-block}.saswp-athr{font-size:15px;line-height:1.4;color:#000;font-weight:700;display:inline-block;vertical-align:middle}.saswp-str-rtng .saswp-rvw-str{display:inline-block;vertical-align:middle;padding-left:10px;width:auto}.widget-area .saswp-str-rtng .saswp-rvw-str{padding:10px 0 0 0}.saswp-rv-cnt p{font-size:16px;line-height:1.6;color:#000;margin:10px 0 0 0}.saswp-rv-img img{max-width:100px}.widget-area .saswp-rv-img img{max-width:50px}.widget-area .saswp-glg-review-body{display:inline-block;width:100%}.widget-area .saswp-rv-img{width:60px;float:left}
admin_section/fields-generator.php CHANGED
@@ -20,7 +20,7 @@ class saswp_fields_generator {
20
 
21
  return $tooltip_message;
22
  }
23
- public function saswp_field_generator( $meta_fields, $settings ) {
24
 
25
  $output = '';
26
  $tooltip_message = '';
@@ -218,6 +218,32 @@ class saswp_fields_generator {
218
  // }
219
 
220
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  echo '<div><div class="saswp-settings-list"><ul>' . wp_kses($output, $allowed_html) . '</ul></div></div>';
222
  }
223
  }
20
 
21
  return $tooltip_message;
22
  }
23
+ public function saswp_field_generator( $meta_fields, $settings, $field_type = null ) {
24
 
25
  $output = '';
26
  $tooltip_message = '';
218
  // }
219
 
220
  }
221
+ if($field_type == 'general'){
222
+
223
+ $locations = get_nav_menu_locations();
224
+
225
+ if($locations){
226
+
227
+ foreach ($locations as $type => $id){
228
+
229
+ $checked = '';
230
+
231
+ if(isset($settings['saswp-'.$type])){
232
+ $checked = 'checked';
233
+ }
234
+
235
+ $output .= '<li class="saswp-nav-menu-list"><div class="saswp-knowledge-label"><label>'.wp_get_nav_menu_name($type).'</label></div>'
236
+ . '<div class="saswp-knowledge-field">'
237
+ . '<input type="checkbox" name="sd_data[saswp-'.$type.']" class="regular-text" value="1" '.$checked.'>'
238
+ . '</div>'
239
+ . '</li>';
240
+
241
+ }
242
+
243
+ }
244
+
245
+ }
246
+
247
  echo '<div><div class="saswp-settings-list"><ul>' . wp_kses($output, $allowed_html) . '</ul></div></div>';
248
  }
249
  }
admin_section/js/main-script.js CHANGED
@@ -328,9 +328,11 @@ jQuery(document).ready(function($){
328
  case 'saswp_site_navigation_menu_checkbox':
329
 
330
  if ($(this).is(':checked')) {
331
- $("#saswp_site_navigation_menu").val(1);
 
332
  }else{
333
  $("#saswp_site_navigation_menu").val(0);
 
334
  }
335
  break;
336
 
@@ -899,24 +901,23 @@ jQuery(document).ready(function($){
899
  }
900
  $('.saswp-local-schema-time-picker').timepicker({ 'timeFormat': 'H:i:s'});
901
 
902
- $(".saswp_custom_schema_post_enable").on("click", function(e){
903
 
904
  e.preventDefault();
905
 
906
- var current = $(this);
907
- current.addClass('updating-message');
908
- e.preventDefault();
909
- $.get(ajaxurl,
910
- { action:"saswp_custom_schema_post_enable", post_id: saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
911
- function(response){
912
- current.remove();
913
- $("#post_specific .inside").append(response);
914
- current.removeClass('updating-message');
915
- $(".saswp-modify_schema_post_enable").remove();
916
- });
917
 
 
918
 
919
-
 
 
 
920
  });
921
 
922
  $(".saswp-modify_schema_post_enable").on("click", function(e){
@@ -927,7 +928,7 @@ jQuery(document).ready(function($){
927
  { action:"saswp_modify_schema_post_enable", post_id: saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
928
  function(response){
929
  current.remove();
930
- $(".saswp_custom_schema_post_enable").remove();
931
  $("#post_specific .inside").append(response);
932
  current.removeClass('updating-message');
933
  saswpAddTimepicker();
@@ -1087,6 +1088,61 @@ jQuery(document).ready(function($){
1087
  });
1088
 
1089
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1090
  //TvSeries schema starts here
1091
 
1092
  $(document).on("click", ".saswp-tvseries-actor", function(e){
@@ -1218,7 +1274,7 @@ jQuery(document).ready(function($){
1218
 
1219
  });
1220
 
1221
- $(document).on("click", ".saswp-mc-risk_factor", function(e){
1222
  e.preventDefault();
1223
 
1224
  var schema_id = $(this).attr('data-id');
328
  case 'saswp_site_navigation_menu_checkbox':
329
 
330
  if ($(this).is(':checked')) {
331
+ $("#saswp_site_navigation_menu").val(1);
332
+ $(".saswp-nav-menu-list").show();
333
  }else{
334
  $("#saswp_site_navigation_menu").val(0);
335
+ $(".saswp-nav-menu-list").hide();
336
  }
337
  break;
338
 
901
  }
902
  $('.saswp-local-schema-time-picker').timepicker({ 'timeFormat': 'H:i:s'});
903
 
904
+ $(document).on("click",".saswp-add-custom-schema", function(e){
905
 
906
  e.preventDefault();
907
 
908
+ $(".saswp-add-custom-schema-field").removeClass('saswp_hide');
909
+ $(this).hide();
910
+
911
+ });
912
+
913
+ $(document).on("click", ".saswp-delete-custom-schema", function(e){
 
 
 
 
 
914
 
915
+ e.preventDefault();
916
 
917
+ $("#saswp_custom_schema_field").val('');
918
+ $(".saswp-add-custom-schema-field").addClass('saswp_hide');
919
+ $(".saswp-add-custom-schema").show();
920
+
921
  });
922
 
923
  $(".saswp-modify_schema_post_enable").on("click", function(e){
928
  { action:"saswp_modify_schema_post_enable", post_id: saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
929
  function(response){
930
  current.remove();
931
+ $(".saswp-add-custom-schema-div").remove();
932
  $("#post_specific .inside").append(response);
933
  current.removeClass('updating-message');
934
  saswpAddTimepicker();
1088
  });
1089
 
1090
 
1091
+
1092
+ //Trip schema starts here
1093
+
1094
+ $(document).on("click", ".saswp-trip-itinerary", function(e){
1095
+ e.preventDefault();
1096
+
1097
+ var schema_id = $(this).attr('data-id');
1098
+ var count = $(".saswp-trip-itinerary-table-div").length;
1099
+ var index = $( ".saswp-trip-itinerary-table-div:nth-child("+count+")" ).attr('data-id');
1100
+ index = ++index;
1101
+
1102
+ if(!index){
1103
+ index = 0;
1104
+ }
1105
+
1106
+ var html = '';
1107
+
1108
+ html += '<div class="saswp-trip-itinerary-table-div" data-id="'+index+'">'
1109
+ + '<a class="saswp-table-close">X</a>'
1110
+ + '<table class="form-table saswp-trip-itinerary-table">'
1111
+
1112
+ + '<tr>'
1113
+ + '<th>Itinerary Type</th>'
1114
+ + '<td>'
1115
+ + '<select id="saswp_trip_itinerary_type_'+index+'_'+schema_id+'" name="trip_itinerary_'+schema_id+'['+index+'][saswp_trip_itinerary_type]">'
1116
+ + '<option value="City">City</option>'
1117
+ + '<option value="LandmarksOrHistoricalBuildings">LandmarksOrHistoricalBuildings</option>'
1118
+ + '<option value="AdministrativeArea">AdministrativeArea</option>'
1119
+ + '<option value="LakeBodyOfWater">LakeBodyOfWater</option>'
1120
+ + '</select></td>'
1121
+ + '</tr>'
1122
+
1123
+ + '<tr>'
1124
+ + '<th>Itinerary Name</th><td><input style="width:100%" type="text" id="saswp_trip_itinerary_name_'+index+'_'+schema_id+'" name="trip_itinerary_'+schema_id+'['+index+'][saswp_trip_itinerary_name]"></td>'
1125
+ + '</tr>'
1126
+
1127
+ + '<tr>'
1128
+ + '<th>Itinerary Description</th><td><textarea placeholder="Description" style="width: 100%" id="saswp_trip_itinerary_description_'+index+'_'+schema_id+'" name="trip_itinerary_'+schema_id+'['+index+'][saswp_trip_itinerary_description]" rows="5"></textarea></td>'
1129
+ + '</tr>'
1130
+
1131
+ + '<tr>'
1132
+ + '<th>Itinerary URL</th><td><input style="width:100%" type="text" id="saswp_trip_itinerary_url_'+index+'_'+schema_id+'" name="trip_itinerary_'+schema_id+'['+index+'][saswp_trip_itinerary_url]"></td>'
1133
+ + '</tr>'
1134
+
1135
+ + '</table>'
1136
+ + '</div>';
1137
+ if(html){
1138
+ $('.saswp-trip-itinerary-section[data-id="'+schema_id+'"]').append(html);
1139
+ }
1140
+
1141
+
1142
+ });
1143
+
1144
+ //Trip schema ends here
1145
+
1146
  //TvSeries schema starts here
1147
 
1148
  $(document).on("click", ".saswp-tvseries-actor", function(e){
1274
 
1275
  });
1276
 
1277
+ $(document).on("click", ".saswp-mc-risk_factor", function(e){
1278
  e.preventDefault();
1279
 
1280
  var schema_id = $(this).attr('data-id');
admin_section/settings.php CHANGED
@@ -446,6 +446,7 @@ function saswp_general_page_callback(){
446
 
447
  $settings = saswp_defaultSettings();
448
  $field_objs = new saswp_fields_generator();
 
449
 
450
  $meta_fields_default = array(
451
  array(
@@ -515,8 +516,11 @@ function saswp_general_page_callback(){
515
  'id' => 'saswp_comments_schema',
516
  'name' => 'sd_data[saswp_comments_schema]',
517
  )
518
- ),
519
- array(
 
 
 
520
  'label' => 'Site Navigation Menu',
521
  'id' => 'saswp_site_navigation_menu_checkbox',
522
  'name' => 'saswp_site_navigation_menu_checkbox',
@@ -526,10 +530,8 @@ function saswp_general_page_callback(){
526
  'id' => 'saswp_site_navigation_menu',
527
  'name' => 'sd_data[saswp_site_navigation_menu]',
528
  )
529
- )
530
-
531
- )
532
-
533
  ?>
534
 
535
 
@@ -589,7 +591,7 @@ function saswp_general_page_callback(){
589
 
590
 
591
  echo '<div class="saswp-archive-div">';
592
- $field_objs->saswp_field_generator($meta_fields_default, $settings);
593
  echo '</div>';
594
 
595
  ?>
446
 
447
  $settings = saswp_defaultSettings();
448
  $field_objs = new saswp_fields_generator();
449
+ $locations = get_nav_menu_locations();
450
 
451
  $meta_fields_default = array(
452
  array(
516
  'id' => 'saswp_comments_schema',
517
  'name' => 'sd_data[saswp_comments_schema]',
518
  )
519
+ )
520
+
521
+ );
522
+ if($locations){
523
+ $meta_fields_default[] = array(
524
  'label' => 'Site Navigation Menu',
525
  'id' => 'saswp_site_navigation_menu_checkbox',
526
  'name' => 'saswp_site_navigation_menu_checkbox',
530
  'id' => 'saswp_site_navigation_menu',
531
  'name' => 'sd_data[saswp_site_navigation_menu]',
532
  )
533
+ );
534
+ }
 
 
535
  ?>
536
 
537
 
591
 
592
 
593
  echo '<div class="saswp-archive-div">';
594
+ $field_objs->saswp_field_generator($meta_fields_default, $settings, 'general');
595
  echo '</div>';
596
 
597
  ?>
admin_section/structure_admin.php CHANGED
@@ -1,5 +1,13 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
3
  function saswp_get_saved_schema_ids(){
4
 
5
  $schema_ids = array();
@@ -181,6 +189,14 @@ function saswp_get_all_schema_posts(){
181
 
182
  }
183
 
 
 
 
 
 
 
 
 
184
  $returnData[] = array(
185
  'schema_type' => get_post_meta( $post_id, 'schema_type', true),
186
  'schema_options' => get_post_meta( $post_id, 'schema_options', true),
@@ -266,6 +282,29 @@ function saswp_comparison_logic_checker($input){
266
  }
267
  }
268
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
 
270
  // Logged in User Type
271
  case 'user_type':
@@ -580,6 +619,7 @@ if(is_admin()){
580
  'post_type' => esc_html__("Post Type",'schema-and-structured-data-for-wp'),
581
  'show_globally' => esc_html__("Show Globally",'schema-and-structured-data-for-wp'),
582
  'user_type' => esc_html__("Logged in User Type",'schema-and-structured-data-for-wp'),
 
583
  ),
584
  esc_html__("Post",'schema-and-structured-data-for-wp') => array(
585
  'post' => esc_html__("Post",'schema-and-structured-data-for-wp'),
1
  <?php
2
 
3
+ add_action ( 'save_post' , 'saswp_delete_post_transient' );
4
+
5
+ function saswp_delete_post_transient( $post_id ){
6
+
7
+ delete_transient('saswp_imageobject_' .$post_id);
8
+
9
+ }
10
+
11
  function saswp_get_saved_schema_ids(){
12
 
13
  $schema_ids = array();
189
 
190
  }
191
 
192
+ if(empty($conditions)){
193
+
194
+ $conditions['key_1'] = 'post_type';
195
+ $conditions['key_2'] = 'equal';
196
+ $conditions['key_3'] = 'post';
197
+
198
+ }
199
+
200
  $returnData[] = array(
201
  'schema_type' => get_post_meta( $post_id, 'schema_type', true),
202
  'schema_options' => get_post_meta( $post_id, 'schema_options', true),
282
  }
283
  }
284
  break;
285
+
286
+
287
+ // Posts
288
+ case 'homepage':
289
+
290
+ $homepage ='false';
291
+
292
+ if(is_home() || is_front_page() || ampforwp_is_home()){
293
+ $homepage = 'true';
294
+ }
295
+
296
+ if ( $comparison == 'equal' ) {
297
+ if ( $homepage == $data ) {
298
+ $result = true;
299
+ }
300
+ }
301
+ if ( $comparison == 'not_equal') {
302
+ if ( $homepage != $data ) {
303
+ $result = true;
304
+ }
305
+ }
306
+
307
+ break;
308
 
309
  // Logged in User Type
310
  case 'user_type':
619
  'post_type' => esc_html__("Post Type",'schema-and-structured-data-for-wp'),
620
  'show_globally' => esc_html__("Show Globally",'schema-and-structured-data-for-wp'),
621
  'user_type' => esc_html__("Logged in User Type",'schema-and-structured-data-for-wp'),
622
+ 'homepage' => esc_html__("Homepage", 'schema-and-structured-data-for-wp'),
623
  ),
624
  esc_html__("Post",'schema-and-structured-data-for-wp') => array(
625
  'post' => esc_html__("Post",'schema-and-structured-data-for-wp'),
google_review/google_review.php CHANGED
@@ -142,7 +142,7 @@ class saswp_google_review{
142
  'headline' => get_the_title(),
143
  'name' => get_the_title(),
144
  'url' => get_permalink(),
145
- 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
146
  'copyrightYear' => get_the_time( 'Y' ),
147
  'author' => array(
148
  '@type' => 'Person',
142
  'headline' => get_the_title(),
143
  'name' => get_the_title(),
144
  'url' => get_permalink(),
145
+ 'description' => saswp_get_the_excerpt(),
146
  'copyrightYear' => get_the_time( 'Y' ),
147
  'author' => array(
148
  '@type' => 'Person',
output/function.php CHANGED
@@ -1,13 +1,4 @@
1
  <?php
2
- function saswp_remove_amp_default_structure_data($metadata){
3
-
4
- if(is_array($metadata)){
5
- return array();
6
- }else{
7
- return '';
8
- }
9
- }
10
-
11
  add_filter( 'amp_init', 'saswp_schema_markup_hook_on_init' );
12
  add_action( 'init', 'saswp_schema_markup_hook_on_init');
13
 
@@ -18,7 +9,7 @@ function saswp_schema_markup_hook_on_init() {
18
  global $sd_data;
19
 
20
  if(isset($sd_data['saswp-markup-footer']) && $sd_data['saswp-markup-footer'] == 1){
21
- add_action('wp_footer', 'saswp_schema_markup_output');
22
  add_action( 'amp_post_template_footer' , 'saswp_schema_markup_output' );
23
  }else{
24
  add_action('wp_head', 'saswp_schema_markup_output');
@@ -26,8 +17,7 @@ function saswp_schema_markup_hook_on_init() {
26
  }
27
 
28
  remove_action( 'amp_post_template_head', 'amp_post_template_add_schemaorg_metadata',99,1);
29
- remove_action( 'amp_post_template_footer', 'amp_post_template_add_schemaorg_metadata',99,1);
30
- add_filter( 'amp_post_template_metadata', 'saswp_remove_amp_default_structure_data');
31
  add_action('cooked_amp_head', 'saswp_schema_markup_output');
32
 
33
  if(isset($sd_data['saswp-wppostratings-raring']) && $sd_data['saswp-wppostratings-raring'] == 1){
@@ -71,7 +61,7 @@ function saswp_schema_markup_output() {
71
  if(is_singular()){
72
 
73
  $post_specific_enable = get_option('modify_schema_post_enable_'.esc_attr($post->ID));
74
- $custom_option = get_option('custom_schema_post_enable_'.esc_attr($post->ID));
75
 
76
  }
77
 
@@ -80,11 +70,9 @@ function saswp_schema_markup_output() {
80
  $schema_output = saswp_post_specific_schema_output();
81
 
82
  }else{
83
-
84
- if($custom_option !='enable'){
85
- $schema_output = saswp_schema_output();
86
- }
87
-
88
  }
89
  if(saswp_global_option()) {
90
 
@@ -173,10 +161,13 @@ function saswp_schema_markup_output() {
173
 
174
  if($kb_schema_output){
175
 
176
- $kb_website_output['publisher'] = array(
 
 
177
  '@id' => $kb_schema_output['@id']
178
- );
179
-
 
180
  $soutput['publisher'] = array(
181
  '@id' => $kb_schema_output['@id']
182
  );
@@ -265,25 +256,25 @@ function saswp_schema_markup_output() {
265
 
266
  }
267
 
268
- if($custom_option == 'enable'){
269
-
270
- $custom_output = get_post_meta($post->ID, 'saswp_custom_schema_field', true);
271
-
272
- if($custom_output){
273
-
274
- echo "\n";
275
- echo '<!-- Schema & Structured Data For WP Custom Markup v'.esc_attr(SASWP_VERSION).' - -->';
276
- echo "\n";
277
- echo '<script type="application/ld+json">';
278
- echo "\n";
279
- echo $custom_output;
280
- echo "\n";
281
- echo '</script>';
282
- echo "\n\n";
283
-
284
- }
285
-
286
-
287
  }
288
 
289
 
1
  <?php
 
 
 
 
 
 
 
 
 
2
  add_filter( 'amp_init', 'saswp_schema_markup_hook_on_init' );
3
  add_action( 'init', 'saswp_schema_markup_hook_on_init');
4
 
9
  global $sd_data;
10
 
11
  if(isset($sd_data['saswp-markup-footer']) && $sd_data['saswp-markup-footer'] == 1){
12
+ add_action( 'wp_footer', 'saswp_schema_markup_output');
13
  add_action( 'amp_post_template_footer' , 'saswp_schema_markup_output' );
14
  }else{
15
  add_action('wp_head', 'saswp_schema_markup_output');
17
  }
18
 
19
  remove_action( 'amp_post_template_head', 'amp_post_template_add_schemaorg_metadata',99,1);
20
+ remove_action( 'amp_post_template_footer', 'amp_post_template_add_schemaorg_metadata',99,1);
 
21
  add_action('cooked_amp_head', 'saswp_schema_markup_output');
22
 
23
  if(isset($sd_data['saswp-wppostratings-raring']) && $sd_data['saswp-wppostratings-raring'] == 1){
61
  if(is_singular()){
62
 
63
  $post_specific_enable = get_option('modify_schema_post_enable_'.esc_attr($post->ID));
64
+ $custom_markup = get_post_meta($post->ID, 'saswp_custom_schema_field', true);
65
 
66
  }
67
 
70
  $schema_output = saswp_post_specific_schema_output();
71
 
72
  }else{
73
+
74
+ $schema_output = saswp_schema_output();
75
+
 
 
76
  }
77
  if(saswp_global_option()) {
78
 
161
 
162
  if($kb_schema_output){
163
 
164
+ if($kb_website_output){
165
+
166
+ $kb_website_output['publisher'] = array(
167
  '@id' => $kb_schema_output['@id']
168
+ );
169
+ }
170
+
171
  $soutput['publisher'] = array(
172
  '@id' => $kb_schema_output['@id']
173
  );
256
 
257
  }
258
 
259
+ if($custom_markup){
260
+
261
+ $result = json_decode($custom_markup);
262
+
263
+ if($result != false){
264
+
265
+ echo "\n";
266
+ echo '<!-- Schema & Structured Data For WP Custom Markup v'.esc_attr(SASWP_VERSION).' - -->';
267
+ echo "\n";
268
+ echo '<script type="application/ld+json">';
269
+ echo "\n";
270
+ echo $custom_markup;
271
+ echo "\n";
272
+ echo '</script>';
273
+ echo "\n\n";
274
+
275
+ }
276
+
277
+
278
  }
279
 
280
 
output/output.php CHANGED
@@ -236,9 +236,8 @@ function saswp_schema_output() {
236
  }
237
 
238
  // Generate author id
239
- $author_id = get_the_author_meta('ID');
240
-
241
-
242
  $image_id = get_post_thumbnail_id();
243
  $image_details = wp_get_attachment_image_src($image_id, 'full');
244
  $author_details = get_avatar_data($author_id);
@@ -303,7 +302,10 @@ function saswp_schema_output() {
303
  $schema_type == 'LandmarksOrHistoricalBuildings' ||
304
  $schema_type == 'HinduTemple' ||
305
  $schema_type == 'Church' ||
306
- $schema_type == 'Mosque' ||
 
 
 
307
  $schema_type == 'SingleFamilyResidence' ) {
308
 
309
  $input1 = array();
@@ -311,7 +313,7 @@ function saswp_schema_output() {
311
 
312
  if( 'Course' === $schema_type){
313
 
314
- $description = strip_tags(strip_shortcodes(get_the_excerpt()));
315
 
316
  if(!$description){
317
  $description = get_bloginfo('description');
@@ -358,15 +360,16 @@ function saswp_schema_output() {
358
  '@type' => 'DiscussionForumPosting' ,
359
  '@id' => bbp_get_topic_permalink().'/#discussionforumposting',
360
  'headline' => bbp_get_topic_title(get_the_ID()),
361
- 'description' => wp_strip_all_tags(strip_shortcodes(get_the_excerpt())),
362
  "articleSection" => bbp_get_forum_title(),
363
- "articleBody" => wp_strip_all_tags(strip_shortcodes(get_the_content())),
364
  'url' => bbp_get_topic_permalink(),
365
  'datePublished' => esc_html($date),
366
  'dateModified' => esc_html($modified_date),
367
  'author' => array(
368
  '@type' => 'Person',
369
- 'name' => esc_attr($aurthor_name)
 
370
  ),
371
  'interactionStatistic' => array(
372
  '@type' => 'InteractionCounter',
@@ -382,7 +385,7 @@ function saswp_schema_output() {
382
  '@type' => 'DiscussionForumPosting' ,
383
  '@id' => get_permalink().'/#blogposting',
384
  'headline' => get_the_title(),
385
- 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
386
  'url' => get_permalink(),
387
  'datePublished' => esc_html($date),
388
  'dateModified' => esc_html($modified_date),
@@ -424,14 +427,15 @@ function saswp_schema_output() {
424
  '@id' => get_permalink().'/#blogposting',
425
  'mainEntityOfPage' => get_permalink(),
426
  'headline' => get_the_title(),
427
- 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
428
  'name' => get_the_title(),
429
  'url' => get_permalink(),
430
  'datePublished' => esc_html($date),
431
  'dateModified' => esc_html($modified_date),
432
  'author' => array(
433
  '@type' => 'Person',
434
- 'name' => esc_attr($aurthor_name)
 
435
  )
436
  );
437
  if(!empty($publisher)){
@@ -473,8 +477,9 @@ function saswp_schema_output() {
473
  'datePublished' => esc_html($date),
474
  'dateModified' => esc_html($modified_date),
475
  'author' => array(
476
- '@type' => 'Person',
477
- 'name' => esc_attr($aurthor_name)
 
478
  ),
479
  );
480
  if(!empty($publisher)){
@@ -602,8 +607,9 @@ function saswp_schema_output() {
602
  'datePublished' => esc_html($date),
603
  'dateModified' => esc_html($modified_date),
604
  'author' => array(
605
- '@type' => 'Person',
606
- 'name' => esc_attr($aurthor_name)
 
607
  ),
608
  );
609
 
@@ -711,13 +717,14 @@ function saswp_schema_output() {
711
  'name' => get_the_title(),
712
  'datePublished' => esc_html($date),
713
  'dateModified' => esc_html($modified_date),
714
- 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
715
  'mainEntity' => array(
716
  '@type' => 'WebPage',
717
  '@id' => get_permalink(),
718
  'author' => array(
719
  '@type' => 'Person',
720
  'name' => esc_attr($aurthor_name),
 
721
  'image' => array(
722
  '@type' => 'ImageObject',
723
  'url' => saswp_remove_warnings($author_details, 'url', 'saswp_string'),
@@ -873,9 +880,9 @@ function saswp_schema_output() {
873
  'mainEntityOfPage' => get_the_permalink(),
874
  'datePublished' => esc_html($date),
875
  'dateModified' => esc_html($modified_date),
876
- 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
877
  'articleSection' => $article_section,
878
- 'articleBody' => strip_tags(strip_shortcodes(get_the_excerpt())),
879
  'name' => get_the_title(),
880
  'thumbnailUrl' => saswp_remove_warnings($image_details, 0, 'saswp_string'),
881
  'wordCount' => saswp_remove_warnings($word_count, 'word_count', 'saswp_string'),
@@ -887,12 +894,13 @@ function saswp_schema_output() {
887
  'author' => array(
888
  '@type' => 'Person',
889
  'name' => esc_attr($aurthor_name),
 
890
  'Image' => array(
891
- '@type' => 'ImageObject',
892
- 'url' => saswp_remove_warnings($author_details, 'url', 'saswp_string'),
893
- 'height' => saswp_remove_warnings($author_details, 'height', 'saswp_string'),
894
- 'width' => saswp_remove_warnings($author_details, 'width', 'saswp_string')
895
- )
896
  )
897
  );
898
  if(!empty($publisher)){
@@ -1027,11 +1035,12 @@ function saswp_schema_output() {
1027
  'name' => get_the_title(),
1028
  'keywords' => tie_get_plain_terms( get_the_ID(), 'post_tag' ),
1029
  'url' => get_permalink(),
1030
- 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
1031
  'copyrightYear' => get_the_time( 'Y' ),
1032
  'author' => array(
1033
  '@type' => 'Person',
1034
  'name' => esc_attr($aurthor_name),
 
1035
  'image' => array(
1036
  '@type' => 'ImageObject',
1037
  'url' => saswp_remove_warnings($author_details, 'url', 'saswp_string'),
@@ -1108,8 +1117,8 @@ function saswp_schema_output() {
1108
  $input1['reviewBody'] = $schema_data['saswp_review_schema_description'];
1109
  $input1['description'] = $schema_data['saswp_review_schema_description'];
1110
  }else {
1111
- $input1['reviewBody'] = strip_tags(strip_shortcodes(get_the_excerpt()));
1112
- $input1['description'] = strip_tags(strip_shortcodes(get_the_excerpt()));
1113
  }
1114
 
1115
  if(isset($schema_data['saswp_review_schema_item_type'])){
@@ -1220,8 +1229,7 @@ function saswp_schema_output() {
1220
  $input1['author']['sameAs'] = get_permalink();
1221
 
1222
  }
1223
-
1224
-
1225
  break;
1226
  case 'MusicPlaylist':
1227
  break;
@@ -1287,7 +1295,7 @@ function saswp_schema_output() {
1287
  }
1288
 
1289
  }
1290
- $description = strip_tags(strip_shortcodes(get_the_excerpt()));
1291
 
1292
  if(!$description){
1293
  $description = get_bloginfo('description');
@@ -1311,6 +1319,7 @@ function saswp_schema_output() {
1311
  'author' => array(
1312
  '@type' => 'Person',
1313
  'name' => esc_attr($aurthor_name),
 
1314
  'image' => array(
1315
  '@type' => 'ImageObject',
1316
  'url' => saswp_remove_warnings($author_details, 'url', 'saswp_string'),
@@ -1365,7 +1374,7 @@ function saswp_schema_output() {
1365
  '@id' => get_permalink().'/#'. strtolower(esc_attr($local_business)),
1366
  'name' => saswp_remove_warnings($business_details, 'local_business_name', 'saswp_string'),
1367
  'url' => get_permalink(),
1368
- 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
1369
  'image' => array(
1370
  '@type' => 'ImageObject',
1371
  'url' => isset($business_details['local_business_logo']) ? esc_url($business_details['local_business_logo']['url']):'',
@@ -1626,6 +1635,133 @@ function saswp_post_specific_schema_output() {
1626
  $service_object = new saswp_output_service();
1627
  $extra_theme_review = $service_object->saswp_extra_theme_review_details(get_the_ID());
1628
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1629
  if( 'Mosque' === $schema_type){
1630
 
1631
  $howto_image = get_post_meta( get_the_ID(), 'saswp_mosque_schema_image_'.$schema_id.'_detail',true);
@@ -1914,7 +2050,7 @@ function saswp_post_specific_schema_output() {
1914
  $input1['address']['addressCountry'] = saswp_remove_warnings($all_post_meta, 'saswp_sfr_schema_country_'.$schema_id, 'saswp_array');
1915
  $input1['address']['addressLocality'] = saswp_remove_warnings($all_post_meta, 'saswp_sfr_schema_locality_'.$schema_id, 'saswp_array');
1916
  $input1['address']['addressRegion'] = saswp_remove_warnings($all_post_meta, 'saswp_sfr_schema_region_'.$schema_id, 'saswp_array');
1917
- $input1['address']['PostalCode'] = saswp_remove_warnings($all_post_meta, 'saswp_sfr_schema_postalcode_'.$schema_id, 'saswp_array');
1918
 
1919
  $input1['telephone'] = saswp_remove_warnings($all_post_meta, 'saswp_sfr_schema_telephone_'.$schema_id, 'saswp_array');
1920
 
@@ -2346,7 +2482,8 @@ function saswp_post_specific_schema_output() {
2346
  'dateModified' => isset($all_post_meta['saswp_dfp_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_dfp_date_modified_'.$schema_id][0])):'',
2347
  'author' => array(
2348
  '@type' => 'Person',
2349
- 'name' => saswp_remove_warnings($all_post_meta, 'saswp_dfp_author_name_'.$schema_id, 'saswp_array')
 
2350
  )
2351
  );
2352
  }
@@ -2398,7 +2535,8 @@ function saswp_post_specific_schema_output() {
2398
  'dateModified' => isset($all_post_meta['saswp_blogposting_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_blogposting_date_modified_'.$schema_id][0])):'',
2399
  'author' => array(
2400
  '@type' => 'Person',
2401
- 'name' => saswp_remove_warnings($all_post_meta, 'saswp_blogposting_author_name_'.$schema_id, 'saswp_array')
 
2402
  ),
2403
  'publisher' => array(
2404
  '@type' => 'Organization',
@@ -2447,8 +2585,9 @@ function saswp_post_specific_schema_output() {
2447
  'dateModified' => isset($all_post_meta['saswp_audio_schema_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_audio_schema_date_modified_'.$schema_id][0])):'',
2448
  'author' => array(
2449
  '@type' => 'Person',
2450
- 'name' => saswp_remove_warnings($all_post_meta, 'saswp_audio_schema_author_name_'.$schema_id, 'saswp_array')
2451
- ),
 
2452
 
2453
  );
2454
  if(!empty($aggregateRating)){
@@ -2516,7 +2655,9 @@ function saswp_post_specific_schema_output() {
2516
  'dateModified' => isset($all_post_meta['saswp_webpage_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_webpage_date_modified_'.$schema_id][0])):'',
2517
  'author' => array(
2518
  '@type' => 'Person',
2519
- 'name' => saswp_remove_warnings($all_post_meta, 'saswp_webpage_author_name_'.$schema_id, 'saswp_array'), ),
 
 
2520
  'publisher' => array(
2521
  '@type' => 'Organization',
2522
  'logo' => array(
@@ -2572,7 +2713,8 @@ function saswp_post_specific_schema_output() {
2572
  'dateModified' => isset($all_post_meta['saswp_article_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_article_date_modified_'.$schema_id][0])):'',
2573
  'author' => array(
2574
  '@type' => 'Person',
2575
- 'name' => saswp_remove_warnings($all_post_meta, 'saswp_article_author_name_'.$schema_id, 'saswp_array')
 
2576
  ),
2577
  'publisher' => array(
2578
  '@type' => 'Organization',
@@ -2620,7 +2762,8 @@ function saswp_post_specific_schema_output() {
2620
  'dateModified' => isset($all_post_meta['saswp_tech_article_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_tech_article_date_modified_'.$schema_id][0])):'',
2621
  'author' => array(
2622
  '@type' => 'Person',
2623
- 'name' => saswp_remove_warnings($all_post_meta, 'saswp_tech_article_author_name_'.$schema_id, 'saswp_array')
 
2624
  ),
2625
  'publisher' => array(
2626
  '@type' => 'Organization',
@@ -2705,6 +2848,7 @@ function saswp_post_specific_schema_output() {
2705
  'author' => array(
2706
  '@type' => 'Person',
2707
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_author_name_'.$schema_id, 'saswp_array'),
 
2708
  'Image' => array(
2709
  '@type' => 'ImageObject',
2710
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_author_image_'.$schema_id, 'saswp_array'),
@@ -2863,6 +3007,7 @@ function saswp_post_specific_schema_output() {
2863
  '@id' => get_permalink().'/#newsarticle',
2864
  'mainEntityOfPage' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_main_entity_of_page_'.$schema_id, 'saswp_array'),
2865
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_URL_'.$schema_id, 'saswp_array'),
 
2866
  'headline' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_headline_'.$schema_id, 'saswp_array'),
2867
  'datePublished' => isset($all_post_meta['saswp_newsarticle_date_published_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_newsarticle_date_published_'.$schema_id][0])):'',
2868
  'dateModified' => isset($all_post_meta['saswp_newsarticle_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_newsarticle_date_modified_'.$schema_id][0])):'',
@@ -2880,6 +3025,7 @@ function saswp_post_specific_schema_output() {
2880
  'author' => array(
2881
  '@type' => 'Person',
2882
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_author_name_'.$schema_id, 'saswp_array'),
 
2883
  'Image' => array(
2884
  '@type' => 'ImageObject',
2885
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_author_image_'.$schema_id, 'saswp_array'),
@@ -2939,6 +3085,7 @@ function saswp_post_specific_schema_output() {
2939
  'author' => array(
2940
  '@type' => 'Person',
2941
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_video_object_author_name_'.$schema_id, 'saswp_array'),
 
2942
  'Image' => array(
2943
  '@type' => 'ImageObject',
2944
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_video_object_author_image_'.$schema_id, 'saswp_array'),
@@ -3085,8 +3232,8 @@ function saswp_post_specific_schema_output() {
3085
  $input1['reviewBody'] = $all_post_meta['saswp_review_schema_description_'.$schema_id][0];
3086
  $input1['description'] = $all_post_meta['saswp_review_schema_description_'.$schema_id][0];
3087
  }else {
3088
- $input1['reviewBody'] = strip_tags(strip_shortcodes(get_the_excerpt()));
3089
- $input1['description'] = strip_tags(strip_shortcodes(get_the_excerpt()));
3090
  }
3091
 
3092
  if(isset($all_post_meta['saswp_review_schema_item_type_'.$schema_id])){
@@ -3674,7 +3821,7 @@ function saswp_about_page_output(){
3674
  ),
3675
  "url" => get_permalink(),
3676
  "headline" => get_the_title(),
3677
- 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
3678
  );
3679
 
3680
  if(!empty($feature_image)){
@@ -3719,7 +3866,7 @@ function saswp_contact_page_output(){
3719
  ),
3720
  "url" => get_permalink(),
3721
  "headline" => get_the_title(),
3722
- 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
3723
  );
3724
 
3725
  if(!empty($feature_image)){
@@ -3750,7 +3897,7 @@ function saswp_site_navigation_output(){
3750
  $input = array();
3751
 
3752
  $menuLocations = get_nav_menu_locations();
3753
-
3754
  if(!empty($menuLocations) && (isset($sd_data['saswp_site_navigation_menu']) && $sd_data['saswp_site_navigation_menu'] == 1 ) ){
3755
 
3756
  $navObj = array();
@@ -3758,8 +3905,10 @@ function saswp_site_navigation_output(){
3758
  foreach($menuLocations as $type => $id){
3759
 
3760
  $menuItems = wp_get_nav_menu_items($id);
3761
-
3762
- if($menuItems){
 
 
3763
 
3764
  if(!saswp_non_amp()){
3765
 
@@ -3799,8 +3948,10 @@ function saswp_site_navigation_output(){
3799
 
3800
  }
3801
 
 
 
3802
  }
3803
-
3804
  }
3805
 
3806
  if($navObj){
236
  }
237
 
238
  // Generate author id
239
+ $author_id = get_the_author_meta('ID');
240
+ $author_desc = get_the_author_meta( 'user_description' );
 
241
  $image_id = get_post_thumbnail_id();
242
  $image_details = wp_get_attachment_image_src($image_id, 'full');
243
  $author_details = get_avatar_data($author_id);
302
  $schema_type == 'LandmarksOrHistoricalBuildings' ||
303
  $schema_type == 'HinduTemple' ||
304
  $schema_type == 'Church' ||
305
+ $schema_type == 'Mosque' ||
306
+ $schema_type == 'JobPosting' ||
307
+ $schema_type == 'Trip' ||
308
+ $schema_type == 'Person' ||
309
  $schema_type == 'SingleFamilyResidence' ) {
310
 
311
  $input1 = array();
313
 
314
  if( 'Course' === $schema_type){
315
 
316
+ $description = saswp_get_the_excerpt();
317
 
318
  if(!$description){
319
  $description = get_bloginfo('description');
360
  '@type' => 'DiscussionForumPosting' ,
361
  '@id' => bbp_get_topic_permalink().'/#discussionforumposting',
362
  'headline' => bbp_get_topic_title(get_the_ID()),
363
+ 'description' => saswp_get_the_excerpt(),
364
  "articleSection" => bbp_get_forum_title(),
365
+ "articleBody" => saswp_get_the_excerpt(),
366
  'url' => bbp_get_topic_permalink(),
367
  'datePublished' => esc_html($date),
368
  'dateModified' => esc_html($modified_date),
369
  'author' => array(
370
  '@type' => 'Person',
371
+ 'name' => esc_attr($aurthor_name),
372
+ 'description' => esc_attr($author_desc),
373
  ),
374
  'interactionStatistic' => array(
375
  '@type' => 'InteractionCounter',
385
  '@type' => 'DiscussionForumPosting' ,
386
  '@id' => get_permalink().'/#blogposting',
387
  'headline' => get_the_title(),
388
+ 'description' => saswp_get_the_excerpt(),
389
  'url' => get_permalink(),
390
  'datePublished' => esc_html($date),
391
  'dateModified' => esc_html($modified_date),
427
  '@id' => get_permalink().'/#blogposting',
428
  'mainEntityOfPage' => get_permalink(),
429
  'headline' => get_the_title(),
430
+ 'description' => saswp_get_the_excerpt(),
431
  'name' => get_the_title(),
432
  'url' => get_permalink(),
433
  'datePublished' => esc_html($date),
434
  'dateModified' => esc_html($modified_date),
435
  'author' => array(
436
  '@type' => 'Person',
437
+ 'name' => esc_attr($aurthor_name),
438
+ 'description' => esc_attr($author_desc)
439
  )
440
  );
441
  if(!empty($publisher)){
477
  'datePublished' => esc_html($date),
478
  'dateModified' => esc_html($modified_date),
479
  'author' => array(
480
+ '@type' => 'Person',
481
+ 'name' => esc_attr($aurthor_name),
482
+ 'description' => esc_attr($author_desc)
483
  ),
484
  );
485
  if(!empty($publisher)){
607
  'datePublished' => esc_html($date),
608
  'dateModified' => esc_html($modified_date),
609
  'author' => array(
610
+ '@type' => 'Person',
611
+ 'name' => esc_attr($aurthor_name),
612
+ 'description' => esc_attr($author_desc)
613
  ),
614
  );
615
 
717
  'name' => get_the_title(),
718
  'datePublished' => esc_html($date),
719
  'dateModified' => esc_html($modified_date),
720
+ 'description' => saswp_get_the_excerpt(),
721
  'mainEntity' => array(
722
  '@type' => 'WebPage',
723
  '@id' => get_permalink(),
724
  'author' => array(
725
  '@type' => 'Person',
726
  'name' => esc_attr($aurthor_name),
727
+ 'description' => esc_attr($author_desc),
728
  'image' => array(
729
  '@type' => 'ImageObject',
730
  'url' => saswp_remove_warnings($author_details, 'url', 'saswp_string'),
880
  'mainEntityOfPage' => get_the_permalink(),
881
  'datePublished' => esc_html($date),
882
  'dateModified' => esc_html($modified_date),
883
+ 'description' => saswp_get_the_excerpt(),
884
  'articleSection' => $article_section,
885
+ 'articleBody' => saswp_get_the_excerpt(),
886
  'name' => get_the_title(),
887
  'thumbnailUrl' => saswp_remove_warnings($image_details, 0, 'saswp_string'),
888
  'wordCount' => saswp_remove_warnings($word_count, 'word_count', 'saswp_string'),
894
  'author' => array(
895
  '@type' => 'Person',
896
  'name' => esc_attr($aurthor_name),
897
+ 'description' => esc_attr($author_desc),
898
  'Image' => array(
899
+ '@type' => 'ImageObject',
900
+ 'url' => saswp_remove_warnings($author_details, 'url', 'saswp_string'),
901
+ 'height' => saswp_remove_warnings($author_details, 'height', 'saswp_string'),
902
+ 'width' => saswp_remove_warnings($author_details, 'width', 'saswp_string')
903
+ )
904
  )
905
  );
906
  if(!empty($publisher)){
1035
  'name' => get_the_title(),
1036
  'keywords' => tie_get_plain_terms( get_the_ID(), 'post_tag' ),
1037
  'url' => get_permalink(),
1038
+ 'description' => saswp_get_the_excerpt(),
1039
  'copyrightYear' => get_the_time( 'Y' ),
1040
  'author' => array(
1041
  '@type' => 'Person',
1042
  'name' => esc_attr($aurthor_name),
1043
+ 'description' => esc_attr($author_desc),
1044
  'image' => array(
1045
  '@type' => 'ImageObject',
1046
  'url' => saswp_remove_warnings($author_details, 'url', 'saswp_string'),
1117
  $input1['reviewBody'] = $schema_data['saswp_review_schema_description'];
1118
  $input1['description'] = $schema_data['saswp_review_schema_description'];
1119
  }else {
1120
+ $input1['reviewBody'] = saswp_get_the_excerpt();
1121
+ $input1['description'] = saswp_get_the_excerpt();
1122
  }
1123
 
1124
  if(isset($schema_data['saswp_review_schema_item_type'])){
1229
  $input1['author']['sameAs'] = get_permalink();
1230
 
1231
  }
1232
+
 
1233
  break;
1234
  case 'MusicPlaylist':
1235
  break;
1295
  }
1296
 
1297
  }
1298
+ $description = saswp_get_the_excerpt();
1299
 
1300
  if(!$description){
1301
  $description = get_bloginfo('description');
1319
  'author' => array(
1320
  '@type' => 'Person',
1321
  'name' => esc_attr($aurthor_name),
1322
+ 'description' => esc_attr($author_desc),
1323
  'image' => array(
1324
  '@type' => 'ImageObject',
1325
  'url' => saswp_remove_warnings($author_details, 'url', 'saswp_string'),
1374
  '@id' => get_permalink().'/#'. strtolower(esc_attr($local_business)),
1375
  'name' => saswp_remove_warnings($business_details, 'local_business_name', 'saswp_string'),
1376
  'url' => get_permalink(),
1377
+ 'description' => saswp_get_the_excerpt(),
1378
  'image' => array(
1379
  '@type' => 'ImageObject',
1380
  'url' => isset($business_details['local_business_logo']) ? esc_url($business_details['local_business_logo']['url']):'',
1635
  $service_object = new saswp_output_service();
1636
  $extra_theme_review = $service_object->saswp_extra_theme_review_details(get_the_ID());
1637
 
1638
+
1639
+ if( 'Person' === $schema_type){
1640
+
1641
+ $image = get_post_meta( get_the_ID(), 'saswp_trip_schema_image_'.$schema_id.'_detail',true);
1642
+
1643
+
1644
+ $input1['@context'] = 'http://schema.org';
1645
+ $input1['@type'] = 'Person';
1646
+ $input1['@id'] = get_permalink().'/#Person';
1647
+ $input1['url'] = saswp_remove_warnings($all_post_meta, 'saswp_person_schema_url_'.$schema_id, 'saswp_array');
1648
+ $input1['name'] = saswp_remove_warnings($all_post_meta, 'saswp_person_schema_name_'.$schema_id, 'saswp_array');
1649
+ $input1['description'] = saswp_remove_warnings($all_post_meta, 'saswp_person_schema_description_'.$schema_id, 'saswp_array');
1650
+ $input1['gender'] = saswp_remove_warnings($all_post_meta, 'saswp_person_schema_gender_'.$schema_id, 'saswp_array');
1651
+ $input1['birthDate'] = isset($all_post_meta['saswp_person_schema_date_of_birth_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_person_schema_date_of_birth_'.$schema_id][0])):'';
1652
+ $input1['nationality'] = saswp_remove_warnings($all_post_meta, 'saswp_person_schema_nationality_'.$schema_id, 'saswp_array');
1653
+ $input1['jobTitle'] = saswp_remove_warnings($all_post_meta, 'saswp_person_schema_job_title_'.$schema_id, 'saswp_array');
1654
+
1655
+ $input1['address']['@type'] = 'PostalAddress';
1656
+ $input1['address']['streetAddress'] = saswp_remove_warnings($all_post_meta, 'saswp_person_schema_street_address_'.$schema_id, 'saswp_array');
1657
+ $input1['address']['addressCountry'] = saswp_remove_warnings($all_post_meta, 'saswp_person_schema_country_'.$schema_id, 'saswp_array');
1658
+ $input1['address']['addressLocality'] = saswp_remove_warnings($all_post_meta, 'saswp_person_schema_locality_'.$schema_id, 'saswp_array');
1659
+ $input1['address']['addressRegion'] = saswp_remove_warnings($all_post_meta, 'saswp_person_schema_region_'.$schema_id, 'saswp_array');
1660
+ $input1['address']['PostalCode'] = saswp_remove_warnings($all_post_meta, 'saswp_person_schema_postal_code_'.$schema_id, 'saswp_array');
1661
+
1662
+ $input1['telephone'] = saswp_remove_warnings($all_post_meta, 'saswp_person_schema_telephone_'.$schema_id, 'saswp_array');
1663
+ $input1['email'] = saswp_remove_warnings($all_post_meta, 'saswp_person_schema_email_'.$schema_id, 'saswp_array');
1664
+
1665
+ if(!(empty($image))){
1666
+
1667
+ $input1['image']['@type'] = 'ImageObject';
1668
+ $input1['image']['url'] = isset($image['thumbnail']) ? esc_url($image['thumbnail']):'';
1669
+ $input1['image']['height'] = isset($image['width']) ? esc_attr($image['width']) :'';
1670
+ $input1['image']['width'] = isset($image['height']) ? esc_attr($image['height']) :'';
1671
+
1672
+ }
1673
+
1674
+ }
1675
+
1676
+ if( 'Trip' === $schema_type){
1677
+
1678
+ $howto_image = get_post_meta( get_the_ID(), 'saswp_trip_schema_image_'.$schema_id.'_detail',true);
1679
+
1680
+
1681
+ $input1['@context'] = 'http://schema.org';
1682
+ $input1['@type'] = 'Trip';
1683
+ $input1['@id'] = get_permalink().'/#Trip';
1684
+ $input1['url'] = saswp_remove_warnings($all_post_meta, 'saswp_trip_schema_url_'.$schema_id, 'saswp_array');
1685
+ $input1['name'] = saswp_remove_warnings($all_post_meta, 'saswp_trip_schema_name_'.$schema_id, 'saswp_array');
1686
+ $input1['description'] = saswp_remove_warnings($all_post_meta, 'saswp_trip_schema_description_'.$schema_id, 'saswp_array');
1687
+
1688
+ if(!(empty($howto_image))){
1689
+
1690
+ $input1['image']['@type'] = 'ImageObject';
1691
+ $input1['image']['url'] = isset($howto_image['thumbnail']) ? esc_url($howto_image['thumbnail']):'';
1692
+ $input1['image']['height'] = isset($howto_image['width']) ? esc_attr($howto_image['width']) :'';
1693
+ $input1['image']['width'] = isset($howto_image['height']) ? esc_attr($howto_image['height']) :'';
1694
+
1695
+ }
1696
+
1697
+
1698
+ $itinerary = esc_sql ( get_post_meta($schema_post_id, 'trip_itinerary_'.$schema_id, true) );
1699
+
1700
+ $itinerary_arr = array();
1701
+
1702
+ if(!empty($itinerary)){
1703
+
1704
+ foreach($itinerary as $val){
1705
+
1706
+ $supply_data = array();
1707
+ $supply_data['@type'] = $val['saswp_trip_itinerary_type'];
1708
+ $supply_data['name'] = $val['saswp_trip_itinerary_name'];
1709
+ $supply_data['description'] = $val['saswp_trip_itinerary_description'];
1710
+ $supply_data['url'] = $val['saswp_trip_itinerary_url'];
1711
+
1712
+
1713
+ $itinerary_arr[] = $supply_data;
1714
+ }
1715
+ $input1['itinerary'] = $itinerary_arr;
1716
+ }
1717
+
1718
+ }
1719
+
1720
+ if( 'JobPosting' === $schema_type){
1721
+
1722
+ $howto_image = get_post_meta( get_the_ID(), 'saswp_jobposting_schema_ho_logo_'.$schema_id.'_detail',true);
1723
+
1724
+
1725
+ $input1['@context'] = 'http://schema.org';
1726
+ $input1['@type'] = 'JobPosting';
1727
+ $input1['@id'] = get_permalink().'/#JobPosting';
1728
+ $input1['url'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_url_'.$schema_id, 'saswp_array');
1729
+ $input1['title'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_title_'.$schema_id, 'saswp_array');
1730
+ $input1['description'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_description_'.$schema_id, 'saswp_array');
1731
+ $input1['datePosted'] = isset($all_post_meta['saswp_jobposting_schema_dateposted_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_jobposting_schema_dateposted_'.$schema_id][0])):'';
1732
+ $input1['validThrough'] = isset($all_post_meta['saswp_jobposting_schema_validthrough_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_jobposting_schema_validthrough_'.$schema_id][0])):'';
1733
+ $input1['employmentType'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_employment_type_'.$schema_id, 'saswp_array');
1734
+
1735
+ $input1['hiringOrganization']['@type'] = 'Organization';
1736
+ $input1['hiringOrganization']['name'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_ho_name_'.$schema_id, 'saswp_array');
1737
+ $input1['hiringOrganization']['sameAs'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_ho_url_'.$schema_id, 'saswp_array');
1738
+
1739
+ if(!(empty($howto_image))){
1740
+
1741
+ $input1['hiringOrganization']['logo']['@type'] = 'ImageObject';
1742
+ $input1['hiringOrganization']['logo']['url'] = isset($howto_image['thumbnail']) ? esc_url($howto_image['thumbnail']):'';
1743
+ $input1['hiringOrganization']['logo']['height'] = isset($howto_image['width']) ? esc_attr($howto_image['width']) :'';
1744
+ $input1['hiringOrganization']['logo']['width'] = isset($howto_image['height']) ? esc_attr($howto_image['height']) :'';
1745
+
1746
+ }
1747
+
1748
+ $input1['jobLocation']['@type'] = 'Place';
1749
+ $input1['jobLocation']['address']['@type'] = 'PostalAddress';
1750
+ $input1['jobLocation']['address']['streetAddress'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_street_address_'.$schema_id, 'saswp_array');
1751
+ $input1['jobLocation']['address']['addressLocality'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_locality_'.$schema_id, 'saswp_array');
1752
+ $input1['jobLocation']['address']['addressRegion'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_region_'.$schema_id, 'saswp_array');
1753
+ $input1['jobLocation']['address']['addressCountry'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_country_'.$schema_id, 'saswp_array');
1754
+ $input1['jobLocation']['address']['PostalCode'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_postalcode_'.$schema_id, 'saswp_array');
1755
+
1756
+
1757
+ $input1['baseSalary']['@type'] = 'MonetaryAmount';
1758
+ $input1['baseSalary']['currency'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_bs_currency_'.$schema_id, 'saswp_array');
1759
+ $input1['baseSalary']['value']['@type'] = 'QuantitativeValue';
1760
+ $input1['baseSalary']['value']['value'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_bs_value_'.$schema_id, 'saswp_array');
1761
+ $input1['baseSalary']['value']['unitText'] = saswp_remove_warnings($all_post_meta, 'saswp_jobposting_schema_bs_unittext_'.$schema_id, 'saswp_array');
1762
+
1763
+ }
1764
+
1765
  if( 'Mosque' === $schema_type){
1766
 
1767
  $howto_image = get_post_meta( get_the_ID(), 'saswp_mosque_schema_image_'.$schema_id.'_detail',true);
2050
  $input1['address']['addressCountry'] = saswp_remove_warnings($all_post_meta, 'saswp_sfr_schema_country_'.$schema_id, 'saswp_array');
2051
  $input1['address']['addressLocality'] = saswp_remove_warnings($all_post_meta, 'saswp_sfr_schema_locality_'.$schema_id, 'saswp_array');
2052
  $input1['address']['addressRegion'] = saswp_remove_warnings($all_post_meta, 'saswp_sfr_schema_region_'.$schema_id, 'saswp_array');
2053
+ $input1['address']['PostalCode'] = saswp_remove_warnings($all_post_meta, 'saswp_sfr_schema_postalcode_'.$schema_id, 'saswp_array');
2054
 
2055
  $input1['telephone'] = saswp_remove_warnings($all_post_meta, 'saswp_sfr_schema_telephone_'.$schema_id, 'saswp_array');
2056
 
2482
  'dateModified' => isset($all_post_meta['saswp_dfp_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_dfp_date_modified_'.$schema_id][0])):'',
2483
  'author' => array(
2484
  '@type' => 'Person',
2485
+ 'name' => saswp_remove_warnings($all_post_meta, 'saswp_dfp_author_name_'.$schema_id, 'saswp_array'),
2486
+ 'description' => saswp_remove_warnings($all_post_meta, 'saswp_dfp_author_description_'.$schema_id, 'saswp_array')
2487
  )
2488
  );
2489
  }
2535
  'dateModified' => isset($all_post_meta['saswp_blogposting_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_blogposting_date_modified_'.$schema_id][0])):'',
2536
  'author' => array(
2537
  '@type' => 'Person',
2538
+ 'name' => saswp_remove_warnings($all_post_meta, 'saswp_blogposting_author_name_'.$schema_id, 'saswp_array'),
2539
+ 'description' => saswp_remove_warnings($all_post_meta, 'saswp_blogposting_author_description_'.$schema_id, 'saswp_array')
2540
  ),
2541
  'publisher' => array(
2542
  '@type' => 'Organization',
2585
  'dateModified' => isset($all_post_meta['saswp_audio_schema_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_audio_schema_date_modified_'.$schema_id][0])):'',
2586
  'author' => array(
2587
  '@type' => 'Person',
2588
+ 'name' => saswp_remove_warnings($all_post_meta, 'saswp_audio_schema_author_name_'.$schema_id, 'saswp_array'),
2589
+ 'description' => saswp_remove_warnings($all_post_meta, 'saswp_audio_schema_author_description_'.$schema_id, 'saswp_array')
2590
+ ),
2591
 
2592
  );
2593
  if(!empty($aggregateRating)){
2655
  'dateModified' => isset($all_post_meta['saswp_webpage_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_webpage_date_modified_'.$schema_id][0])):'',
2656
  'author' => array(
2657
  '@type' => 'Person',
2658
+ 'name' => saswp_remove_warnings($all_post_meta, 'saswp_webpage_author_name_'.$schema_id, 'saswp_array'),
2659
+ 'description' => saswp_remove_warnings($all_post_meta, 'saswp_webpage_author_description_'.$schema_id, 'saswp_array'),
2660
+ ),
2661
  'publisher' => array(
2662
  '@type' => 'Organization',
2663
  'logo' => array(
2713
  'dateModified' => isset($all_post_meta['saswp_article_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_article_date_modified_'.$schema_id][0])):'',
2714
  'author' => array(
2715
  '@type' => 'Person',
2716
+ 'name' => saswp_remove_warnings($all_post_meta, 'saswp_article_author_name_'.$schema_id, 'saswp_array'),
2717
+ 'description' => saswp_remove_warnings($all_post_meta, 'saswp_article_author_description_'.$schema_id, 'saswp_array')
2718
  ),
2719
  'publisher' => array(
2720
  '@type' => 'Organization',
2762
  'dateModified' => isset($all_post_meta['saswp_tech_article_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_tech_article_date_modified_'.$schema_id][0])):'',
2763
  'author' => array(
2764
  '@type' => 'Person',
2765
+ 'name' => saswp_remove_warnings($all_post_meta, 'saswp_tech_article_author_name_'.$schema_id, 'saswp_array'),
2766
+ 'description' => saswp_remove_warnings($all_post_meta, 'saswp_tech_article_author_description_'.$schema_id, 'saswp_array')
2767
  ),
2768
  'publisher' => array(
2769
  '@type' => 'Organization',
2848
  'author' => array(
2849
  '@type' => 'Person',
2850
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_author_name_'.$schema_id, 'saswp_array'),
2851
+ 'description' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_author_description_'.$schema_id, 'saswp_array'),
2852
  'Image' => array(
2853
  '@type' => 'ImageObject',
2854
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_author_image_'.$schema_id, 'saswp_array'),
3007
  '@id' => get_permalink().'/#newsarticle',
3008
  'mainEntityOfPage' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_main_entity_of_page_'.$schema_id, 'saswp_array'),
3009
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_URL_'.$schema_id, 'saswp_array'),
3010
+ 'image' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_image_'.$schema_id, 'saswp_array'),
3011
  'headline' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_headline_'.$schema_id, 'saswp_array'),
3012
  'datePublished' => isset($all_post_meta['saswp_newsarticle_date_published_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_newsarticle_date_published_'.$schema_id][0])):'',
3013
  'dateModified' => isset($all_post_meta['saswp_newsarticle_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_newsarticle_date_modified_'.$schema_id][0])):'',
3025
  'author' => array(
3026
  '@type' => 'Person',
3027
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_author_name_'.$schema_id, 'saswp_array'),
3028
+ 'description' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_author_description_'.$schema_id, 'saswp_array'),
3029
  'Image' => array(
3030
  '@type' => 'ImageObject',
3031
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_author_image_'.$schema_id, 'saswp_array'),
3085
  'author' => array(
3086
  '@type' => 'Person',
3087
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_video_object_author_name_'.$schema_id, 'saswp_array'),
3088
+ 'description' => saswp_remove_warnings($all_post_meta, 'saswp_video_object_author_description_'.$schema_id, 'saswp_array'),
3089
  'Image' => array(
3090
  '@type' => 'ImageObject',
3091
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_video_object_author_image_'.$schema_id, 'saswp_array'),
3232
  $input1['reviewBody'] = $all_post_meta['saswp_review_schema_description_'.$schema_id][0];
3233
  $input1['description'] = $all_post_meta['saswp_review_schema_description_'.$schema_id][0];
3234
  }else {
3235
+ $input1['reviewBody'] = saswp_get_the_excerpt();
3236
+ $input1['description'] = saswp_get_the_excerpt();
3237
  }
3238
 
3239
  if(isset($all_post_meta['saswp_review_schema_item_type_'.$schema_id])){
3821
  ),
3822
  "url" => get_permalink(),
3823
  "headline" => get_the_title(),
3824
+ 'description' => saswp_get_the_excerpt(),
3825
  );
3826
 
3827
  if(!empty($feature_image)){
3866
  ),
3867
  "url" => get_permalink(),
3868
  "headline" => get_the_title(),
3869
+ 'description' => saswp_get_the_excerpt(),
3870
  );
3871
 
3872
  if(!empty($feature_image)){
3897
  $input = array();
3898
 
3899
  $menuLocations = get_nav_menu_locations();
3900
+
3901
  if(!empty($menuLocations) && (isset($sd_data['saswp_site_navigation_menu']) && $sd_data['saswp_site_navigation_menu'] == 1 ) ){
3902
 
3903
  $navObj = array();
3905
  foreach($menuLocations as $type => $id){
3906
 
3907
  $menuItems = wp_get_nav_menu_items($id);
3908
+
3909
+ if(isset($sd_data['saswp-'.$type])){
3910
+
3911
+ if($menuItems){
3912
 
3913
  if(!saswp_non_amp()){
3914
 
3948
 
3949
  }
3950
 
3951
+ }
3952
+
3953
  }
3954
+
3955
  }
3956
 
3957
  if($navObj){
output/review-output.php CHANGED
@@ -60,7 +60,7 @@ Class saswp_review_output{
60
  'headline' => get_the_title(),
61
  'name' => get_the_title(),
62
  'url' => get_permalink(),
63
- 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
64
  'copyrightYear' => get_the_time( 'Y' ),
65
  'author' => array(
66
  '@type' => 'Person',
60
  'headline' => get_the_title(),
61
  'name' => get_the_title(),
62
  'url' => get_permalink(),
63
+ 'description' => saswp_get_the_excerpt(),
64
  'copyrightYear' => get_the_time( 'Y' ),
65
  'author' => array(
66
  '@type' => 'Person',
output/service.php CHANGED
@@ -1591,6 +1591,7 @@ Class saswp_output_service{
1591
  $input1 = array();
1592
 
1593
  $author_id = get_the_author_meta('ID');
 
1594
  $image_id = get_post_thumbnail_id();
1595
  $image_details = wp_get_attachment_image_src($image_id, 'full');
1596
  $date = get_the_date("Y-m-d\TH:i:s\Z");
@@ -1615,12 +1616,13 @@ Class saswp_output_service{
1615
  'url' => get_permalink(),
1616
  'mainEntityOfPage' => get_permalink(),
1617
  'headline' => get_the_title(),
1618
- 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
1619
  'datePublished' => esc_html($date),
1620
  'dateModified' => esc_html($modified_date),
1621
  'author' => array(
1622
  '@type' => 'Person',
1623
- 'name' => esc_attr($aurthor_name)
 
1624
  ),
1625
  'publisher' => array(
1626
  '@type' => 'Organization',
@@ -1645,12 +1647,13 @@ Class saswp_output_service{
1645
  'url' => get_permalink(),
1646
  'mainEntityOfPage' => get_permalink(),
1647
  'headline' => get_the_title(),
1648
- 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
1649
  'datePublished' => esc_html($date),
1650
  'dateModified' => esc_html($modified_date),
1651
  'author' => array(
1652
  '@type' => 'Person',
1653
- 'name' => esc_attr($aurthor_name)
 
1654
  ),
1655
  'publisher' => array(
1656
  '@type' => 'Organization',
@@ -1679,18 +1682,20 @@ Class saswp_output_service{
1679
  '@id' => get_permalink().'/#webpage',
1680
  'name' => get_the_title(),
1681
  'url' => get_permalink(),
1682
- 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
1683
  'mainEntity' => array(
1684
  '@type' => 'Article',
1685
  'mainEntityOfPage' => get_permalink(),
1686
  'image' => esc_url($image_details[0]),
1687
  'headline' => get_the_title(),
1688
- 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
1689
  'datePublished' => esc_html($date),
1690
  'dateModified' => esc_html($modified_date),
1691
  'author' => array(
1692
  '@type' => 'Person',
1693
- 'name' => esc_attr($aurthor_name), ),
 
 
1694
  'publisher' => array(
1695
  '@type' => 'Organization',
1696
  'logo' => array(
@@ -1827,22 +1832,23 @@ Class saswp_output_service{
1827
  if($content){
1828
 
1829
  $regex = '/<img(.*?)src="(.*?)"(.*?)>/';
1830
- preg_match_all( $regex, $content, $attachments );
1831
-
1832
  $attach_images = array();
1833
 
1834
  if(!empty($attachments)){
 
 
 
1835
  $k = 0;
1836
  foreach ($attachments[2] as $attachment) {
1837
-
1838
- $attach_details = saswp_get_attachment_details_by_url($attachment, $post->ID, $k );
1839
-
1840
  if(!empty($attach_details)){
1841
 
1842
  $attach_images['image'][$k]['@type'] = 'ImageObject';
1843
  $attach_images['image'][$k]['url'] = esc_url($attachment);
1844
- $attach_images['image'][$k]['width'] = esc_attr($attach_details[0]);
1845
- $attach_images['image'][$k]['height'] = esc_attr($attach_details[1]);
1846
 
1847
  }
1848
 
1591
  $input1 = array();
1592
 
1593
  $author_id = get_the_author_meta('ID');
1594
+ $author_desc = get_the_author_meta( 'user_description' );
1595
  $image_id = get_post_thumbnail_id();
1596
  $image_details = wp_get_attachment_image_src($image_id, 'full');
1597
  $date = get_the_date("Y-m-d\TH:i:s\Z");
1616
  'url' => get_permalink(),
1617
  'mainEntityOfPage' => get_permalink(),
1618
  'headline' => get_the_title(),
1619
+ 'description' => saswp_get_the_excerpt(),
1620
  'datePublished' => esc_html($date),
1621
  'dateModified' => esc_html($modified_date),
1622
  'author' => array(
1623
  '@type' => 'Person',
1624
+ 'name' => esc_attr($aurthor_name),
1625
+ 'description' => esc_attr($author_desc),
1626
  ),
1627
  'publisher' => array(
1628
  '@type' => 'Organization',
1647
  'url' => get_permalink(),
1648
  'mainEntityOfPage' => get_permalink(),
1649
  'headline' => get_the_title(),
1650
+ 'description' => saswp_get_the_excerpt(),
1651
  'datePublished' => esc_html($date),
1652
  'dateModified' => esc_html($modified_date),
1653
  'author' => array(
1654
  '@type' => 'Person',
1655
+ 'name' => esc_attr($aurthor_name),
1656
+ 'description' => esc_attr($author_desc),
1657
  ),
1658
  'publisher' => array(
1659
  '@type' => 'Organization',
1682
  '@id' => get_permalink().'/#webpage',
1683
  'name' => get_the_title(),
1684
  'url' => get_permalink(),
1685
+ 'description' => saswp_get_the_excerpt(),
1686
  'mainEntity' => array(
1687
  '@type' => 'Article',
1688
  'mainEntityOfPage' => get_permalink(),
1689
  'image' => esc_url($image_details[0]),
1690
  'headline' => get_the_title(),
1691
+ 'description' => saswp_get_the_excerpt(),
1692
  'datePublished' => esc_html($date),
1693
  'dateModified' => esc_html($modified_date),
1694
  'author' => array(
1695
  '@type' => 'Person',
1696
+ 'name' => esc_attr($aurthor_name),
1697
+ 'description' => esc_attr($author_desc)
1698
+ ),
1699
  'publisher' => array(
1700
  '@type' => 'Organization',
1701
  'logo' => array(
1832
  if($content){
1833
 
1834
  $regex = '/<img(.*?)src="(.*?)"(.*?)>/';
1835
+ preg_match_all( $regex, $content, $attachments );
1836
+
1837
  $attach_images = array();
1838
 
1839
  if(!empty($attachments)){
1840
+
1841
+ $attach_details = saswp_get_attachment_details($attachments[2], $post->ID);
1842
+
1843
  $k = 0;
1844
  foreach ($attachments[2] as $attachment) {
1845
+
 
 
1846
  if(!empty($attach_details)){
1847
 
1848
  $attach_images['image'][$k]['@type'] = 'ImageObject';
1849
  $attach_images['image'][$k]['url'] = esc_url($attachment);
1850
+ $attach_images['image'][$k]['width'] = esc_attr($attach_details[$k][0]);
1851
+ $attach_images['image'][$k]['height'] = esc_attr($attach_details[$k][1]);
1852
 
1853
  }
1854
 
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.2
6
- Stable tag: 1.8.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -66,6 +66,24 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
66
  == Changelog ==
67
 
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  = 1.8.4 (22 May 2019) =
70
 
71
  * Added: Accomodation Schema type ( House, Apartment and SingleFamilyResidence )#41
3
  Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
4
  Requires at least: 3.0
5
  Tested up to: 5.2
6
+ Stable tag: 1.8.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
66
  == Changelog ==
67
 
68
 
69
+ = 1.8.5 (28 May 2019) =
70
+
71
+ * Added: Person schema type #220
72
+ * Added: Trip schema type #289
73
+ * Added: JobPosting schema type #289
74
+ * Added: Author fields should have description field #275
75
+ * Added: Homepage selection in the "Placement" dropdown #280
76
+ * Bug Fixed: Remove shortcode and share button text from schema markup description #250
77
+ * Bug Fixed: Modify schema does not take default description #295
78
+ * Bug Fixed: saswp-style.css should only load wherever its need #287
79
+ * Bug Fixed: Unspecified Type error when defragmentation is enabled and website schema is disabled #291
80
+ * Improvement: getimagesize function improvement #278
81
+ * Improvement: Site Navigation Menu option should have list of menus to be added in schema markup #272
82
+ * Improvement: If Yoast compatibility is on make sure, We skip the schema of the Yoast, not the whole metadata and og tags #288
83
+ * Improvement: If target location is empty than by default target location should be post #292
84
+ * Improvement: An option for adding own custom json schema markup on every post along with current schema #274
85
+
86
+
87
  = 1.8.4 (22 May 2019) =
88
 
89
  * Added: Accomodation Schema type ( House, Apartment and SingleFamilyResidence )#41
structured-data-for-wp.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Schema & Structured Data for WP
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.8.4
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.8.4');
17
  define('SASWP_DIR_NAME_FILE', __FILE__ );
18
  define('SASWP_DIR_NAME', dirname( __FILE__ ));
19
  define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
@@ -93,6 +93,16 @@ function saswp_admin_notice_activation_hook() {
93
  set_transient( 'saswp_admin_notice_transient', true, 5 );
94
  update_option( "saswp_activation_date", date("Y-m-d"));
95
 
 
 
 
 
 
 
 
 
 
 
96
  }
97
 
98
  add_action( 'admin_notices', 'saswp_admin_notice' );
@@ -164,7 +174,7 @@ function saswp_admin_notice(){
164
  <div class="updated notice is-dismissible message notice notice-alt saswp-feedback-notice">
165
  <p>
166
  <span><?php echo esc_html__('You have not setup default image in Schema & Structured Data For WP.', 'schema-and-structured-data-for-wp') ?> </span>
167
- <a href="<?php echo esc_url( admin_url( 'admin.php?page=structured_data_options&tab=schema' ) ); ?>"> <?php echo esc_html__('Please Setup', 'schema-and-structured-data-for-wp') ?></a>
168
  </p>
169
  </div>
170
 
2
  /*
3
  Plugin Name: Schema & Structured Data for WP
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.8.5
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.8.5');
17
  define('SASWP_DIR_NAME_FILE', __FILE__ );
18
  define('SASWP_DIR_NAME', dirname( __FILE__ ));
19
  define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
93
  set_transient( 'saswp_admin_notice_transient', true, 5 );
94
  update_option( "saswp_activation_date", date("Y-m-d"));
95
 
96
+ //Save first installation date
97
+
98
+ $installation_date = get_option('saswp_installation_date');
99
+
100
+ if(!$installation_date){
101
+
102
+ update_option('saswp_installation_date', date("Y-m-d"));
103
+
104
+ }
105
+
106
  }
107
 
108
  add_action( 'admin_notices', 'saswp_admin_notice' );
174
  <div class="updated notice is-dismissible message notice notice-alt saswp-feedback-notice">
175
  <p>
176
  <span><?php echo esc_html__('You have not setup default image in Schema & Structured Data For WP.', 'schema-and-structured-data-for-wp') ?> </span>
177
+ <a href="<?php echo esc_url( admin_url( 'admin.php?page=structured_data_options&tab=general' ) ); ?>"> <?php echo esc_html__('Please Setup', 'schema-and-structured-data-for-wp') ?></a>
178
  </p>
179
  </div>
180
 
view/post_specific.php CHANGED
@@ -17,9 +17,7 @@ class saswp_post_specific {
17
  add_action( 'wp_ajax_saswp_get_sub_business_ajax', array($this,'saswp_get_sub_business_ajax'));
18
 
19
  add_action( 'wp_ajax_saswp_modify_schema_post_enable', array($this,'saswp_modify_schema_post_enable'));
20
-
21
- add_action( 'wp_ajax_saswp_custom_schema_post_enable', array($this,'saswp_custom_schema_post_enable'));
22
-
23
  add_action( 'wp_ajax_saswp_restore_schema', array($this,'saswp_restore_schema'));
24
 
25
  add_action( 'wp_ajax_saswp_enable_disable_schema_on_post', array($this,'saswp_enable_disable_schema_on_post'));
@@ -276,6 +274,40 @@ class saswp_post_specific {
276
 
277
  break;
278
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
 
280
  default:
281
  break;
@@ -320,6 +352,36 @@ class saswp_post_specific {
320
 
321
 
322
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
323
 
324
  default:
325
 
@@ -356,9 +418,11 @@ class saswp_post_specific {
356
  $tabs = '';
357
  $tabs_fields = '';
358
  $schema_ids = array();
 
359
  $howto_data = array();
360
  $mc_data = array();
361
  $tvseries_data = array();
 
362
 
363
  $schema_enable = get_post_meta($post->ID, 'saswp_enable_disable_schema', true);
364
 
@@ -400,6 +464,12 @@ class saswp_post_specific {
400
  $tvseries_data['tvseries_actor_'.$schema->ID] = esc_sql ( get_post_meta($post->ID, 'tvseries_actor_'.$schema->ID, true) );
401
  $tvseries_data['tvseries_season_'.$schema->ID] = esc_sql ( get_post_meta($post->ID, 'tvseries_season_'.$schema->ID, true) );
402
 
 
 
 
 
 
 
403
  }
404
 
405
  if($key==0){
@@ -707,6 +777,53 @@ class saswp_post_specific {
707
  }
708
  //TvSeries schema ends here
709
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
710
  $tabs_fields .= '</div>';
711
 
712
  }else{
@@ -1014,6 +1131,51 @@ class saswp_post_specific {
1014
  }
1015
  //TvSeries schema ends here
1016
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1017
 
1018
  $tabs_fields .= '</div>';
1019
 
@@ -1032,6 +1194,33 @@ class saswp_post_specific {
1032
  echo '<div class="saswp-post-specific-container">';
1033
  echo $tabs_fields;
1034
  echo '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1035
  echo '<input class="saswp-post-specific-schema-ids" type="hidden" value="'. json_encode($schema_ids).'">';
1036
  echo '</div>';
1037
 
@@ -1066,7 +1255,13 @@ class saswp_post_specific {
1066
  $tvseries_data['tvseries_season_'.$schema->ID] = esc_sql ( get_post_meta($post->ID, 'tvseries_season_'.$schema->ID, true) );
1067
 
1068
  }
1069
-
 
 
 
 
 
 
1070
  $this->meta_fields = $response;
1071
  $output = $this->saswp_saswp_post_specific( $post, $all_schema[0]->ID );
1072
  $tabs_fields .= '<div>';
@@ -1373,8 +1568,81 @@ class saswp_post_specific {
1373
  }
1374
  //TvSeries schema ends here
1375
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1376
 
1377
  $tabs_fields .= '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1378
  $tabs_fields .= '<input class="saswp-post-specific-schema-ids" type="hidden" value="'. json_encode($schema_ids).'">';
1379
  $tabs_fields .= '</div>';
1380
  echo $tabs_fields;
@@ -1383,26 +1651,42 @@ class saswp_post_specific {
1383
 
1384
  public function saswp_post_meta_box_callback() {
1385
 
1386
- wp_nonce_field( 'post_specific_data', 'post_specific_nonce' );
1387
  global $post;
1388
- $modify_option = get_option('modify_schema_post_enable_'.esc_attr($post->ID));
1389
- $custom_option = get_option('custom_schema_post_enable_'.esc_attr($post->ID));
 
1390
 
1391
  if($modify_option == 'enable'){
1392
 
1393
  $this->saswp_post_meta_box_fields($post);
1394
 
1395
- }else if($custom_option == 'enable'){
 
 
 
 
 
 
1396
 
1397
- echo '<a class="button saswp-restore-post-schema">Restore Default</a>';
 
 
 
 
 
 
 
 
 
 
 
1398
  echo '<textarea style="margin-left:5px;" placeholder="{ Json Markup }" id="saswp_custom_schema_field" name="saswp_custom_schema_field" rows="5" cols="100">'
1399
- . get_post_meta($post->ID, 'saswp_custom_schema_field', true)
1400
  . '</textarea>';
 
 
 
1401
 
1402
- }else{
1403
-
1404
- echo '<a class="button saswp-modify_schema_post_enable">'.esc_html__( 'Modify Current Schema', 'schema-and-structured-data-for-wp' ).'</a>' ;
1405
- echo '<a style="margin-left:5px;" class="button saswp_custom_schema_post_enable">'.esc_html__( 'Add Custom Schema', 'schema-and-structured-data-for-wp' ).'</a>' ;
1406
  }
1407
 
1408
  }
@@ -1435,10 +1719,10 @@ class saswp_post_specific {
1435
  }
1436
 
1437
  }
1438
-
1439
- update_option('modify_schema_post_enable_'.$post_id, 'disable');
1440
- update_option('custom_schema_post_enable_'.$post_id, 'disable');
1441
 
 
 
 
1442
  if($result){
1443
 
1444
  echo json_encode(array('status'=> 't', 'msg'=>esc_html__( 'Schema has been restored', 'schema-and-structured-data-for-wp' )));
@@ -1450,39 +1734,7 @@ class saswp_post_specific {
1450
  }
1451
  wp_die();
1452
  }
1453
-
1454
- public function saswp_custom_schema_post_enable(){
1455
-
1456
- if ( ! isset( $_GET['saswp_security_nonce'] ) ){
1457
- return;
1458
- }
1459
- if ( !wp_verify_nonce( $_GET['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
1460
- return;
1461
- }
1462
-
1463
- $post_id = sanitize_text_field($_GET['post_id']);
1464
- update_option('custom_schema_post_enable_'.$post_id, 'enable');
1465
-
1466
- $args = array(
1467
- 'p' => $post_id, // ID of a page, post, or custom type
1468
- 'post_type' => 'any'
1469
- );
1470
-
1471
- $my_posts = new WP_Query($args);
1472
-
1473
- if ( $my_posts->have_posts() ) {
1474
-
1475
- while ( $my_posts->have_posts() ) : $my_posts->the_post();
1476
-
1477
- echo $this->saswp_post_meta_box_callback();
1478
-
1479
- endwhile;
1480
-
1481
- }
1482
-
1483
- wp_die();
1484
-
1485
- }
1486
 
1487
  public function saswp_modify_schema_post_enable(){
1488
 
@@ -1797,6 +2049,9 @@ class saswp_post_specific {
1797
  || strpos($meta_field['id'], 'saswp_event_schema_start_date') !== false
1798
  || strpos($meta_field['id'], 'saswp_event_schema_end_date') !== false
1799
  || strpos($meta_field['id'], 'saswp_event_schema_validfrom') !== false
 
 
 
1800
  ) {
1801
  $class='saswp-local-schema-datepicker-picker';
1802
  }
@@ -1861,17 +2116,12 @@ class saswp_post_specific {
1861
  return $post_id;
1862
 
1863
  $option = get_option('modify_schema_post_enable_'.$post_id);
1864
- $custom_option = get_option('custom_schema_post_enable_'.$post_id);
1865
 
1866
- if($custom_option == 'enable'){
1867
-
1868
- if(isset($_POST['saswp_custom_schema_field'])){
1869
- $custom_schema = sanitize_textarea_field($_POST['saswp_custom_schema_field']);
1870
- update_post_meta( $post_id, 'saswp_custom_schema_field', $custom_schema );
1871
- }
1872
-
1873
- }
1874
 
 
1875
  if($option != 'enable'){
1876
  return;
1877
  }
@@ -2002,6 +2252,26 @@ class saswp_post_specific {
2002
  update_post_meta( $post_id, 'tvseries_season_'.$schema->ID, $tv_season);
2003
 
2004
  //TVSeries schema ends here
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2005
 
2006
  $response = $this->saswp_get_fields_by_schema_type($schema->ID);
2007
 
@@ -2239,6 +2509,7 @@ class saswp_post_specific {
2239
 
2240
  }
2241
  $current_user = wp_get_current_user();
 
2242
  $author_details = get_avatar_data($current_user->ID);
2243
  $schema_type = esc_sql ( get_post_meta($schema_id, 'schema_type', true) );
2244
 
@@ -2495,7 +2766,7 @@ class saswp_post_specific {
2495
  'label' => 'Description',
2496
  'id' => 'saswp_blogposting_description_'.$schema_id,
2497
  'type' => 'textarea',
2498
- 'default' => $post->post_excerpt,
2499
  ),
2500
  array(
2501
  'label' => 'Name',
@@ -2527,6 +2798,12 @@ class saswp_post_specific {
2527
  'type' => 'text',
2528
  'default' => $current_user->display_name
2529
  ),
 
 
 
 
 
 
2530
  array(
2531
  'label' => 'Organization Name',
2532
  'id' => 'saswp_blogposting_organization_name_'.$schema_id,
@@ -2572,7 +2849,12 @@ class saswp_post_specific {
2572
  'id' => 'saswp_newsarticle_URL_'.$schema_id,
2573
  'type' => 'text',
2574
  'default' => get_permalink(),
2575
- ),
 
 
 
 
 
2576
  array(
2577
  'label' => 'Headline',
2578
  'id' => 'saswp_newsarticle_headline_'.$schema_id,
@@ -2595,7 +2877,7 @@ class saswp_post_specific {
2595
  'label' => 'Description',
2596
  'id' => 'saswp_newsarticle_description_'.$schema_id,
2597
  'type' => 'textarea',
2598
- 'default' => $post->post_excerpt
2599
  ),
2600
  array(
2601
  'label' => 'Article Section',
@@ -2644,7 +2926,13 @@ class saswp_post_specific {
2644
  'id' => 'saswp_newsarticle_author_name_'.$schema_id,
2645
  'type' => 'text',
2646
  'default' => $current_user->display_name
2647
- ),
 
 
 
 
 
 
2648
  array(
2649
  'label' => 'Author Image',
2650
  'id' => 'saswp_newsarticle_author_image_'.$schema_id,
@@ -2690,7 +2978,7 @@ class saswp_post_specific {
2690
  'label' => 'Description',
2691
  'id' => 'saswp_webpage_description_'.$schema_id,
2692
  'type' => 'textarea',
2693
- 'default' => $post->post_excerpt
2694
  ),
2695
  array(
2696
  'label' => 'Main Entity Of Page',
@@ -2729,6 +3017,12 @@ class saswp_post_specific {
2729
  'type' => 'text',
2730
  'default' => $current_user->display_name
2731
  ),
 
 
 
 
 
 
2732
  array(
2733
  'label' => 'Organization Name',
2734
  'id' => 'saswp_webpage_organization_name_'.$schema_id,
@@ -2774,7 +3068,7 @@ class saswp_post_specific {
2774
  'label' => 'Description',
2775
  'id' => 'saswp_article_description_'.$schema_id,
2776
  'type' => 'textarea',
2777
- 'default' => $post->post_excerpt
2778
  ) ,
2779
  array(
2780
  'label' => 'Date Published',
@@ -2794,6 +3088,12 @@ class saswp_post_specific {
2794
  'type' => 'text',
2795
  'default' => $current_user->display_name
2796
  ),
 
 
 
 
 
 
2797
  array(
2798
  'label' => 'Organization Name',
2799
  'id' => 'saswp_article_organization_name_'.$schema_id,
@@ -2948,7 +3248,7 @@ class saswp_post_specific {
2948
  'label' => 'Description',
2949
  'id' => 'saswp_tech_article_description_'.$schema_id,
2950
  'type' => 'textarea',
2951
- 'default' => $post->post_excerpt
2952
  ) ,
2953
  array(
2954
  'label' => 'Date Published',
@@ -2968,6 +3268,12 @@ class saswp_post_specific {
2968
  'type' => 'text',
2969
  'default' => $current_user->display_name
2970
  ),
 
 
 
 
 
 
2971
  array(
2972
  'label' => 'Organization Name',
2973
  'id' => 'saswp_tech_article_organization_name_'.$schema_id,
@@ -3048,7 +3354,7 @@ class saswp_post_specific {
3048
  'label' => 'Description',
3049
  'id' => 'saswp_dfp_description_'.$schema_id,
3050
  'type' => 'textarea',
3051
- 'default' => $post->post_excerpt
3052
  ) ,
3053
  array(
3054
  'label' => 'URL',
@@ -3073,7 +3379,14 @@ class saswp_post_specific {
3073
  'id' => 'saswp_dfp_author_name_'.$schema_id,
3074
  'type' => 'text',
3075
  'default' => $current_user->display_name
3076
- )
 
 
 
 
 
 
 
3077
  );
3078
  break;
3079
 
@@ -3107,7 +3420,7 @@ class saswp_post_specific {
3107
  'label' => 'Description',
3108
  'id' => 'saswp_recipe_description_'.$schema_id,
3109
  'type' => 'textarea',
3110
- 'default' => $post->post_excerpt
3111
  ),
3112
  array(
3113
  'label' => 'Main Entity Id',
@@ -3121,6 +3434,12 @@ class saswp_post_specific {
3121
  'type' => 'text',
3122
  'default' => $current_user->display_name
3123
  ),
 
 
 
 
 
 
3124
  array(
3125
  'label' => 'Author Image',
3126
  'id' => 'saswp_recipe_author_image_'.$schema_id,
@@ -3627,11 +3946,17 @@ class saswp_post_specific {
3627
  'default' => get_the_modified_date("Y-m-d")
3628
  ),
3629
  array(
3630
- 'label' => 'Author',
3631
  'id' => 'saswp_audio_schema_author_name_'.$schema_id,
3632
  'type' => 'text',
3633
  'default' => saswp_remove_warnings($service_schema_details, 'saswp_audio_author_name', 'saswp_string')
3634
- ),
 
 
 
 
 
 
3635
 
3636
  );
3637
  break;
@@ -3739,7 +4064,7 @@ class saswp_post_specific {
3739
  'label' => 'Description',
3740
  'id' => 'saswp_video_object_description_'.$schema_id,
3741
  'type' => 'textarea',
3742
- 'default' => $post->post_excerpt
3743
  ),
3744
  array(
3745
  'label' => 'Name',
@@ -3783,6 +4108,12 @@ class saswp_post_specific {
3783
  'type' => 'text',
3784
  'default' => $current_user->display_name
3785
  ),
 
 
 
 
 
 
3786
  array(
3787
  'label' => 'Author Image',
3788
  'id' => 'saswp_video_object_author_image_'.$schema_id,
@@ -4239,6 +4570,7 @@ class saswp_post_specific {
4239
 
4240
  );
4241
  break;
 
4242
  case 'House':
4243
 
4244
  $meta_field = array(
@@ -4792,6 +5124,249 @@ class saswp_post_specific {
4792
  );
4793
  break;
4794
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4795
  default:
4796
  break;
4797
  }
17
  add_action( 'wp_ajax_saswp_get_sub_business_ajax', array($this,'saswp_get_sub_business_ajax'));
18
 
19
  add_action( 'wp_ajax_saswp_modify_schema_post_enable', array($this,'saswp_modify_schema_post_enable'));
20
+
 
 
21
  add_action( 'wp_ajax_saswp_restore_schema', array($this,'saswp_restore_schema'));
22
 
23
  add_action( 'wp_ajax_saswp_enable_disable_schema_on_post', array($this,'saswp_enable_disable_schema_on_post'));
274
 
275
  break;
276
 
277
+ case 'trip_itinerary':
278
+
279
+ $meta_fields = array(
280
+
281
+ array(
282
+ 'label' => 'Itinerary Type',
283
+ 'name' => 'saswp_trip_itinerary_type',
284
+ 'type' => 'select',
285
+ 'options' => array(
286
+ 'City' => 'City',
287
+ 'LandmarksOrHistoricalBuildings' => 'LandmarksOrHistoricalBuildings',
288
+ 'AdministrativeArea' => 'AdministrativeArea',
289
+ 'LakeBodyOfWater' => 'LakeBodyOfWater'
290
+ )
291
+ ),
292
+ array(
293
+ 'label' => 'Itinerary Name',
294
+ 'name' => 'saswp_trip_itinerary_name',
295
+ 'type' => 'text'
296
+ ),
297
+ array(
298
+ 'label' => 'Itinerary Description',
299
+ 'name' => 'saswp_trip_itinerary_description',
300
+ 'type' => 'textarea'
301
+ ),
302
+ array(
303
+ 'label' => 'Itinerary URL',
304
+ 'name' => 'saswp_trip_itinerary_url',
305
+ 'type' => 'text'
306
+ ),
307
+ );
308
+
309
+ break;
310
+
311
 
312
  default:
313
  break;
352
 
353
 
354
  break;
355
+
356
+ case 'textarea':
357
+ $input = sprintf(
358
+ '<textarea style="width: 100%%" id="%s" name="%s" rows="5">%s</textarea>',
359
+ $meta_field['name'].'_'.$index.'_'.$schema_id,
360
+ $meta_name.'_'.$schema_id.'['.$index.']['.$meta_field['name'].']',
361
+ $data[$meta_field['name']]
362
+ );
363
+
364
+ break;
365
+
366
+ case 'select':
367
+
368
+ $input = sprintf(
369
+ '<select id="%s" name="%s">',
370
+ $meta_field['name'].'_'.$index.'_'.$schema_id,
371
+ $meta_name.'_'.$schema_id.'['.$index.']['.$meta_field['name'].']'
372
+ );
373
+ foreach ( $meta_field['options'] as $key => $value ) {
374
+
375
+ $meta_field_value = !is_numeric( $key ) ? $key : $value;
376
+ $input .= sprintf(
377
+ '<option %s value="%s">%s</option>',
378
+ $data[$meta_field['name']] === $meta_field_value ? 'selected' : '',
379
+ $meta_field_value,
380
+ esc_html__($value, 'schema-and-structured-data-for-wp' )
381
+ );
382
+ }
383
+ $input .= '</select>';
384
+ break;
385
 
386
  default:
387
 
418
  $tabs = '';
419
  $tabs_fields = '';
420
  $schema_ids = array();
421
+
422
  $howto_data = array();
423
  $mc_data = array();
424
  $tvseries_data = array();
425
+ $trip_data = array();
426
 
427
  $schema_enable = get_post_meta($post->ID, 'saswp_enable_disable_schema', true);
428
 
464
  $tvseries_data['tvseries_actor_'.$schema->ID] = esc_sql ( get_post_meta($post->ID, 'tvseries_actor_'.$schema->ID, true) );
465
  $tvseries_data['tvseries_season_'.$schema->ID] = esc_sql ( get_post_meta($post->ID, 'tvseries_season_'.$schema->ID, true) );
466
 
467
+ }
468
+
469
+ if($schema_type == 'Trip'){
470
+
471
+ $trip_data['trip_itinerary_'.$schema->ID] = esc_sql ( get_post_meta($post->ID, 'trip_itinerary_'.$schema->ID, true) );
472
+
473
  }
474
 
475
  if($key==0){
777
  }
778
  //TvSeries schema ends here
779
 
780
+
781
+ //Trip schema starts herre
782
+ if($schema_type == 'Trip'){
783
+
784
+ $schema_id = $schema->ID;
785
+
786
+ $tabs_fields .= '<div class="saswp-table-create-onajax">';
787
+
788
+ //itinerary section starts here
789
+
790
+ $tabs_fields .= '<div class="saswp-trip-itinerary-section-main">';
791
+ $tabs_fields .= '<div class="saswp-trip-itinerary-section" data-id="'.esc_attr($schema_id).'">';
792
+ if(isset($trip_data['trip_itinerary_'.$schema_id])){
793
+
794
+ $trip_itinerary = $trip_data['trip_itinerary_'.$schema_id];
795
+
796
+ $itinerary_html = '';
797
+
798
+ if(!empty($trip_itinerary)){
799
+
800
+ $i = 0;
801
+ foreach ($trip_itinerary as $itinerary){
802
+
803
+ $itinerary_html .= '<div class="saswp-trip-itinerary-table-div" data-id="'.$i.'">';
804
+ $itinerary_html .= '<a class="saswp-table-close">X</a>';
805
+ $itinerary_html .= $this->saswp_get_dynamic_html($schema_id, 'trip_itinerary', $i, $itinerary);
806
+ $itinerary_html .= '</div>';
807
+
808
+ $i++;
809
+ }
810
+
811
+ }
812
+
813
+ $tabs_fields .= $itinerary_html;
814
+
815
+ }
816
+ $tabs_fields .= '</div>';
817
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-trip-itinerary">Add Trip Itinerary</a>';
818
+ $tabs_fields .= '</div>';
819
+
820
+ //itinerary section ends here
821
+
822
+
823
+ $tabs_fields .= '</div>';
824
+ }
825
+ //Trip schema ends here
826
+
827
  $tabs_fields .= '</div>';
828
 
829
  }else{
1131
  }
1132
  //TvSeries schema ends here
1133
 
1134
+ //Trip schema starts herre
1135
+ if($schema_type == 'Trip'){
1136
+
1137
+ $schema_id = $schema->ID;
1138
+
1139
+ $tabs_fields .= '<div class="saswp-table-create-onajax">';
1140
+
1141
+ //itinerary section starts here
1142
+
1143
+ $tabs_fields .= '<div class="saswp-trip-itinerary-section-main">';
1144
+ $tabs_fields .= '<div class="saswp-trip-itinerary-section" data-id="'.esc_attr($schema_id).'">';
1145
+ if(isset($trip_data['trip_itinerary_'.$schema_id])){
1146
+
1147
+ $trip_itinerary = $trip_data['trip_itinerary_'.$schema_id];
1148
+
1149
+ $itinerary_html = '';
1150
+
1151
+ if(!empty($trip_itinerary)){
1152
+
1153
+ $i = 0;
1154
+ foreach ($trip_itinerary as $itinerary){
1155
+
1156
+ $itinerary_html .= '<div class="saswp-trip-itinerary-table-div" data-id="'.$i.'">';
1157
+ $itinerary_html .= '<a class="saswp-table-close">X</a>';
1158
+ $itinerary_html .= $this->saswp_get_dynamic_html($schema_id, 'trip_itinerary', $i, $itinerary);
1159
+ $itinerary_html .= '</div>';
1160
+
1161
+ $i++;
1162
+ }
1163
+
1164
+ }
1165
+
1166
+ $tabs_fields .= $itinerary_html;
1167
+
1168
+ }
1169
+ $tabs_fields .= '</div>';
1170
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-trip-itinerary">Add Trip Itinerary</a>';
1171
+ $tabs_fields .= '</div>';
1172
+
1173
+ //itinerary section ends here
1174
+
1175
+
1176
+ $tabs_fields .= '</div>';
1177
+ }
1178
+ //Trip schema ends here
1179
 
1180
  $tabs_fields .= '</div>';
1181
 
1194
  echo '<div class="saswp-post-specific-container">';
1195
  echo $tabs_fields;
1196
  echo '</div>';
1197
+
1198
+ //custom schema starts here
1199
+
1200
+ $custom_markup = get_post_meta($post->ID, 'saswp_custom_schema_field', true);
1201
+
1202
+ echo '<div class="saswp-add-custom-schema-div">';
1203
+
1204
+ if($custom_markup){
1205
+
1206
+ echo '<a style="display:none;" class="button saswp-add-custom-schema">'.esc_html__( 'Add Custom Schema', 'schema-and-structured-data-for-wp' ).'</a>' ;
1207
+ echo '<div class="saswp-add-custom-schema-field">';
1208
+
1209
+ }else{
1210
+
1211
+ echo '<a class="button saswp-add-custom-schema">'.esc_html__( 'Add Custom Schema', 'schema-and-structured-data-for-wp' ).'</a>' ;
1212
+ echo '<div class="saswp-add-custom-schema-field saswp_hide">';
1213
+ }
1214
+
1215
+ echo '<a class="button saswp-delete-custom-schema">Delete Custom Schema</a>';
1216
+ echo '<textarea style="margin-left:5px;" placeholder="{ Json Markup }" id="saswp_custom_schema_field" name="saswp_custom_schema_field" rows="5" cols="100">'
1217
+ . $custom_markup
1218
+ . '</textarea>';
1219
+ echo '</div>';
1220
+ echo '</div>';
1221
+
1222
+ //custom schema ends here
1223
+
1224
  echo '<input class="saswp-post-specific-schema-ids" type="hidden" value="'. json_encode($schema_ids).'">';
1225
  echo '</div>';
1226
 
1255
  $tvseries_data['tvseries_season_'.$schema->ID] = esc_sql ( get_post_meta($post->ID, 'tvseries_season_'.$schema->ID, true) );
1256
 
1257
  }
1258
+
1259
+ if($schema_type == 'Trip'){
1260
+
1261
+ $trip_data['trip_itinerary_'.$schema->ID] = esc_sql ( get_post_meta($post->ID, 'trip_itinerary_'.$schema->ID, true) );
1262
+
1263
+ }
1264
+
1265
  $this->meta_fields = $response;
1266
  $output = $this->saswp_saswp_post_specific( $post, $all_schema[0]->ID );
1267
  $tabs_fields .= '<div>';
1568
  }
1569
  //TvSeries schema ends here
1570
 
1571
+ //Trip schema starts herre
1572
+ if($schema_type == 'Trip'){
1573
+
1574
+ $schema_id = $schema->ID;
1575
+
1576
+ $tabs_fields .= '<div class="saswp-table-create-onajax">';
1577
+
1578
+ //itinerary section starts here
1579
+
1580
+ $tabs_fields .= '<div class="saswp-trip-itinerary-section-main">';
1581
+ $tabs_fields .= '<div class="saswp-trip-itinerary-section" data-id="'.esc_attr($schema_id).'">';
1582
+ if(isset($trip_data['trip_itinerary_'.$schema_id])){
1583
+
1584
+ $trip_itinerary = $trip_data['trip_itinerary_'.$schema_id];
1585
+
1586
+ $itinerary_html = '';
1587
+
1588
+ if(!empty($trip_itinerary)){
1589
+
1590
+ $i = 0;
1591
+ foreach ($trip_itinerary as $itinerary){
1592
+
1593
+ $itinerary_html .= '<div class="saswp-trip-itinerary-table-div" data-id="'.$i.'">';
1594
+ $itinerary_html .= '<a class="saswp-table-close">X</a>';
1595
+ $itinerary_html .= $this->saswp_get_dynamic_html($schema_id, 'trip_itinerary', $i, $itinerary);
1596
+ $itinerary_html .= '</div>';
1597
+
1598
+ $i++;
1599
+ }
1600
+
1601
+ }
1602
+
1603
+ $tabs_fields .= $itinerary_html;
1604
+
1605
+ }
1606
+ $tabs_fields .= '</div>';
1607
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-trip-itinerary">Add Trip Itinerary</a>';
1608
+ $tabs_fields .= '</div>';
1609
+
1610
+ //itinerary section ends here
1611
+
1612
+
1613
+ $tabs_fields .= '</div>';
1614
+ }
1615
+ //Trip schema ends here
1616
 
1617
  $tabs_fields .= '</div>';
1618
+
1619
+ //custom schema starts here
1620
+
1621
+ $custom_markup = get_post_meta($post->ID, 'saswp_custom_schema_field', true);
1622
+
1623
+ $tabs_fields.= '<div class="saswp-add-custom-schema-div">';
1624
+
1625
+ if($custom_markup){
1626
+
1627
+ $tabs_fields.= '<a style="display:none;" class="button saswp-add-custom-schema">'.esc_html__( 'Add Custom Schema', 'schema-and-structured-data-for-wp' ).'</a>' ;
1628
+ $tabs_fields.= '<div class="saswp-add-custom-schema-field">';
1629
+
1630
+ }else{
1631
+
1632
+ $tabs_fields.= '<a class="button saswp-add-custom-schema">'.esc_html__( 'Add Custom Schema', 'schema-and-structured-data-for-wp' ).'</a>' ;
1633
+ $tabs_fields.= '<div class="saswp-add-custom-schema-field saswp_hide">';
1634
+ }
1635
+
1636
+ $tabs_fields.= '<a class="button saswp-delete-custom-schema">Delete Custom Schema</a>';
1637
+ $tabs_fields.= '<textarea style="margin-left:5px;" placeholder="{ Json Markup }" id="saswp_custom_schema_field" name="saswp_custom_schema_field" rows="5" cols="100">'
1638
+ . $custom_markup
1639
+ . '</textarea>';
1640
+ $tabs_fields.= '</div>';
1641
+ $tabs_fields.= '</div>';
1642
+
1643
+ //custom schema ends here
1644
+
1645
+
1646
  $tabs_fields .= '<input class="saswp-post-specific-schema-ids" type="hidden" value="'. json_encode($schema_ids).'">';
1647
  $tabs_fields .= '</div>';
1648
  echo $tabs_fields;
1651
 
1652
  public function saswp_post_meta_box_callback() {
1653
 
 
1654
  global $post;
1655
+
1656
+ wp_nonce_field( 'post_specific_data', 'post_specific_nonce' );
1657
+ $modify_option = get_option('modify_schema_post_enable_'.esc_attr($post->ID));
1658
 
1659
  if($modify_option == 'enable'){
1660
 
1661
  $this->saswp_post_meta_box_fields($post);
1662
 
1663
+ }else{
1664
+
1665
+ echo '<a class="button saswp-modify_schema_post_enable">'.esc_html__( 'Modify Current Schema', 'schema-and-structured-data-for-wp' ).'</a>' ;
1666
+
1667
+ $custom_markup = get_post_meta($post->ID, 'saswp_custom_schema_field', true);
1668
+
1669
+ echo '<div class="saswp-add-custom-schema-div">';
1670
 
1671
+ if($custom_markup){
1672
+
1673
+ echo '<a style="display:none;" class="button saswp-add-custom-schema">'.esc_html__( 'Add Custom Schema', 'schema-and-structured-data-for-wp' ).'</a>' ;
1674
+ echo '<div class="saswp-add-custom-schema-field">';
1675
+
1676
+ }else{
1677
+
1678
+ echo '<a class="button saswp-add-custom-schema">'.esc_html__( 'Add Custom Schema', 'schema-and-structured-data-for-wp' ).'</a>' ;
1679
+ echo '<div class="saswp-add-custom-schema-field saswp_hide">';
1680
+ }
1681
+
1682
+ echo '<a class="button saswp-delete-custom-schema">Delete Custom Schema</a>';
1683
  echo '<textarea style="margin-left:5px;" placeholder="{ Json Markup }" id="saswp_custom_schema_field" name="saswp_custom_schema_field" rows="5" cols="100">'
1684
+ . $custom_markup
1685
  . '</textarea>';
1686
+ echo '</div>';
1687
+ echo '</div>';
1688
+
1689
 
 
 
 
 
1690
  }
1691
 
1692
  }
1719
  }
1720
 
1721
  }
 
 
 
1722
 
1723
+ update_post_meta($post_id, 'saswp_custom_schema_field', '');
1724
+ update_option('modify_schema_post_enable_'.$post_id, 'disable');
1725
+
1726
  if($result){
1727
 
1728
  echo json_encode(array('status'=> 't', 'msg'=>esc_html__( 'Schema has been restored', 'schema-and-structured-data-for-wp' )));
1734
  }
1735
  wp_die();
1736
  }
1737
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1738
 
1739
  public function saswp_modify_schema_post_enable(){
1740
 
2049
  || strpos($meta_field['id'], 'saswp_event_schema_start_date') !== false
2050
  || strpos($meta_field['id'], 'saswp_event_schema_end_date') !== false
2051
  || strpos($meta_field['id'], 'saswp_event_schema_validfrom') !== false
2052
+ || strpos($meta_field['id'], 'dateposted') !== false
2053
+ || strpos($meta_field['id'], 'validthrough') !== false
2054
+ || strpos($meta_field['id'], 'date_of_birth') !== false
2055
  ) {
2056
  $class='saswp-local-schema-datepicker-picker';
2057
  }
2116
  return $post_id;
2117
 
2118
  $option = get_option('modify_schema_post_enable_'.$post_id);
2119
+
2120
 
2121
+ $custom_schema = sanitize_textarea_field($_POST['saswp_custom_schema_field']);
2122
+ update_post_meta( $post_id, 'saswp_custom_schema_field', $custom_schema );
 
 
 
 
 
 
2123
 
2124
+
2125
  if($option != 'enable'){
2126
  return;
2127
  }
2252
  update_post_meta( $post_id, 'tvseries_season_'.$schema->ID, $tv_season);
2253
 
2254
  //TVSeries schema ends here
2255
+
2256
+
2257
+ //Trip schema starts here
2258
+
2259
+ $trip_itinerary = array();
2260
+
2261
+ if(isset($_POST['trip_itinerary_'.$schema->ID]) && is_array($_POST['trip_itinerary_'.$schema->ID])){
2262
+
2263
+ $data = $_POST['trip_itinerary_'.$schema->ID];
2264
+
2265
+ foreach ($data as $supply){
2266
+
2267
+ $trip_itinerary[] = array_map( 'sanitize_text_field', $supply );
2268
+ }
2269
+
2270
+ }
2271
+
2272
+ update_post_meta( $post_id, 'trip_itinerary_'.$schema->ID, $trip_itinerary);
2273
+
2274
+ //Trip schema ends here
2275
 
2276
  $response = $this->saswp_get_fields_by_schema_type($schema->ID);
2277
 
2509
 
2510
  }
2511
  $current_user = wp_get_current_user();
2512
+ $author_desc = get_the_author_meta( 'user_description' );
2513
  $author_details = get_avatar_data($current_user->ID);
2514
  $schema_type = esc_sql ( get_post_meta($schema_id, 'schema_type', true) );
2515
 
2766
  'label' => 'Description',
2767
  'id' => 'saswp_blogposting_description_'.$schema_id,
2768
  'type' => 'textarea',
2769
+ 'default' => get_the_excerpt()
2770
  ),
2771
  array(
2772
  'label' => 'Name',
2798
  'type' => 'text',
2799
  'default' => $current_user->display_name
2800
  ),
2801
+ array(
2802
+ 'label' => 'Author Description',
2803
+ 'id' => 'saswp_blogposting_author_description_'.$schema_id,
2804
+ 'type' => 'textarea',
2805
+ 'default' => $author_desc
2806
+ ),
2807
  array(
2808
  'label' => 'Organization Name',
2809
  'id' => 'saswp_blogposting_organization_name_'.$schema_id,
2849
  'id' => 'saswp_newsarticle_URL_'.$schema_id,
2850
  'type' => 'text',
2851
  'default' => get_permalink(),
2852
+ ),
2853
+ array(
2854
+ 'label' => 'Image',
2855
+ 'id' => 'saswp_newsarticle_image_'.$schema_id,
2856
+ 'type' => 'media',
2857
+ ),
2858
  array(
2859
  'label' => 'Headline',
2860
  'id' => 'saswp_newsarticle_headline_'.$schema_id,
2877
  'label' => 'Description',
2878
  'id' => 'saswp_newsarticle_description_'.$schema_id,
2879
  'type' => 'textarea',
2880
+ 'default' => get_the_excerpt()
2881
  ),
2882
  array(
2883
  'label' => 'Article Section',
2926
  'id' => 'saswp_newsarticle_author_name_'.$schema_id,
2927
  'type' => 'text',
2928
  'default' => $current_user->display_name
2929
+ ),
2930
+ array(
2931
+ 'label' => 'Author Description',
2932
+ 'id' => 'saswp_newsarticle_author_description_'.$schema_id,
2933
+ 'type' => 'textarea',
2934
+ 'default' => $author_desc
2935
+ ),
2936
  array(
2937
  'label' => 'Author Image',
2938
  'id' => 'saswp_newsarticle_author_image_'.$schema_id,
2978
  'label' => 'Description',
2979
  'id' => 'saswp_webpage_description_'.$schema_id,
2980
  'type' => 'textarea',
2981
+ 'default' => get_the_excerpt()
2982
  ),
2983
  array(
2984
  'label' => 'Main Entity Of Page',
3017
  'type' => 'text',
3018
  'default' => $current_user->display_name
3019
  ),
3020
+ array(
3021
+ 'label' => 'Author Description',
3022
+ 'id' => 'saswp_webpage_author_description_'.$schema_id,
3023
+ 'type' => 'textarea',
3024
+ 'default' => $author_desc
3025
+ ),
3026
  array(
3027
  'label' => 'Organization Name',
3028
  'id' => 'saswp_webpage_organization_name_'.$schema_id,
3068
  'label' => 'Description',
3069
  'id' => 'saswp_article_description_'.$schema_id,
3070
  'type' => 'textarea',
3071
+ 'default' => get_the_excerpt()
3072
  ) ,
3073
  array(
3074
  'label' => 'Date Published',
3088
  'type' => 'text',
3089
  'default' => $current_user->display_name
3090
  ),
3091
+ array(
3092
+ 'label' => 'Author Description',
3093
+ 'id' => 'saswp_article_author_description_'.$schema_id,
3094
+ 'type' => 'textarea',
3095
+ 'default' => $author_desc
3096
+ ),
3097
  array(
3098
  'label' => 'Organization Name',
3099
  'id' => 'saswp_article_organization_name_'.$schema_id,
3248
  'label' => 'Description',
3249
  'id' => 'saswp_tech_article_description_'.$schema_id,
3250
  'type' => 'textarea',
3251
+ 'default' => get_the_excerpt()
3252
  ) ,
3253
  array(
3254
  'label' => 'Date Published',
3268
  'type' => 'text',
3269
  'default' => $current_user->display_name
3270
  ),
3271
+ array(
3272
+ 'label' => 'Author Description',
3273
+ 'id' => 'saswp_tech_article_author_name_'.$schema_id,
3274
+ 'type' => 'textarea',
3275
+ 'default' => $author_desc
3276
+ ),
3277
  array(
3278
  'label' => 'Organization Name',
3279
  'id' => 'saswp_tech_article_organization_name_'.$schema_id,
3354
  'label' => 'Description',
3355
  'id' => 'saswp_dfp_description_'.$schema_id,
3356
  'type' => 'textarea',
3357
+ 'default' => get_the_excerpt()
3358
  ) ,
3359
  array(
3360
  'label' => 'URL',
3379
  'id' => 'saswp_dfp_author_name_'.$schema_id,
3380
  'type' => 'text',
3381
  'default' => $current_user->display_name
3382
+ ),
3383
+ array(
3384
+ 'label' => 'Author Description',
3385
+ 'id' => 'saswp_dfp_author_description_'.$schema_id,
3386
+ 'type' => 'textarea',
3387
+ 'default' => $author_desc
3388
+ )
3389
+
3390
  );
3391
  break;
3392
 
3420
  'label' => 'Description',
3421
  'id' => 'saswp_recipe_description_'.$schema_id,
3422
  'type' => 'textarea',
3423
+ 'default' => get_the_excerpt()
3424
  ),
3425
  array(
3426
  'label' => 'Main Entity Id',
3434
  'type' => 'text',
3435
  'default' => $current_user->display_name
3436
  ),
3437
+ array(
3438
+ 'label' => 'Author Description',
3439
+ 'id' => 'saswp_recipe_author_description_'.$schema_id,
3440
+ 'type' => 'textarea',
3441
+ 'default' => $author_desc
3442
+ ),
3443
  array(
3444
  'label' => 'Author Image',
3445
  'id' => 'saswp_recipe_author_image_'.$schema_id,
3946
  'default' => get_the_modified_date("Y-m-d")
3947
  ),
3948
  array(
3949
+ 'label' => 'Author Name',
3950
  'id' => 'saswp_audio_schema_author_name_'.$schema_id,
3951
  'type' => 'text',
3952
  'default' => saswp_remove_warnings($service_schema_details, 'saswp_audio_author_name', 'saswp_string')
3953
+ ),
3954
+ array(
3955
+ 'label' => 'Author Description',
3956
+ 'id' => 'saswp_audio_schema_author_description_'.$schema_id,
3957
+ 'type' => 'textarea',
3958
+ 'default' => $author_desc
3959
+ )
3960
 
3961
  );
3962
  break;
4064
  'label' => 'Description',
4065
  'id' => 'saswp_video_object_description_'.$schema_id,
4066
  'type' => 'textarea',
4067
+ 'default' => get_the_excerpt()
4068
  ),
4069
  array(
4070
  'label' => 'Name',
4108
  'type' => 'text',
4109
  'default' => $current_user->display_name
4110
  ),
4111
+ array(
4112
+ 'label' => 'Author Description',
4113
+ 'id' => 'saswp_video_object_author_description_'.$schema_id,
4114
+ 'type' => 'textarea',
4115
+ 'default' => $author_desc
4116
+ ),
4117
  array(
4118
  'label' => 'Author Image',
4119
  'id' => 'saswp_video_object_author_image_'.$schema_id,
4570
 
4571
  );
4572
  break;
4573
+
4574
  case 'House':
4575
 
4576
  $meta_field = array(
5124
  );
5125
  break;
5126
 
5127
+ case 'JobPosting':
5128
+
5129
+ $meta_field = array(
5130
+ array(
5131
+ 'label' => 'Title',
5132
+ 'id' => 'saswp_jobposting_schema_title_'.$schema_id,
5133
+ 'type' => 'text',
5134
+ 'attributes' => array(
5135
+ 'placeholder' => 'Title'
5136
+ ),
5137
+ ),
5138
+ array(
5139
+ 'label' => 'Description',
5140
+ 'id' => 'saswp_jobposting_schema_description_'.$schema_id,
5141
+ 'type' => 'textarea',
5142
+ 'attributes' => array(
5143
+ 'placeholder' => 'Description'
5144
+ ),
5145
+ ),
5146
+ array(
5147
+ 'label' => 'URL',
5148
+ 'id' => 'saswp_jobposting_schema_url_'.$schema_id,
5149
+ 'type' => 'text',
5150
+ 'default' => get_permalink()
5151
+ ),
5152
+ array(
5153
+ 'label' => 'Date Posted',
5154
+ 'id' => 'saswp_jobposting_schema_dateposted_'.$schema_id,
5155
+ 'type' => 'text',
5156
+ ),
5157
+ array(
5158
+ 'label' => 'Valid Through',
5159
+ 'id' => 'saswp_jobposting_schema_validthrough_'.$schema_id,
5160
+ 'type' => 'text',
5161
+ ),
5162
+ array(
5163
+ 'label' => 'Employment Type',
5164
+ 'id' => 'saswp_jobposting_schema_employment_type_'.$schema_id,
5165
+ 'type' => 'select',
5166
+ 'options' => array(
5167
+ 'Full-Time' => 'Full-Time',
5168
+ 'Part-Time' => 'Part-Time',
5169
+ 'Contractor' => 'Contractor',
5170
+ )
5171
+ ),
5172
+ array(
5173
+ 'label' => 'Hiring Organization Name',
5174
+ 'id' => 'saswp_jobposting_schema_ho_name_'.$schema_id,
5175
+ 'type' => 'text',
5176
+ ),
5177
+ array(
5178
+ 'label' => 'Hiring Organization URL',
5179
+ 'id' => 'saswp_jobposting_schema_ho_url_'.$schema_id,
5180
+ 'type' => 'text',
5181
+ ),
5182
+ array(
5183
+ 'label' => 'Hiring Organization Logo',
5184
+ 'id' => 'saswp_jobposting_schema_ho_logo_'.$schema_id,
5185
+ 'type' => 'media',
5186
+ ),
5187
+ array(
5188
+ 'label' => 'Street Address',
5189
+ 'id' => 'saswp_jobposting_schema_street_address_'.$schema_id,
5190
+ 'type' => 'text',
5191
+ ),
5192
+ array(
5193
+ 'label' => 'Address Locality',
5194
+ 'id' => 'saswp_jobposting_schema_locality_'.$schema_id,
5195
+ 'type' => 'text',
5196
+ ),
5197
+ array(
5198
+ 'label' => 'Address Region',
5199
+ 'id' => 'saswp_jobposting_schema_region_'.$schema_id,
5200
+ 'type' => 'text',
5201
+ ),
5202
+ array(
5203
+ 'label' => 'Address Postal Code',
5204
+ 'id' => 'saswp_jobposting_schema_postalcode_'.$schema_id,
5205
+ 'type' => 'text',
5206
+ ),
5207
+ array(
5208
+ 'label' => 'Address Country',
5209
+ 'id' => 'saswp_jobposting_schema_country_'.$schema_id,
5210
+ 'type' => 'text',
5211
+ ),
5212
+ array(
5213
+ 'label' => 'Base Salary Currency',
5214
+ 'id' => 'saswp_jobposting_schema_bs_currency_'.$schema_id,
5215
+ 'type' => 'text',
5216
+ 'attributes' => array(
5217
+ 'placeholder' => 'USD'
5218
+ )
5219
+ ),
5220
+ array(
5221
+ 'label' => 'Base Salary Value',
5222
+ 'id' => 'saswp_jobposting_schema_bs_value_'.$schema_id,
5223
+ 'type' => 'text',
5224
+ 'attributes' => array(
5225
+ 'placeholder' => '40.00'
5226
+ )
5227
+ ),
5228
+ array(
5229
+ 'label' => 'Base Salary Unit Text',
5230
+ 'id' => 'saswp_jobposting_schema_bs_unittext_'.$schema_id,
5231
+ 'type' => 'text',
5232
+ 'attributes' => array(
5233
+ 'placeholder' => 'Hour'
5234
+ )
5235
+ ),
5236
+
5237
+
5238
+ );
5239
+ break;
5240
+
5241
+ case 'Trip':
5242
+
5243
+ $meta_field = array(
5244
+ array(
5245
+ 'label' => 'Name',
5246
+ 'id' => 'saswp_trip_schema_name_'.$schema_id,
5247
+ 'type' => 'text',
5248
+ 'attributes' => array(
5249
+ 'placeholder' => 'Name'
5250
+ ),
5251
+ ),
5252
+ array(
5253
+ 'label' => 'Description',
5254
+ 'id' => 'saswp_trip_schema_description_'.$schema_id,
5255
+ 'type' => 'textarea',
5256
+ 'attributes' => array(
5257
+ 'placeholder' => 'Description'
5258
+ )
5259
+ ),
5260
+ array(
5261
+ 'label' => 'URL',
5262
+ 'id' => 'saswp_trip_schema_url_'.$schema_id,
5263
+ 'type' => 'text',
5264
+ 'default' => get_permalink()
5265
+ ),
5266
+ array(
5267
+ 'label' => 'Image',
5268
+ 'id' => 'saswp_trip_schema_image_'.$schema_id,
5269
+ 'type' => 'media'
5270
+ )
5271
+
5272
+
5273
+ );
5274
+ break;
5275
+
5276
+ case 'Person':
5277
+
5278
+ $meta_field = array(
5279
+ array(
5280
+ 'label' => 'Name',
5281
+ 'id' => 'saswp_person_schema_name_'.$schema_id,
5282
+ 'type' => 'text',
5283
+ ),
5284
+ array(
5285
+ 'label' => 'Description',
5286
+ 'id' => 'saswp_person_schema_description_'.$schema_id,
5287
+ 'type' => 'textarea',
5288
+ ),
5289
+ array(
5290
+ 'label' => 'URL',
5291
+ 'id' => 'saswp_person_schema_url_'.$schema_id,
5292
+ 'type' => 'text',
5293
+ 'default' => get_permalink()
5294
+ ),
5295
+ array(
5296
+ 'label' => 'Street Address',
5297
+ 'id' => 'saswp_person_schema_street_address_'.$schema_id,
5298
+ 'type' => 'text',
5299
+
5300
+ ),
5301
+ array(
5302
+ 'label' => 'Locality',
5303
+ 'id' => 'saswp_person_schema_locality_'.$schema_id,
5304
+ 'type' => 'text',
5305
+
5306
+ ),
5307
+ array(
5308
+ 'label' => 'Region',
5309
+ 'id' => 'saswp_person_schema_region_'.$schema_id,
5310
+ 'type' => 'text',
5311
+ ),
5312
+ array(
5313
+ 'label' => 'Postal Code',
5314
+ 'id' => 'saswp_person_schema_postal_code_'.$schema_id,
5315
+ 'type' => 'text',
5316
+ ),
5317
+ array(
5318
+ 'label' => 'Country',
5319
+ 'id' => 'saswp_person_schema_country_'.$schema_id,
5320
+ 'type' => 'text',
5321
+ ),
5322
+ array(
5323
+ 'label' => 'Email',
5324
+ 'id' => 'saswp_person_schema_email_'.$schema_id,
5325
+ 'type' => 'text',
5326
+ ),
5327
+ array(
5328
+ 'label' => 'Telephone',
5329
+ 'id' => 'saswp_person_schema_telephone_'.$schema_id,
5330
+ 'type' => 'text',
5331
+ ),
5332
+ array(
5333
+ 'label' => 'Gender',
5334
+ 'id' => 'saswp_person_schema_gender_'.$schema_id,
5335
+ 'type' => 'select',
5336
+ 'options' => array(
5337
+ 'Male' => 'Male',
5338
+ 'Female' => 'Female',
5339
+ )
5340
+ ),
5341
+ array(
5342
+ 'label' => 'Date Of Birth',
5343
+ 'id' => 'saswp_person_schema_date_of_birth_'.$schema_id,
5344
+ 'type' => 'text',
5345
+ ),
5346
+ array(
5347
+ 'label' => 'Member Of',
5348
+ 'id' => 'saswp_person_schema_member_of_'.$schema_id,
5349
+ 'type' => 'text',
5350
+ ),
5351
+ array(
5352
+ 'label' => 'Nationality',
5353
+ 'id' => 'saswp_person_schema_nationality_'.$schema_id,
5354
+ 'type' => 'text',
5355
+ ),
5356
+ array(
5357
+ 'label' => 'Image',
5358
+ 'id' => 'saswp_person_schema_image_'.$schema_id,
5359
+ 'type' => 'media',
5360
+ ),
5361
+ array(
5362
+ 'label' => 'Job Title',
5363
+ 'id' => 'saswp_person_schema_job_title_'.$schema_id,
5364
+ 'type' => 'text',
5365
+ ),
5366
+
5367
+ );
5368
+ break;
5369
+
5370
  default:
5371
  break;
5372
  }
view/schema_type.php CHANGED
@@ -695,7 +695,10 @@
695
  'VideoGame' => 'VideoGame'
696
  ),
697
  'Intangible' => array(
698
- 'Service' => 'Service',
 
 
 
699
  ),
700
  'Media' => array(
701
  'AudioObject' => 'AudioObject',
@@ -719,6 +722,9 @@
719
  'HinduTemple' => 'HinduTemple',
720
  'Church' => 'Church',
721
  'Mosque' => 'Mosque',
 
 
 
722
  )
723
  );
724
  $all_business_type = array(
695
  'VideoGame' => 'VideoGame'
696
  ),
697
  'Intangible' => array(
698
+ 'JobPosting' => 'JobPosting',
699
+ 'Service' => 'Service',
700
+ 'Trip' => 'Trip',
701
+
702
  ),
703
  'Media' => array(
704
  'AudioObject' => 'AudioObject',
722
  'HinduTemple' => 'HinduTemple',
723
  'Church' => 'Church',
724
  'Mosque' => 'Mosque',
725
+ ),
726
+ 'Thing' => array(
727
+ 'Person' => 'Person',
728
  )
729
  );
730
  $all_business_type = array(