Version Description
(21 June 2019) =
- Bug Fixed: Fatal error ( Uncaught Error: Cannot use object of type Closure as array ) #317
- Bug Fixed: Call to undefined function ampforwp_is_home() #330
- Bug Fixed: Micro Data cleanup properly does not work #337
- Bug Fixed: View Post option should not be there in schema post type admin menu bar #327
- Bug Fixed: count(): Parameter must be an array or an object that implements Countable in #309
- Improvement: If Yoast plugin is active then the checkbox should be on by default in the compatibility section #338
- Improvement: Change message "AMP Requires Selected Plugin" in AMP tab #328
- Added: Aggregate rating fields in Recipe Schema type #331
Download this release
Release Info
Developer | magazine3 |
Plugin | Schema & Structured Data for WP & AMP |
Version | 1.8.7 |
Comparing to | |
See all releases |
Code changes from version 1.8.6 to 1.8.7
- admin_section/common-function.php +103 -3
- admin_section/fields-generator.php +3 -3
- admin_section/js/main-script.js +2 -3
- admin_section/settings.php +17 -17
- admin_section/structure_admin.php +5 -4
- google_review/google_review.php +6 -28
- google_review/google_review_setup.php +0 -1
- output/flexmls.php +3 -0
- output/function.php +38 -8
- output/output.php +103 -119
- output/review-output.php +5 -3
- output/service.php +16 -36
- readme.txt +18 -2
- structured-data-for-wp.php +4 -6
- view/post_specific.php +129 -29
admin_section/common-function.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
* We are here fetching all schema and its settings from backup files
|
4 |
* note: Transaction is applied on this function, if any error occure all the data will be rollbacked
|
@@ -1292,12 +1294,19 @@ function saswp_defaultSettings(){
|
|
1292 |
|
1293 |
//AMP Block
|
1294 |
'saswp-for-amp' => 1,
|
1295 |
-
'saswp-for-wordpress' => 1,
|
|
|
1296 |
'saswp-logo-width' => '60',
|
1297 |
'saswp-logo-height' => '60',
|
1298 |
'sd_initial_wizard_status' => 1,
|
1299 |
|
1300 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
1301 |
|
1302 |
if(is_array($logo)){
|
1303 |
|
@@ -1703,11 +1712,12 @@ function saswp_frontend_enqueue(){
|
|
1703 |
/**
|
1704 |
* Here we are modifying the default excerpt
|
1705 |
* @global type $post
|
1706 |
-
* @return type
|
1707 |
*/
|
1708 |
function saswp_get_the_excerpt() {
|
1709 |
|
1710 |
global $post;
|
|
|
1711 |
$excerpt = '';
|
1712 |
if(is_object($post)){
|
1713 |
|
@@ -1735,6 +1745,96 @@ function saswp_get_the_excerpt() {
|
|
1735 |
$excerpt = wp_strip_all_tags(strip_shortcodes($excerpt));
|
1736 |
|
1737 |
}
|
|
|
|
|
|
|
|
|
1738 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1739 |
return $excerpt;
|
1740 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
+
// Exit if accessed directly
|
3 |
+
if ( ! defined('ABSPATH') ) exit;
|
4 |
/**
|
5 |
* We are here fetching all schema and its settings from backup files
|
6 |
* note: Transaction is applied on this function, if any error occure all the data will be rollbacked
|
1294 |
|
1295 |
//AMP Block
|
1296 |
'saswp-for-amp' => 1,
|
1297 |
+
'saswp-for-wordpress' => 1,
|
1298 |
+
'saswp-yoast' => 1,
|
1299 |
'saswp-logo-width' => '60',
|
1300 |
'saswp-logo-height' => '60',
|
1301 |
'sd_initial_wizard_status' => 1,
|
1302 |
|
1303 |
+
);
|
1304 |
+
|
1305 |
+
if(is_plugin_active('wordpress-seo/wp-seo.php') || is_plugin_active('wordpress-seo-premium/wp-seo-premium.php')){
|
1306 |
+
|
1307 |
+
$defaults['saswp-yoast'] = 1;
|
1308 |
+
|
1309 |
+
}
|
1310 |
|
1311 |
if(is_array($logo)){
|
1312 |
|
1712 |
/**
|
1713 |
* Here we are modifying the default excerpt
|
1714 |
* @global type $post
|
1715 |
+
* @return type string
|
1716 |
*/
|
1717 |
function saswp_get_the_excerpt() {
|
1718 |
|
1719 |
global $post;
|
1720 |
+
global $sd_data;
|
1721 |
$excerpt = '';
|
1722 |
if(is_object($post)){
|
1723 |
|
1745 |
$excerpt = wp_strip_all_tags(strip_shortcodes($excerpt));
|
1746 |
|
1747 |
}
|
1748 |
+
|
1749 |
+
if(saswp_global_option() && saswp_remove_warnings($sd_data, 'saswp-yoast', 'saswp_string') == 1){
|
1750 |
+
|
1751 |
+
$yoast_meta_des = get_post_meta($post->ID, '_yoast_wpseo_metadesc', true);
|
1752 |
|
1753 |
+
if($yoast_meta_des){
|
1754 |
+
|
1755 |
+
$excerpt = $yoast_meta_des;
|
1756 |
+
|
1757 |
+
}
|
1758 |
+
|
1759 |
+
}
|
1760 |
+
|
1761 |
return $excerpt;
|
1762 |
}
|
1763 |
+
|
1764 |
+
/**
|
1765 |
+
* since @1.8.7
|
1766 |
+
* Here we are modifying the default title
|
1767 |
+
* @global type $post
|
1768 |
+
* @return type string
|
1769 |
+
*/
|
1770 |
+
function saswp_get_the_title(){
|
1771 |
+
|
1772 |
+
global $post;
|
1773 |
+
global $sd_data;
|
1774 |
+
|
1775 |
+
if(saswp_global_option() && saswp_remove_warnings($sd_data, 'saswp-yoast', 'saswp_string') == 1){
|
1776 |
+
|
1777 |
+
if(is_object($post)){
|
1778 |
+
|
1779 |
+
$yoast_title = get_post_meta($post->ID, '_yoast_wpseo_title', true);
|
1780 |
+
|
1781 |
+
}
|
1782 |
+
|
1783 |
+
if($yoast_title){
|
1784 |
+
|
1785 |
+
$title = $yoast_title;
|
1786 |
+
|
1787 |
+
}else{
|
1788 |
+
|
1789 |
+
$title = get_the_title();
|
1790 |
+
|
1791 |
+
}
|
1792 |
+
|
1793 |
+
}else{
|
1794 |
+
|
1795 |
+
$title = get_the_title();
|
1796 |
+
}
|
1797 |
+
|
1798 |
+
return $title;
|
1799 |
+
|
1800 |
+
}
|
1801 |
+
/**
|
1802 |
+
* since @1.8.7
|
1803 |
+
* Get the author details
|
1804 |
+
* @global type $post
|
1805 |
+
* @return type array
|
1806 |
+
*/
|
1807 |
+
function saswp_get_author_details(){
|
1808 |
+
|
1809 |
+
global $post;
|
1810 |
+
|
1811 |
+
$author_details = array();
|
1812 |
+
|
1813 |
+
$author_id = get_the_author_meta('ID');
|
1814 |
+
$author_name = get_the_author();
|
1815 |
+
$author_desc = get_the_author_meta( 'user_description' );
|
1816 |
+
|
1817 |
+
if(!$author_name && is_object($post)){
|
1818 |
+
|
1819 |
+
$author_id = get_post_field ('post_author', $post->ID);
|
1820 |
+
$author_name = get_the_author_meta( 'display_name' , $author_id );
|
1821 |
+
|
1822 |
+
}
|
1823 |
+
|
1824 |
+
$author_image = get_avatar_data($author_id);
|
1825 |
+
|
1826 |
+
$author_details['@type'] = 'Person';
|
1827 |
+
$author_details['name'] = esc_attr($author_name);
|
1828 |
+
$author_details['description'] = esc_attr($author_desc);
|
1829 |
+
|
1830 |
+
if(isset($author_image['url']) && isset($author_image['height']) && isset($author_image['width'])){
|
1831 |
+
|
1832 |
+
$author_details['image']['@type'] = 'ImageObject';
|
1833 |
+
$author_details['image']['url'] = $author_image['url'];
|
1834 |
+
$author_details['image']['height'] = $author_image['height'];
|
1835 |
+
$author_details['image']['width'] = $author_image['width'];
|
1836 |
+
|
1837 |
+
}
|
1838 |
+
|
1839 |
+
return $author_details;
|
1840 |
+
}
|
admin_section/fields-generator.php
CHANGED
@@ -217,12 +217,12 @@ class saswp_fields_generator {
|
|
217 |
|
218 |
$reg_menus = get_registered_nav_menus();
|
219 |
$locations = get_nav_menu_locations();
|
220 |
-
|
221 |
if($reg_menus){
|
222 |
|
223 |
foreach ($reg_menus as $type => $title){
|
224 |
-
|
225 |
-
if($locations[$type]){
|
226 |
|
227 |
$checked = '';
|
228 |
|
217 |
|
218 |
$reg_menus = get_registered_nav_menus();
|
219 |
$locations = get_nav_menu_locations();
|
220 |
+
|
221 |
if($reg_menus){
|
222 |
|
223 |
foreach ($reg_menus as $type => $title){
|
224 |
+
|
225 |
+
if(array_key_exists($type, $locations) && $locations[$type]){
|
226 |
|
227 |
$checked = '';
|
228 |
|
admin_section/js/main-script.js
CHANGED
@@ -72,14 +72,13 @@ jQuery(document).ready(function($){
|
|
72 |
$(".saswp-softwareapplication-text-field-tr").show();
|
73 |
}
|
74 |
|
75 |
-
|
76 |
if(schematype == 'qanda'){
|
77 |
$(".saswp-schem-type-note").removeClass('saswp_hide');
|
78 |
}
|
79 |
|
80 |
$(".saswp-job-posting-note").addClass('saswp_hide');
|
81 |
-
|
82 |
-
|
83 |
// if(schematype == 'JobPosting'){
|
84 |
// $(".saswp-job-posting-note").removeClass('saswp_hide');
|
85 |
// }
|
72 |
$(".saswp-softwareapplication-text-field-tr").show();
|
73 |
}
|
74 |
|
75 |
+
$(".saswp-schem-type-note").addClass('saswp_hide');
|
76 |
if(schematype == 'qanda'){
|
77 |
$(".saswp-schem-type-note").removeClass('saswp_hide');
|
78 |
}
|
79 |
|
80 |
$(".saswp-job-posting-note").addClass('saswp_hide');
|
81 |
+
|
|
|
82 |
// if(schematype == 'JobPosting'){
|
83 |
// $(".saswp-job-posting-note").removeClass('saswp_hide');
|
84 |
// }
|
admin_section/settings.php
CHANGED
@@ -439,7 +439,7 @@ function saswp_amp_page_callback(){
|
|
439 |
$non_amp_enable_field['attributes'] = array(
|
440 |
'disabled' => 'disabled'
|
441 |
);
|
442 |
-
$non_amp_enable_field['note'] = esc_html__('
|
443 |
$settings['saswp-for-amp'] = 0;
|
444 |
|
445 |
}
|
@@ -460,7 +460,7 @@ function saswp_amp_page_callback(){
|
|
460 |
)
|
461 |
);
|
462 |
echo '<div class="saswp-heading">';
|
463 |
-
echo '<h2>'.esc_html__('
|
464 |
echo '</div>';
|
465 |
echo '<p>Using this option, one can hide and show schema markup on AMP and Non AMP</p>';
|
466 |
|
@@ -1304,7 +1304,7 @@ function saswp_email_schema_callback(){
|
|
1304 |
|
1305 |
if(!is_plugin_active('woocommerce/woocommerce.php') || !is_plugin_active('woocommerce-bookings/woocommerce-bookings.php')){
|
1306 |
|
1307 |
-
$woocommerce['note'] = esc_html__('Requires
|
1308 |
|
1309 |
}
|
1310 |
|
@@ -1482,50 +1482,50 @@ function saswp_compatibility_page_callback(){
|
|
1482 |
|
1483 |
if(!is_plugin_active('taqyeem/taqyeem.php') || get_template() != 'jannah' ){
|
1484 |
|
1485 |
-
$tagyeem['note'] = esc_html__('Requires
|
1486 |
|
1487 |
}
|
1488 |
|
1489 |
if(!is_plugin_active('bbpress/bbpress.php')){
|
1490 |
|
1491 |
-
$bbpress['note'] = esc_html__('Requires
|
1492 |
|
1493 |
}
|
1494 |
|
1495 |
|
1496 |
if(!is_plugin_active('wordpress-seo/wp-seo.php') && !is_plugin_active('wordpress-seo-premium/wp-seo-premium.php')){
|
1497 |
|
1498 |
-
$yoast['note'] = esc_html__('Requires
|
1499 |
|
1500 |
|
1501 |
}
|
1502 |
if(!is_plugin_active('seo-by-rank-math/rank-math.php') && !is_plugin_active('seo-by-rank-math-premium/rank-math-premium.php')){
|
1503 |
|
1504 |
-
$rankmath['note'] = esc_html__('Requires
|
1505 |
|
1506 |
|
1507 |
}
|
1508 |
|
1509 |
if(!is_plugin_active('kk-star-ratings/index.php')){
|
1510 |
|
1511 |
-
$kk_star['note'] = esc_html__('Requires
|
1512 |
|
1513 |
}
|
1514 |
|
1515 |
if(!is_plugin_active('woocommerce/woocommerce.php')){
|
1516 |
|
1517 |
-
$woocommerce['note'] = esc_html__('Requires
|
1518 |
|
1519 |
}
|
1520 |
if(!is_plugin_active('woocommerce/woocommerce.php') || !is_plugin_active('woocommerce-bookings/woocommerce-bookings.php')){
|
1521 |
|
1522 |
-
$woocommerce_bok['note'] = esc_html__('Requires
|
1523 |
|
1524 |
}
|
1525 |
|
1526 |
if(!is_plugin_active('woocommerce/woocommerce.php') || !is_plugin_active('woocommerce-memberships/woocommerce-memberships.php')){
|
1527 |
|
1528 |
-
$woocommerce_mem['note'] = esc_html__('Requires
|
1529 |
|
1530 |
}
|
1531 |
|
@@ -1551,25 +1551,25 @@ function saswp_compatibility_page_callback(){
|
|
1551 |
|
1552 |
if(is_plugin_active('cooked/cooked.php') || is_plugin_active('cooked-pro/cooked-pro.php')){
|
1553 |
}else{
|
1554 |
-
$cooked['note'] = esc_html__('Requires
|
1555 |
}
|
1556 |
|
1557 |
if(get_template() != 'Extra'){
|
1558 |
|
1559 |
-
$extratheme['note'] = esc_html__('
|
1560 |
|
1561 |
|
1562 |
}
|
1563 |
|
1564 |
if(!is_plugin_active('dw-question-answer/dw-question-answer.php')){
|
1565 |
|
1566 |
-
$dwquestiton['note'] = esc_html__('Requires
|
1567 |
|
1568 |
}
|
1569 |
|
1570 |
if(!is_plugin_active('wp-postratings/wp-postratings.php')){
|
1571 |
|
1572 |
-
$wppostratings['note'] = esc_html__('Requires
|
1573 |
|
1574 |
}
|
1575 |
|
@@ -1581,7 +1581,7 @@ function saswp_compatibility_page_callback(){
|
|
1581 |
|
1582 |
if(!is_plugin_active('the-events-calendar/the-events-calendar.php')){
|
1583 |
|
1584 |
-
$the_events_calendar['note'] = esc_html__('Requires
|
1585 |
|
1586 |
}
|
1587 |
|
@@ -1637,7 +1637,7 @@ function saswp_compatibility_page_callback(){
|
|
1637 |
'name' => 'saswp-flexmlx-compativility-checkbox',
|
1638 |
'type' => 'checkbox',
|
1639 |
'class' => 'checkbox saswp-checkbox',
|
1640 |
-
'note' => 'Requires
|
1641 |
'hidden' => array(
|
1642 |
'id' => 'saswp-flexmlx-compativility',
|
1643 |
'name' => 'sd_data[saswp-flexmlx-compativility]',
|
439 |
$non_amp_enable_field['attributes'] = array(
|
440 |
'disabled' => 'disabled'
|
441 |
);
|
442 |
+
$non_amp_enable_field['note'] = esc_html__('Requires','schema-and-structured-data-for-wp'). ' <a target="_blank" href="https://wordpress.org/plugins/accelerated-mobile-pages/">AMP for WP</a> or <a target="_blank" href="https://wordpress.org/plugins/amp/">AMP</a>';
|
443 |
$settings['saswp-for-amp'] = 0;
|
444 |
|
445 |
}
|
460 |
)
|
461 |
);
|
462 |
echo '<div class="saswp-heading">';
|
463 |
+
echo '<h2>'.esc_html__('Enable On','schema-and-structured-data-for-wp').'</h2>';
|
464 |
echo '</div>';
|
465 |
echo '<p>Using this option, one can hide and show schema markup on AMP and Non AMP</p>';
|
466 |
|
1304 |
|
1305 |
if(!is_plugin_active('woocommerce/woocommerce.php') || !is_plugin_active('woocommerce-bookings/woocommerce-bookings.php')){
|
1306 |
|
1307 |
+
$woocommerce['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/woocommerce/">Woocommerce</a>';
|
1308 |
|
1309 |
}
|
1310 |
|
1482 |
|
1483 |
if(!is_plugin_active('taqyeem/taqyeem.php') || get_template() != 'jannah' ){
|
1484 |
|
1485 |
+
$tagyeem['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://codecanyon.net/item/taqyeem-wordpress-review-plugin/4558799">Taqyeem</a>';
|
1486 |
|
1487 |
}
|
1488 |
|
1489 |
if(!is_plugin_active('bbpress/bbpress.php')){
|
1490 |
|
1491 |
+
$bbpress['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/bbpress/">bbPress</a>';
|
1492 |
|
1493 |
}
|
1494 |
|
1495 |
|
1496 |
if(!is_plugin_active('wordpress-seo/wp-seo.php') && !is_plugin_active('wordpress-seo-premium/wp-seo-premium.php')){
|
1497 |
|
1498 |
+
$yoast['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/wordpress-seo/">Yoast SEO</a>';
|
1499 |
|
1500 |
|
1501 |
}
|
1502 |
if(!is_plugin_active('seo-by-rank-math/rank-math.php') && !is_plugin_active('seo-by-rank-math-premium/rank-math-premium.php')){
|
1503 |
|
1504 |
+
$rankmath['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/seo-by-rank-math/">WordPress SEO Plugin – Rank Math</a>';
|
1505 |
|
1506 |
|
1507 |
}
|
1508 |
|
1509 |
if(!is_plugin_active('kk-star-ratings/index.php')){
|
1510 |
|
1511 |
+
$kk_star['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/kk-star-ratings/">kk Star Rating</a>';
|
1512 |
|
1513 |
}
|
1514 |
|
1515 |
if(!is_plugin_active('woocommerce/woocommerce.php')){
|
1516 |
|
1517 |
+
$woocommerce['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/woocommerce/">Woocommerce</a>';
|
1518 |
|
1519 |
}
|
1520 |
if(!is_plugin_active('woocommerce/woocommerce.php') || !is_plugin_active('woocommerce-bookings/woocommerce-bookings.php')){
|
1521 |
|
1522 |
+
$woocommerce_bok['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/woocommerce/">Woocommerce</a>';
|
1523 |
|
1524 |
}
|
1525 |
|
1526 |
if(!is_plugin_active('woocommerce/woocommerce.php') || !is_plugin_active('woocommerce-memberships/woocommerce-memberships.php')){
|
1527 |
|
1528 |
+
$woocommerce_mem['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/woocommerce/">Woocommerce</a>';
|
1529 |
|
1530 |
}
|
1531 |
|
1551 |
|
1552 |
if(is_plugin_active('cooked/cooked.php') || is_plugin_active('cooked-pro/cooked-pro.php')){
|
1553 |
}else{
|
1554 |
+
$cooked['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/cooked/">Cooked</a>';
|
1555 |
}
|
1556 |
|
1557 |
if(get_template() != 'Extra'){
|
1558 |
|
1559 |
+
$extratheme['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://www.elegantthemes.com/gallery/extra/">Extra Theme</a>';
|
1560 |
|
1561 |
|
1562 |
}
|
1563 |
|
1564 |
if(!is_plugin_active('dw-question-answer/dw-question-answer.php')){
|
1565 |
|
1566 |
+
$dwquestiton['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/dw-question-answer/">DW Question Answer</a>';
|
1567 |
|
1568 |
}
|
1569 |
|
1570 |
if(!is_plugin_active('wp-postratings/wp-postratings.php')){
|
1571 |
|
1572 |
+
$wppostratings['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/wp-postratings/">WP-PostRatings</a>';
|
1573 |
|
1574 |
}
|
1575 |
|
1581 |
|
1582 |
if(!is_plugin_active('the-events-calendar/the-events-calendar.php')){
|
1583 |
|
1584 |
+
$the_events_calendar['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/the-events-calendar/">The Events Calendar</a>';
|
1585 |
|
1586 |
}
|
1587 |
|
1637 |
'name' => 'saswp-flexmlx-compativility-checkbox',
|
1638 |
'type' => 'checkbox',
|
1639 |
'class' => 'checkbox saswp-checkbox',
|
1640 |
+
'note' => 'Requires <a target="_blank" href="https://wordpress.org/plugins/flexmls-idx/">FlexMLS IDX</a>',
|
1641 |
'hidden' => array(
|
1642 |
'id' => 'saswp-flexmlx-compativility',
|
1643 |
'name' => 'sd_data[saswp-flexmlx-compativility]',
|
admin_section/structure_admin.php
CHANGED
@@ -307,7 +307,7 @@ function saswp_comparison_logic_checker($input){
|
|
307 |
|
308 |
$homepage ='false';
|
309 |
|
310 |
-
if(is_home() || is_front_page() || ampforwp_is_home()){
|
311 |
$homepage = 'true';
|
312 |
}
|
313 |
|
@@ -591,6 +591,7 @@ if(is_admin()){
|
|
591 |
'has_archive' => false,
|
592 |
'exclude_from_search' => true,
|
593 |
'publicly_queryable' => false,
|
|
|
594 |
'supports' => array('title'),
|
595 |
'menu_position' => 100
|
596 |
|
@@ -1027,7 +1028,7 @@ function saswp_custom_breadcrumbs() {
|
|
1027 |
|
1028 |
if($post_type == 'post') {
|
1029 |
|
1030 |
-
$variables1_titles[] =
|
1031 |
$variables2_links[] = get_permalink();
|
1032 |
|
1033 |
}
|
@@ -1074,12 +1075,12 @@ function saswp_custom_breadcrumbs() {
|
|
1074 |
|
1075 |
}
|
1076 |
|
1077 |
-
$variables1_titles[] =
|
1078 |
$variables2_links[] = get_permalink();
|
1079 |
|
1080 |
} else {
|
1081 |
|
1082 |
-
$variables1_titles[] =
|
1083 |
$variables2_links[] = get_permalink();
|
1084 |
}
|
1085 |
|
307 |
|
308 |
$homepage ='false';
|
309 |
|
310 |
+
if(is_home() || is_front_page() || ( function_exists('ampforwp_is_home') && ampforwp_is_home()) ){
|
311 |
$homepage = 'true';
|
312 |
}
|
313 |
|
591 |
'has_archive' => false,
|
592 |
'exclude_from_search' => true,
|
593 |
'publicly_queryable' => false,
|
594 |
+
'show_in_admin_bar' => false,
|
595 |
'supports' => array('title'),
|
596 |
'menu_position' => 100
|
597 |
|
1028 |
|
1029 |
if($post_type == 'post') {
|
1030 |
|
1031 |
+
$variables1_titles[] = saswp_get_the_title();
|
1032 |
$variables2_links[] = get_permalink();
|
1033 |
|
1034 |
}
|
1075 |
|
1076 |
}
|
1077 |
|
1078 |
+
$variables1_titles[] = saswp_get_the_title();
|
1079 |
$variables2_links[] = get_permalink();
|
1080 |
|
1081 |
} else {
|
1082 |
|
1083 |
+
$variables1_titles[] = saswp_get_the_title();
|
1084 |
$variables2_links[] = get_permalink();
|
1085 |
}
|
1086 |
|
google_review/google_review.php
CHANGED
@@ -113,22 +113,10 @@ class saswp_google_review{
|
|
113 |
$place = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "saswp_google_place WHERE place_id = %s", $place_id));
|
114 |
|
115 |
}
|
116 |
-
|
117 |
-
$author_id = get_the_author_meta('ID');
|
118 |
-
|
119 |
-
$author_details = get_avatar_data($author_id);
|
120 |
$date = get_the_date("Y-m-d\TH:i:s\Z");
|
121 |
$modified_date = get_the_modified_date("Y-m-d\TH:i:s\Z");
|
122 |
-
|
123 |
-
|
124 |
-
if(!$aurthor_name){
|
125 |
-
|
126 |
-
$author_id = get_post_field ('post_author', get_the_ID());
|
127 |
-
$aurthor_name = get_the_author_meta( 'display_name' , $author_id );
|
128 |
-
|
129 |
-
}
|
130 |
-
|
131 |
-
|
132 |
if($place->rating && isset($sd_data['saswp-google-review']) && $sd_data['saswp-google-review'] == 1){
|
133 |
|
134 |
$total_score = esc_attr(number_format((float)$place->rating, 2, '.', ''));
|
@@ -139,27 +127,17 @@ class saswp_google_review{
|
|
139 |
'dateCreated' => esc_html($date),
|
140 |
'datePublished' => esc_html($date),
|
141 |
'dateModified' => esc_html($modified_date),
|
142 |
-
'headline' =>
|
143 |
-
'name' =>
|
144 |
'url' => get_permalink(),
|
145 |
'description' => saswp_get_the_excerpt(),
|
146 |
'copyrightYear' => get_the_time( 'Y' ),
|
147 |
-
'author' =>
|
148 |
-
'@type' => 'Person',
|
149 |
-
'name' => esc_attr($aurthor_name),
|
150 |
-
'image' => array(
|
151 |
-
'@type' => 'ImageObject',
|
152 |
-
'url' => saswp_remove_warnings($author_details, 'url', 'saswp_string'),
|
153 |
-
'height' => saswp_remove_warnings($author_details, 'height', 'saswp_string'),
|
154 |
-
'width' => saswp_remove_warnings($author_details, 'width', 'saswp_string')
|
155 |
-
),
|
156 |
-
),
|
157 |
-
|
158 |
);
|
159 |
|
160 |
$input1['itemReviewed'] = array(
|
161 |
'@type' => 'Thing',
|
162 |
-
'name' =>
|
163 |
);
|
164 |
|
165 |
$input1['reviewRating'] = array(
|
113 |
$place = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "saswp_google_place WHERE place_id = %s", $place_id));
|
114 |
|
115 |
}
|
116 |
+
|
|
|
|
|
|
|
117 |
$date = get_the_date("Y-m-d\TH:i:s\Z");
|
118 |
$modified_date = get_the_modified_date("Y-m-d\TH:i:s\Z");
|
119 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
if($place->rating && isset($sd_data['saswp-google-review']) && $sd_data['saswp-google-review'] == 1){
|
121 |
|
122 |
$total_score = esc_attr(number_format((float)$place->rating, 2, '.', ''));
|
127 |
'dateCreated' => esc_html($date),
|
128 |
'datePublished' => esc_html($date),
|
129 |
'dateModified' => esc_html($modified_date),
|
130 |
+
'headline' => saswp_get_the_title(),
|
131 |
+
'name' => saswp_get_the_title(),
|
132 |
'url' => get_permalink(),
|
133 |
'description' => saswp_get_the_excerpt(),
|
134 |
'copyrightYear' => get_the_time( 'Y' ),
|
135 |
+
'author' => saswp_get_author_details()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
);
|
137 |
|
138 |
$input1['itemReviewed'] = array(
|
139 |
'@type' => 'Thing',
|
140 |
+
'name' => saswp_get_the_title(),
|
141 |
);
|
142 |
|
143 |
$input1['reviewRating'] = array(
|
google_review/google_review_setup.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
4 |
|
5 |
add_action('admin_init', 'saswp_create_database_for_existing_users');
|
1 |
<?php
|
|
|
2 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
3 |
|
4 |
add_action('admin_init', 'saswp_create_database_for_existing_users');
|
output/flexmls.php
CHANGED
@@ -1,4 +1,7 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
2 |
class saswp_flexmls_list extends flexmlsConnectPageCore{
|
3 |
|
4 |
public $shorcode = array();
|
1 |
<?php
|
2 |
+
// Exit if accessed directly.
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
4 |
+
|
5 |
class saswp_flexmls_list extends flexmlsConnectPageCore{
|
6 |
|
7 |
public $shorcode = array();
|
output/function.php
CHANGED
@@ -1,4 +1,7 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
2 |
add_filter( 'amp_init', 'saswp_schema_markup_hook_on_init' );
|
3 |
add_action( 'init', 'saswp_schema_markup_hook_on_init');
|
4 |
|
@@ -417,7 +420,7 @@ function saswp_reading_time_and_word_count() {
|
|
417 |
|
418 |
// Count the words in the content.
|
419 |
$word_count = 0;
|
420 |
-
$text = trim( strip_tags( get_the_content() ) );
|
421 |
$word_count = substr_count( "$text ", ' ' );
|
422 |
|
423 |
// How many seconds (total)?
|
@@ -731,13 +734,38 @@ function saswp_remove_yoast_product_schema(){
|
|
731 |
if(saswp_global_option() && saswp_remove_warnings($sd_data, 'saswp-yoast', 'saswp_string') == 1){
|
732 |
|
733 |
if(isset($wp_filter['wp_footer'])){
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
741 |
}
|
742 |
|
743 |
}
|
@@ -811,6 +839,8 @@ function saswp_remove_microdata($content){
|
|
811 |
|
812 |
$content = preg_replace("/itemscope itemtype=(\"?)http(s?):\/\/schema.org\/(Article|BlogPosting|Blog|BreadcrumbList|AggregateRating|WebPage|Person|Organization|NewsArticle|Product|CreativeWork|ImageObject)(\"?)/", "", $content);
|
813 |
$content = preg_replace("/itemscope=(\"?)itemscope(\"?) itemtype=(\"?)http(s?):\/\/schema.org\/(Article|BlogPosting|Blog|BreadcrumbList|AggregateRating|WebPage|Person|Organization|NewsArticle|Product|CreativeWork|ImageObject)(\"?)/", "", $content);
|
|
|
|
|
814 |
$content = preg_replace("/vcard/", "", $content);
|
815 |
$content = preg_replace("/hentry/", "", $content);
|
816 |
}
|
1 |
<?php
|
2 |
+
// Exit if accessed directly.
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
4 |
+
|
5 |
add_filter( 'amp_init', 'saswp_schema_markup_hook_on_init' );
|
6 |
add_action( 'init', 'saswp_schema_markup_hook_on_init');
|
7 |
|
420 |
|
421 |
// Count the words in the content.
|
422 |
$word_count = 0;
|
423 |
+
$text = trim( strip_tags( @get_the_content() ) );
|
424 |
$word_count = substr_count( "$text ", ' ' );
|
425 |
|
426 |
// How many seconds (total)?
|
734 |
if(saswp_global_option() && saswp_remove_warnings($sd_data, 'saswp-yoast', 'saswp_string') == 1){
|
735 |
|
736 |
if(isset($wp_filter['wp_footer'])){
|
737 |
+
|
738 |
+
$callbacks = $wp_filter['wp_footer']->callbacks;
|
739 |
+
|
740 |
+
if(is_array($callbacks)){
|
741 |
+
|
742 |
+
foreach($callbacks as $key=>$actions){
|
743 |
+
|
744 |
+
if(is_array($actions)){
|
745 |
+
|
746 |
+
foreach ($actions as $actualKey => $priorities){
|
747 |
+
|
748 |
+
if(is_array($priorities['function'])){
|
749 |
+
|
750 |
+
if(is_object($priorities['function'][0])){
|
751 |
+
|
752 |
+
if ($priorities['function'][0] instanceof WPSEO_WooCommerce_Schema && $priorities['function'][1] == 'output_schema_footer') {
|
753 |
+
unset($wp_filter['wp_footer']->callbacks[$key][$actualKey]);
|
754 |
+
}
|
755 |
+
|
756 |
+
}
|
757 |
+
|
758 |
+
}
|
759 |
+
|
760 |
+
}
|
761 |
+
|
762 |
+
}
|
763 |
+
|
764 |
+
}
|
765 |
+
|
766 |
+
}
|
767 |
+
|
768 |
+
|
769 |
}
|
770 |
|
771 |
}
|
839 |
|
840 |
$content = preg_replace("/itemscope itemtype=(\"?)http(s?):\/\/schema.org\/(Article|BlogPosting|Blog|BreadcrumbList|AggregateRating|WebPage|Person|Organization|NewsArticle|Product|CreativeWork|ImageObject)(\"?)/", "", $content);
|
841 |
$content = preg_replace("/itemscope=(\"?)itemscope(\"?) itemtype=(\"?)http(s?):\/\/schema.org\/(Article|BlogPosting|Blog|BreadcrumbList|AggregateRating|WebPage|Person|Organization|NewsArticle|Product|CreativeWork|ImageObject)(\"?)/", "", $content);
|
842 |
+
$content = preg_replace("/itemscope=(\"?)itemprop(\"?) itemType=(\"?)http(s?):\/\/schema.org\/(Article|BlogPosting|Blog|BreadcrumbList|AggregateRating|WebPage|Person|Organization|NewsArticle|Product|CreativeWork|ImageObject)(\"?)/", "", $content);
|
843 |
+
$content = preg_replace("/itemscope itemprop=\"(.*?)\" itemType=(\"?)http(s?):\/\/schema.org\/(Article|BlogPosting|Blog|BreadcrumbList|AggregateRating|WebPage|Person|Organization|NewsArticle|Product|CreativeWork|ImageObject)(\"?)/", "", $content);
|
844 |
$content = preg_replace("/vcard/", "", $content);
|
845 |
$content = preg_replace("/hentry/", "", $content);
|
846 |
}
|
output/output.php
CHANGED
@@ -235,24 +235,21 @@ function saswp_schema_output() {
|
|
235 |
|
236 |
}
|
237 |
|
238 |
-
|
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);
|
244 |
$date = get_the_date("Y-m-d\TH:i:s\Z");
|
245 |
$modified_date = get_the_modified_date("Y-m-d\TH:i:s\Z");
|
246 |
-
$
|
|
|
247 |
|
248 |
-
if(!$
|
249 |
|
250 |
-
$author_id = get_post_field
|
251 |
-
$
|
252 |
|
253 |
}
|
254 |
-
|
255 |
-
|
256 |
$saswp_review_details = esc_sql ( get_post_meta(get_the_ID(), 'saswp_review_details', true));
|
257 |
|
258 |
$aggregateRating = array();
|
@@ -323,7 +320,7 @@ function saswp_schema_output() {
|
|
323 |
'@context' => 'http://schema.org',
|
324 |
'@type' => $schema_type ,
|
325 |
'@id' => get_permalink().'/#course',
|
326 |
-
'name' =>
|
327 |
'description' => $description,
|
328 |
'url' => get_permalink(),
|
329 |
'datePublished' => esc_html($date),
|
@@ -366,11 +363,7 @@ function saswp_schema_output() {
|
|
366 |
'url' => bbp_get_topic_permalink(),
|
367 |
'datePublished' => esc_html($date),
|
368 |
'dateModified' => esc_html($modified_date),
|
369 |
-
'author' =>
|
370 |
-
'@type' => 'Person',
|
371 |
-
'name' => esc_attr($aurthor_name),
|
372 |
-
'description' => esc_attr($author_desc),
|
373 |
-
),
|
374 |
'interactionStatistic' => array(
|
375 |
'@type' => 'InteractionCounter',
|
376 |
'interactionType' => 'http://schema.org/CommentAction',
|
@@ -384,16 +377,13 @@ function saswp_schema_output() {
|
|
384 |
'@context' => 'http://schema.org',
|
385 |
'@type' => 'DiscussionForumPosting' ,
|
386 |
'@id' => get_permalink().'/#blogposting',
|
387 |
-
'headline' =>
|
388 |
'description' => saswp_get_the_excerpt(),
|
389 |
'url' => get_permalink(),
|
390 |
'datePublished' => esc_html($date),
|
391 |
'dateModified' => esc_html($modified_date),
|
392 |
-
'author' =>
|
393 |
-
|
394 |
-
'name' => esc_attr($aurthor_name)
|
395 |
-
)
|
396 |
-
);
|
397 |
|
398 |
}
|
399 |
if(!empty($publisher)){
|
@@ -426,18 +416,14 @@ function saswp_schema_output() {
|
|
426 |
'@type' => 'BlogPosting' ,
|
427 |
'@id' => get_permalink().'/#blogposting',
|
428 |
'mainEntityOfPage' => get_permalink(),
|
429 |
-
'headline' =>
|
430 |
'description' => saswp_get_the_excerpt(),
|
431 |
-
'name' =>
|
432 |
'url' => get_permalink(),
|
433 |
'datePublished' => esc_html($date),
|
434 |
'dateModified' => esc_html($modified_date),
|
435 |
-
'author' =>
|
436 |
-
|
437 |
-
'name' => esc_attr($aurthor_name),
|
438 |
-
'description' => esc_attr($author_desc)
|
439 |
-
)
|
440 |
-
);
|
441 |
if(!empty($publisher)){
|
442 |
|
443 |
$input1 = array_merge($input1, $publisher);
|
@@ -476,11 +462,7 @@ function saswp_schema_output() {
|
|
476 |
'encodingFormat' => saswp_remove_warnings($schema_data, 'saswp_audio_schema_encoding_format', 'saswp_string'),
|
477 |
'datePublished' => esc_html($date),
|
478 |
'dateModified' => esc_html($modified_date),
|
479 |
-
'author' =>
|
480 |
-
'@type' => 'Person',
|
481 |
-
'name' => esc_attr($aurthor_name),
|
482 |
-
'description' => esc_attr($author_desc)
|
483 |
-
),
|
484 |
);
|
485 |
if(!empty($publisher)){
|
486 |
|
@@ -496,10 +478,10 @@ function saswp_schema_output() {
|
|
496 |
$input1['aggregateRating'] = $aggregateRating;
|
497 |
}
|
498 |
if(!empty($extra_theme_review)){
|
499 |
-
|
500 |
}
|
501 |
if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
|
502 |
-
|
503 |
}
|
504 |
|
505 |
$input1 = apply_filters('saswp_modify_audio_object_schema_output', $input1 );
|
@@ -606,11 +588,7 @@ function saswp_schema_output() {
|
|
606 |
),
|
607 |
'datePublished' => esc_html($date),
|
608 |
'dateModified' => esc_html($modified_date),
|
609 |
-
'author' =>
|
610 |
-
'@type' => 'Person',
|
611 |
-
'name' => esc_attr($aurthor_name),
|
612 |
-
'description' => esc_attr($author_desc)
|
613 |
-
),
|
614 |
);
|
615 |
|
616 |
if(isset($schema_data['saswp_software_schema_rating']) && $schema_data['saswp_software_schema_rating'] >0 && isset($schema_data['saswp_software_schema_rating_count']) && $schema_data['saswp_software_schema_rating_count'] >0 && $schema_data['saswp_software_schema_enable_rating'] == 1){
|
@@ -714,26 +692,14 @@ function saswp_schema_output() {
|
|
714 |
'@type' => $schema_type ,
|
715 |
'@id' => get_permalink().'/#recipe',
|
716 |
'url' => get_permalink(),
|
717 |
-
'name' =>
|
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' =>
|
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'),
|
731 |
-
'height' => saswp_remove_warnings($author_details, 'height', 'saswp_string'),
|
732 |
-
'width' => saswp_remove_warnings($author_details, 'width', 'saswp_string')
|
733 |
-
),
|
734 |
-
),
|
735 |
-
|
736 |
-
|
737 |
),
|
738 |
|
739 |
);
|
@@ -781,7 +747,7 @@ function saswp_schema_output() {
|
|
781 |
if((isset($sd_data['saswp-woocommerce']) && $sd_data['saswp-woocommerce'] == 1) && !empty($product_details)){
|
782 |
|
783 |
$input1 = array(
|
784 |
-
'@context'
|
785 |
'@type' => 'Product',
|
786 |
'@id' => get_permalink().'/#product',
|
787 |
'url' => get_permalink(),
|
@@ -876,14 +842,14 @@ function saswp_schema_output() {
|
|
876 |
'@type' => $schema_type ,
|
877 |
'@id' => get_permalink().'/#newsarticle',
|
878 |
'url' => get_permalink(),
|
879 |
-
'headline' =>
|
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' =>
|
887 |
'thumbnailUrl' => saswp_remove_warnings($image_details, 0, 'saswp_string'),
|
888 |
'wordCount' => saswp_remove_warnings($word_count, 'word_count', 'saswp_string'),
|
889 |
'timeRequired' => saswp_remove_warnings($word_count, 'timerequired', 'saswp_string'),
|
@@ -891,17 +857,7 @@ function saswp_schema_output() {
|
|
891 |
'@type' => 'WebPage',
|
892 |
'@id' => get_permalink(),
|
893 |
),
|
894 |
-
'author' =>
|
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)){
|
907 |
|
@@ -1031,23 +987,13 @@ function saswp_schema_output() {
|
|
1031 |
'dateCreated' => esc_html($date),
|
1032 |
'datePublished' => esc_html($date),
|
1033 |
'dateModified' => esc_html($modified_date),
|
1034 |
-
'headline' =>
|
1035 |
-
'name' =>
|
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' =>
|
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'),
|
1047 |
-
'height' => saswp_remove_warnings($author_details, 'height', 'saswp_string'),
|
1048 |
-
'width' => saswp_remove_warnings($author_details, 'width', 'saswp_string')
|
1049 |
-
),
|
1050 |
-
),
|
1051 |
|
1052 |
);
|
1053 |
|
@@ -1061,7 +1007,7 @@ function saswp_schema_output() {
|
|
1061 |
|
1062 |
$input1['itemReviewed'] = array(
|
1063 |
'@type' => 'Thing',
|
1064 |
-
'name' =>
|
1065 |
);
|
1066 |
|
1067 |
$input1['reviewRating'] = array(
|
@@ -1077,9 +1023,8 @@ function saswp_schema_output() {
|
|
1077 |
$schema_data = saswp_get_schema_data($schema_post_id, 'saswp_review_schema_details');
|
1078 |
|
1079 |
if(isset($schema_data['saswp_review_schema_item_type'])){
|
1080 |
-
|
1081 |
-
|
1082 |
-
$review_author = $aurthor_name;
|
1083 |
|
1084 |
if(isset($schema_data['saswp_review_schema_author'])){
|
1085 |
|
@@ -1145,8 +1090,7 @@ function saswp_schema_output() {
|
|
1145 |
if(isset($schema_data['saswp_review_schema_itemreviewed_sameas'])){
|
1146 |
$input1['itemReviewed']['sameAs'] = esc_url($schema_data['saswp_review_schema_itemreviewed_sameas']);
|
1147 |
}
|
1148 |
-
|
1149 |
-
|
1150 |
if(isset($schema_data['saswp_review_schema_director'])){
|
1151 |
|
1152 |
$input1['itemReviewed']['director'] = esc_attr($schema_data['saswp_review_schema_director']);
|
@@ -1305,28 +1249,18 @@ function saswp_schema_output() {
|
|
1305 |
'@type' => 'VideoObject',
|
1306 |
'@id' => get_permalink().'/#videoobject',
|
1307 |
'url' => get_permalink(),
|
1308 |
-
'headline' =>
|
1309 |
'datePublished' => esc_html($date),
|
1310 |
'dateModified' => esc_html($modified_date),
|
1311 |
'description' => $description,
|
1312 |
-
'name' =>
|
1313 |
'uploadDate' => esc_html($date),
|
1314 |
'thumbnailUrl' => isset($image_details[0]) ? esc_url($image_details[0]):'',
|
1315 |
'mainEntity' => array(
|
1316 |
'@type' => 'WebPage',
|
1317 |
'@id' => get_permalink(),
|
1318 |
),
|
1319 |
-
'author' =>
|
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'),
|
1326 |
-
'height' => saswp_remove_warnings($author_details, 'height', 'saswp_string'),
|
1327 |
-
'width' => saswp_remove_warnings($author_details, 'width', 'saswp_string')
|
1328 |
-
),
|
1329 |
-
)
|
1330 |
);
|
1331 |
if(!empty($publisher)){
|
1332 |
|
@@ -1551,10 +1485,9 @@ function saswp_schema_output() {
|
|
1551 |
*/
|
1552 |
function saswp_post_specific_schema_output() {
|
1553 |
|
1554 |
-
global $post;
|
1555 |
global $sd_data;
|
1556 |
-
|
1557 |
-
|
1558 |
$logo = '';
|
1559 |
$height = '';
|
1560 |
$width = '';
|
@@ -1816,7 +1749,7 @@ function saswp_post_specific_schema_output() {
|
|
1816 |
|
1817 |
}
|
1818 |
|
1819 |
-
$input1['isAccessibleForFree']
|
1820 |
$input1['maximumAttendeeCapacity'] = saswp_remove_warnings($all_post_meta, 'saswp_church_schema_maximum_a_capacity_'.$schema_id, 'saswp_array');
|
1821 |
$input1['hasMap'] = saswp_remove_warnings($all_post_meta, 'saswp_church_schema_hasmap_'.$schema_id, 'saswp_array');
|
1822 |
|
@@ -2561,6 +2494,14 @@ function saswp_post_specific_schema_output() {
|
|
2561 |
);
|
2562 |
|
2563 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2564 |
|
2565 |
if(!empty($aggregateRating)){
|
2566 |
$input1['aggregateRating'] = $aggregateRating;
|
@@ -2738,6 +2679,15 @@ function saswp_post_specific_schema_output() {
|
|
2738 |
);
|
2739 |
|
2740 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2741 |
|
2742 |
if(!empty($extra_theme_review)){
|
2743 |
|
@@ -2787,6 +2737,17 @@ function saswp_post_specific_schema_output() {
|
|
2787 |
);
|
2788 |
|
2789 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2790 |
if(!empty($extra_theme_review)){
|
2791 |
|
2792 |
$input1 = array_merge($input1, $extra_theme_review);
|
@@ -2796,8 +2757,9 @@ function saswp_post_specific_schema_output() {
|
|
2796 |
|
2797 |
if( 'Recipe' === $schema_type){
|
2798 |
|
2799 |
-
|
2800 |
-
$recipe_image = get_post_meta( get_the_ID(), '
|
|
|
2801 |
|
2802 |
$ingredient = array();
|
2803 |
$instruction = array();
|
@@ -2844,7 +2806,13 @@ function saswp_post_specific_schema_output() {
|
|
2844 |
'@type' => $schema_type ,
|
2845 |
'@id' => get_permalink().'/#recipe',
|
2846 |
'url' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_url_'.$schema_id, 'saswp_array'),
|
2847 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
2848 |
'author' => array(
|
2849 |
'@type' => 'Person',
|
2850 |
'name' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_author_name_'.$schema_id, 'saswp_array'),
|
@@ -2852,8 +2820,8 @@ function saswp_post_specific_schema_output() {
|
|
2852 |
'Image' => array(
|
2853 |
'@type' => 'ImageObject',
|
2854 |
'url' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_author_image_'.$schema_id, 'saswp_array'),
|
2855 |
-
'height' => saswp_remove_warnings($
|
2856 |
-
'width' => saswp_remove_warnings($
|
2857 |
),
|
2858 |
),
|
2859 |
|
@@ -2901,7 +2869,16 @@ function saswp_post_specific_schema_output() {
|
|
2901 |
),
|
2902 |
|
2903 |
|
2904 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2905 |
if(!empty($aggregateRating)){
|
2906 |
$input1['aggregateRating'] = $aggregateRating;
|
2907 |
}
|
@@ -3063,6 +3040,15 @@ function saswp_post_specific_schema_output() {
|
|
3063 |
);
|
3064 |
|
3065 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3066 |
if(!empty($aggregateRating)){
|
3067 |
$input1['aggregateRating'] = $aggregateRating;
|
3068 |
}
|
@@ -3506,9 +3492,7 @@ function saswp_post_specific_schema_output() {
|
|
3506 |
|
3507 |
}
|
3508 |
|
3509 |
-
|
3510 |
-
|
3511 |
-
|
3512 |
}
|
3513 |
|
3514 |
|
@@ -3707,7 +3691,7 @@ function saswp_archive_output(){
|
|
3707 |
$category_posts[] = array(
|
3708 |
|
3709 |
'@type' => esc_attr($schema_type),
|
3710 |
-
'headline' =>
|
3711 |
'url' => get_the_permalink(),
|
3712 |
'datePublished' => get_the_date('c'),
|
3713 |
'dateModified' => get_the_modified_date('c'),
|
@@ -3829,7 +3813,7 @@ function saswp_about_page_output(){
|
|
3829 |
"@id" => get_permalink(),
|
3830 |
),
|
3831 |
"url" => get_permalink(),
|
3832 |
-
"headline" =>
|
3833 |
'description' => saswp_get_the_excerpt(),
|
3834 |
);
|
3835 |
|
@@ -3874,7 +3858,7 @@ function saswp_contact_page_output(){
|
|
3874 |
"@id" => get_permalink(),
|
3875 |
),
|
3876 |
"url" => get_permalink(),
|
3877 |
-
"headline" =>
|
3878 |
'description' => saswp_get_the_excerpt(),
|
3879 |
);
|
3880 |
|
235 |
|
236 |
}
|
237 |
|
238 |
+
|
|
|
|
|
239 |
$image_id = get_post_thumbnail_id();
|
240 |
+
$image_details = wp_get_attachment_image_src($image_id, 'full');
|
|
|
241 |
$date = get_the_date("Y-m-d\TH:i:s\Z");
|
242 |
$modified_date = get_the_modified_date("Y-m-d\TH:i:s\Z");
|
243 |
+
$author_name = get_the_author();
|
244 |
+
$author_id = get_the_author_meta('ID');
|
245 |
|
246 |
+
if(!$author_name){
|
247 |
|
248 |
+
$author_id = get_post_field('post_author', $schema_post_id);
|
249 |
+
$author_name = get_the_author_meta( 'display_name' , $author_id );
|
250 |
|
251 |
}
|
252 |
+
|
|
|
253 |
$saswp_review_details = esc_sql ( get_post_meta(get_the_ID(), 'saswp_review_details', true));
|
254 |
|
255 |
$aggregateRating = array();
|
320 |
'@context' => 'http://schema.org',
|
321 |
'@type' => $schema_type ,
|
322 |
'@id' => get_permalink().'/#course',
|
323 |
+
'name' => saswp_get_the_title(),
|
324 |
'description' => $description,
|
325 |
'url' => get_permalink(),
|
326 |
'datePublished' => esc_html($date),
|
363 |
'url' => bbp_get_topic_permalink(),
|
364 |
'datePublished' => esc_html($date),
|
365 |
'dateModified' => esc_html($modified_date),
|
366 |
+
'author' => saswp_get_author_details(),
|
|
|
|
|
|
|
|
|
367 |
'interactionStatistic' => array(
|
368 |
'@type' => 'InteractionCounter',
|
369 |
'interactionType' => 'http://schema.org/CommentAction',
|
377 |
'@context' => 'http://schema.org',
|
378 |
'@type' => 'DiscussionForumPosting' ,
|
379 |
'@id' => get_permalink().'/#blogposting',
|
380 |
+
'headline' => saswp_get_the_title(),
|
381 |
'description' => saswp_get_the_excerpt(),
|
382 |
'url' => get_permalink(),
|
383 |
'datePublished' => esc_html($date),
|
384 |
'dateModified' => esc_html($modified_date),
|
385 |
+
'author' => saswp_get_author_details()
|
386 |
+
);
|
|
|
|
|
|
|
387 |
|
388 |
}
|
389 |
if(!empty($publisher)){
|
416 |
'@type' => 'BlogPosting' ,
|
417 |
'@id' => get_permalink().'/#blogposting',
|
418 |
'mainEntityOfPage' => get_permalink(),
|
419 |
+
'headline' => saswp_get_the_title(),
|
420 |
'description' => saswp_get_the_excerpt(),
|
421 |
+
'name' => saswp_get_the_title(),
|
422 |
'url' => get_permalink(),
|
423 |
'datePublished' => esc_html($date),
|
424 |
'dateModified' => esc_html($modified_date),
|
425 |
+
'author' => saswp_get_author_details()
|
426 |
+
);
|
|
|
|
|
|
|
|
|
427 |
if(!empty($publisher)){
|
428 |
|
429 |
$input1 = array_merge($input1, $publisher);
|
462 |
'encodingFormat' => saswp_remove_warnings($schema_data, 'saswp_audio_schema_encoding_format', 'saswp_string'),
|
463 |
'datePublished' => esc_html($date),
|
464 |
'dateModified' => esc_html($modified_date),
|
465 |
+
'author' => saswp_get_author_details()
|
|
|
|
|
|
|
|
|
466 |
);
|
467 |
if(!empty($publisher)){
|
468 |
|
478 |
$input1['aggregateRating'] = $aggregateRating;
|
479 |
}
|
480 |
if(!empty($extra_theme_review)){
|
481 |
+
$input1 = array_merge($input1, $extra_theme_review);
|
482 |
}
|
483 |
if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
|
484 |
+
$input1['comment'] = saswp_get_comments(get_the_ID());
|
485 |
}
|
486 |
|
487 |
$input1 = apply_filters('saswp_modify_audio_object_schema_output', $input1 );
|
588 |
),
|
589 |
'datePublished' => esc_html($date),
|
590 |
'dateModified' => esc_html($modified_date),
|
591 |
+
'author' => saswp_get_author_details()
|
|
|
|
|
|
|
|
|
592 |
);
|
593 |
|
594 |
if(isset($schema_data['saswp_software_schema_rating']) && $schema_data['saswp_software_schema_rating'] >0 && isset($schema_data['saswp_software_schema_rating_count']) && $schema_data['saswp_software_schema_rating_count'] >0 && $schema_data['saswp_software_schema_enable_rating'] == 1){
|
692 |
'@type' => $schema_type ,
|
693 |
'@id' => get_permalink().'/#recipe',
|
694 |
'url' => get_permalink(),
|
695 |
+
'name' => saswp_get_the_title(),
|
696 |
'datePublished' => esc_html($date),
|
697 |
'dateModified' => esc_html($modified_date),
|
698 |
'description' => saswp_get_the_excerpt(),
|
699 |
'mainEntity' => array(
|
700 |
'@type' => 'WebPage',
|
701 |
'@id' => get_permalink(),
|
702 |
+
'author' => saswp_get_author_details()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
703 |
),
|
704 |
|
705 |
);
|
747 |
if((isset($sd_data['saswp-woocommerce']) && $sd_data['saswp-woocommerce'] == 1) && !empty($product_details)){
|
748 |
|
749 |
$input1 = array(
|
750 |
+
'@context' => 'http://schema.org',
|
751 |
'@type' => 'Product',
|
752 |
'@id' => get_permalink().'/#product',
|
753 |
'url' => get_permalink(),
|
842 |
'@type' => $schema_type ,
|
843 |
'@id' => get_permalink().'/#newsarticle',
|
844 |
'url' => get_permalink(),
|
845 |
+
'headline' => saswp_get_the_title(),
|
846 |
'mainEntityOfPage' => get_the_permalink(),
|
847 |
'datePublished' => esc_html($date),
|
848 |
'dateModified' => esc_html($modified_date),
|
849 |
'description' => saswp_get_the_excerpt(),
|
850 |
'articleSection' => $article_section,
|
851 |
'articleBody' => saswp_get_the_excerpt(),
|
852 |
+
'name' => saswp_get_the_title(),
|
853 |
'thumbnailUrl' => saswp_remove_warnings($image_details, 0, 'saswp_string'),
|
854 |
'wordCount' => saswp_remove_warnings($word_count, 'word_count', 'saswp_string'),
|
855 |
'timeRequired' => saswp_remove_warnings($word_count, 'timerequired', 'saswp_string'),
|
857 |
'@type' => 'WebPage',
|
858 |
'@id' => get_permalink(),
|
859 |
),
|
860 |
+
'author' => saswp_get_author_details()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
861 |
);
|
862 |
if(!empty($publisher)){
|
863 |
|
987 |
'dateCreated' => esc_html($date),
|
988 |
'datePublished' => esc_html($date),
|
989 |
'dateModified' => esc_html($modified_date),
|
990 |
+
'headline' => saswp_get_the_title(),
|
991 |
+
'name' => saswp_get_the_title(),
|
992 |
'keywords' => tie_get_plain_terms( get_the_ID(), 'post_tag' ),
|
993 |
'url' => get_permalink(),
|
994 |
'description' => saswp_get_the_excerpt(),
|
995 |
'copyrightYear' => get_the_time( 'Y' ),
|
996 |
+
'author' => saswp_get_author_details()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
997 |
|
998 |
);
|
999 |
|
1007 |
|
1008 |
$input1['itemReviewed'] = array(
|
1009 |
'@type' => 'Thing',
|
1010 |
+
'name' => saswp_get_the_title(),
|
1011 |
);
|
1012 |
|
1013 |
$input1['reviewRating'] = array(
|
1023 |
$schema_data = saswp_get_schema_data($schema_post_id, 'saswp_review_schema_details');
|
1024 |
|
1025 |
if(isset($schema_data['saswp_review_schema_item_type'])){
|
1026 |
+
|
1027 |
+
$review_author = $author_name;
|
|
|
1028 |
|
1029 |
if(isset($schema_data['saswp_review_schema_author'])){
|
1030 |
|
1090 |
if(isset($schema_data['saswp_review_schema_itemreviewed_sameas'])){
|
1091 |
$input1['itemReviewed']['sameAs'] = esc_url($schema_data['saswp_review_schema_itemreviewed_sameas']);
|
1092 |
}
|
1093 |
+
|
|
|
1094 |
if(isset($schema_data['saswp_review_schema_director'])){
|
1095 |
|
1096 |
$input1['itemReviewed']['director'] = esc_attr($schema_data['saswp_review_schema_director']);
|
1249 |
'@type' => 'VideoObject',
|
1250 |
'@id' => get_permalink().'/#videoobject',
|
1251 |
'url' => get_permalink(),
|
1252 |
+
'headline' => saswp_get_the_title(),
|
1253 |
'datePublished' => esc_html($date),
|
1254 |
'dateModified' => esc_html($modified_date),
|
1255 |
'description' => $description,
|
1256 |
+
'name' => saswp_get_the_title(),
|
1257 |
'uploadDate' => esc_html($date),
|
1258 |
'thumbnailUrl' => isset($image_details[0]) ? esc_url($image_details[0]):'',
|
1259 |
'mainEntity' => array(
|
1260 |
'@type' => 'WebPage',
|
1261 |
'@id' => get_permalink(),
|
1262 |
),
|
1263 |
+
'author' => saswp_get_author_details()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1264 |
);
|
1265 |
if(!empty($publisher)){
|
1266 |
|
1485 |
*/
|
1486 |
function saswp_post_specific_schema_output() {
|
1487 |
|
1488 |
+
global $post;
|
1489 |
global $sd_data;
|
1490 |
+
|
|
|
1491 |
$logo = '';
|
1492 |
$height = '';
|
1493 |
$width = '';
|
1749 |
|
1750 |
}
|
1751 |
|
1752 |
+
$input1['isAccessibleForFree'] = saswp_remove_warnings($all_post_meta, 'saswp_church_schema_is_acceesible_free_'.$schema_id, 'saswp_array');
|
1753 |
$input1['maximumAttendeeCapacity'] = saswp_remove_warnings($all_post_meta, 'saswp_church_schema_maximum_a_capacity_'.$schema_id, 'saswp_array');
|
1754 |
$input1['hasMap'] = saswp_remove_warnings($all_post_meta, 'saswp_church_schema_hasmap_'.$schema_id, 'saswp_array');
|
1755 |
|
2494 |
);
|
2495 |
|
2496 |
}
|
2497 |
+
if(saswp_remove_warnings($all_post_meta, 'saswp_blogposting_enable_rating_'.$schema_id, 'saswp_array') == 1 && saswp_remove_warnings($all_post_meta, 'saswp_blogposting_rating_'.$schema_id, 'saswp_array') && saswp_remove_warnings($all_post_meta, 'saswp_blogposting_review_count_'.$schema_id, 'saswp_array')){
|
2498 |
+
|
2499 |
+
$input1['aggregateRating'] = array(
|
2500 |
+
"@type" => "AggregateRating",
|
2501 |
+
"ratingValue" => saswp_remove_warnings($all_post_meta, 'saswp_blogposting_rating_'.$schema_id, 'saswp_array'),
|
2502 |
+
"reviewCount" => saswp_remove_warnings($all_post_meta, 'saswp_blogposting_review_count_'.$schema_id, 'saswp_array')
|
2503 |
+
);
|
2504 |
+
}
|
2505 |
|
2506 |
if(!empty($aggregateRating)){
|
2507 |
$input1['aggregateRating'] = $aggregateRating;
|
2679 |
);
|
2680 |
|
2681 |
}
|
2682 |
+
|
2683 |
+
if(saswp_remove_warnings($all_post_meta, 'saswp_article_enable_rating_'.$schema_id, 'saswp_array') == 1 && saswp_remove_warnings($all_post_meta, 'saswp_article_rating_'.$schema_id, 'saswp_array') && saswp_remove_warnings($all_post_meta, 'saswp_article_review_count_'.$schema_id, 'saswp_array')){
|
2684 |
+
|
2685 |
+
$input1['aggregateRating'] = array(
|
2686 |
+
"@type" => "AggregateRating",
|
2687 |
+
"ratingValue" => saswp_remove_warnings($all_post_meta, 'saswp_article_rating_'.$schema_id, 'saswp_array'),
|
2688 |
+
"reviewCount" => saswp_remove_warnings($all_post_meta, 'saswp_article_review_count_'.$schema_id, 'saswp_array')
|
2689 |
+
);
|
2690 |
+
}
|
2691 |
|
2692 |
if(!empty($extra_theme_review)){
|
2693 |
|
2737 |
);
|
2738 |
|
2739 |
}
|
2740 |
+
|
2741 |
+
if(saswp_remove_warnings($all_post_meta, 'saswp_tech_article_enable_rating_'.$schema_id, 'saswp_array') == 1 && saswp_remove_warnings($all_post_meta, 'saswp_tech_article_rating_'.$schema_id, 'saswp_array') && saswp_remove_warnings($all_post_meta, 'saswp_tech_article_review_count_'.$schema_id, 'saswp_array')){
|
2742 |
+
|
2743 |
+
$input1['aggregateRating'] = array(
|
2744 |
+
"@type" => "AggregateRating",
|
2745 |
+
"ratingValue" => saswp_remove_warnings($all_post_meta, 'saswp_tech_article_rating_'.$schema_id, 'saswp_array'),
|
2746 |
+
"reviewCount" => saswp_remove_warnings($all_post_meta, 'saswp_tech_article_review_count_'.$schema_id, 'saswp_array')
|
2747 |
+
);
|
2748 |
+
}
|
2749 |
+
|
2750 |
+
|
2751 |
if(!empty($extra_theme_review)){
|
2752 |
|
2753 |
$input1 = array_merge($input1, $extra_theme_review);
|
2757 |
|
2758 |
if( 'Recipe' === $schema_type){
|
2759 |
|
2760 |
+
$recipe_logo = get_post_meta( get_the_ID(), 'saswp_recipe_organization_logo_'.$schema_id.'_detail',true);
|
2761 |
+
$recipe_image = get_post_meta( get_the_ID(), 'saswp_recipe_image_'.$schema_id.'_detail',true);
|
2762 |
+
$recipe_author_image = get_post_meta( get_the_ID(), 'saswp_recipe_author_image_'.$schema_id.'_detail',true);
|
2763 |
|
2764 |
$ingredient = array();
|
2765 |
$instruction = array();
|
2806 |
'@type' => $schema_type ,
|
2807 |
'@id' => get_permalink().'/#recipe',
|
2808 |
'url' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_url_'.$schema_id, 'saswp_array'),
|
2809 |
+
'name' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_name_'.$schema_id, 'saswp_array'),
|
2810 |
+
'image' =>array(
|
2811 |
+
'@type' => 'ImageObject',
|
2812 |
+
'url' => saswp_remove_warnings( $recipe_image, 'thumbnail', 'saswp_string'),
|
2813 |
+
'width' => saswp_remove_warnings( $recipe_image, 'width', 'saswp_string'),
|
2814 |
+
'height' => saswp_remove_warnings( $recipe_image , 'height', 'saswp_string'),
|
2815 |
+
),
|
2816 |
'author' => array(
|
2817 |
'@type' => 'Person',
|
2818 |
'name' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_author_name_'.$schema_id, 'saswp_array'),
|
2820 |
'Image' => array(
|
2821 |
'@type' => 'ImageObject',
|
2822 |
'url' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_author_image_'.$schema_id, 'saswp_array'),
|
2823 |
+
'height' => saswp_remove_warnings($recipe_author_image, 'height', 'saswp_string'),
|
2824 |
+
'width' => saswp_remove_warnings($recipe_author_image, 'width', 'saswp_string')
|
2825 |
),
|
2826 |
),
|
2827 |
|
2869 |
),
|
2870 |
|
2871 |
|
2872 |
+
);
|
2873 |
+
if(saswp_remove_warnings($all_post_meta, 'saswp_recipe_schema_enable_rating_'.$schema_id, 'saswp_array') == 1 && saswp_remove_warnings($all_post_meta, 'saswp_recipe_schema_rating_'.$schema_id, 'saswp_array') && saswp_remove_warnings($all_post_meta, 'saswp_recipe_schema_review_count_'.$schema_id, 'saswp_array')){
|
2874 |
+
|
2875 |
+
$input1['aggregateRating'] = array(
|
2876 |
+
"@type" => "AggregateRating",
|
2877 |
+
"ratingValue" => saswp_remove_warnings($all_post_meta, 'saswp_recipe_schema_rating_'.$schema_id, 'saswp_array'),
|
2878 |
+
"reviewCount" => saswp_remove_warnings($all_post_meta, 'saswp_recipe_schema_review_count_'.$schema_id, 'saswp_array')
|
2879 |
+
);
|
2880 |
+
}
|
2881 |
+
|
2882 |
if(!empty($aggregateRating)){
|
2883 |
$input1['aggregateRating'] = $aggregateRating;
|
2884 |
}
|
3040 |
);
|
3041 |
|
3042 |
}
|
3043 |
+
if(saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_enable_rating_'.$schema_id, 'saswp_array') == 1 && saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_rating_'.$schema_id, 'saswp_array') && saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_review_count_'.$schema_id, 'saswp_array')){
|
3044 |
+
|
3045 |
+
$input1['aggregateRating'] = array(
|
3046 |
+
"@type" => "AggregateRating",
|
3047 |
+
"ratingValue" => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_rating_'.$schema_id, 'saswp_array'),
|
3048 |
+
"reviewCount" => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_review_count_'.$schema_id, 'saswp_array')
|
3049 |
+
);
|
3050 |
+
}
|
3051 |
+
|
3052 |
if(!empty($aggregateRating)){
|
3053 |
$input1['aggregateRating'] = $aggregateRating;
|
3054 |
}
|
3492 |
|
3493 |
}
|
3494 |
|
3495 |
+
|
|
|
|
|
3496 |
}
|
3497 |
|
3498 |
|
3691 |
$category_posts[] = array(
|
3692 |
|
3693 |
'@type' => esc_attr($schema_type),
|
3694 |
+
'headline' => saswp_get_the_title(),
|
3695 |
'url' => get_the_permalink(),
|
3696 |
'datePublished' => get_the_date('c'),
|
3697 |
'dateModified' => get_the_modified_date('c'),
|
3813 |
"@id" => get_permalink(),
|
3814 |
),
|
3815 |
"url" => get_permalink(),
|
3816 |
+
"headline" => saswp_get_the_title(),
|
3817 |
'description' => saswp_get_the_excerpt(),
|
3818 |
);
|
3819 |
|
3858 |
"@id" => get_permalink(),
|
3859 |
),
|
3860 |
"url" => get_permalink(),
|
3861 |
+
"headline" => saswp_get_the_title(),
|
3862 |
'description' => saswp_get_the_excerpt(),
|
3863 |
);
|
3864 |
|
output/review-output.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
Class saswp_review_output{
|
3 |
|
4 |
public function saswp_review_hooks(){
|
@@ -61,8 +63,8 @@ Class saswp_review_output{
|
|
61 |
'dateCreated' => esc_html($date),
|
62 |
'datePublished' => esc_html($date),
|
63 |
'dateModified' => esc_html($modified_date),
|
64 |
-
'headline' =>
|
65 |
-
'name' =>
|
66 |
'url' => get_permalink(),
|
67 |
'description' => saswp_get_the_excerpt(),
|
68 |
'copyrightYear' => get_the_time( 'Y' ),
|
@@ -81,7 +83,7 @@ Class saswp_review_output{
|
|
81 |
|
82 |
$input1['itemReviewed'] = array(
|
83 |
'@type' => 'Thing',
|
84 |
-
'name' =>
|
85 |
);
|
86 |
|
87 |
$input1['reviewRating'] = array(
|
1 |
<?php
|
2 |
+
// Exit if accessed directly.
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
4 |
Class saswp_review_output{
|
5 |
|
6 |
public function saswp_review_hooks(){
|
63 |
'dateCreated' => esc_html($date),
|
64 |
'datePublished' => esc_html($date),
|
65 |
'dateModified' => esc_html($modified_date),
|
66 |
+
'headline' => saswp_get_the_title(),
|
67 |
+
'name' => saswp_get_the_title(),
|
68 |
'url' => get_permalink(),
|
69 |
'description' => saswp_get_the_excerpt(),
|
70 |
'copyrightYear' => get_the_time( 'Y' ),
|
83 |
|
84 |
$input1['itemReviewed'] = array(
|
85 |
'@type' => 'Thing',
|
86 |
+
'name' => saswp_get_the_title(),
|
87 |
);
|
88 |
|
89 |
$input1['reviewRating'] = array(
|
output/service.php
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
|
|
|
|
4 |
/**
|
5 |
* List of hooks used in current class
|
6 |
*/
|
@@ -1111,7 +1113,7 @@ Class saswp_output_service{
|
|
1111 |
}
|
1112 |
|
1113 |
$dw_qa['@type'] = 'Question';
|
1114 |
-
$dw_qa['name'] =
|
1115 |
$dw_qa['upvoteCount'] = get_post_meta( $post_id, '_dwqa_votes', true );
|
1116 |
|
1117 |
$args = array(
|
@@ -1559,8 +1561,7 @@ Class saswp_output_service{
|
|
1559 |
*/
|
1560 |
public function saswp_schema_markup_generator($schema_type){
|
1561 |
|
1562 |
-
global $post;
|
1563 |
-
|
1564 |
global $sd_data;
|
1565 |
|
1566 |
$logo = '';
|
@@ -1589,22 +1590,13 @@ Class saswp_output_service{
|
|
1589 |
}
|
1590 |
|
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");
|
1598 |
$modified_date = get_the_modified_date("Y-m-d\TH:i:s\Z");
|
1599 |
-
$aurthor_name = '';
|
1600 |
-
|
1601 |
-
if(!$aurthor_name && is_object($post)){
|
1602 |
|
1603 |
-
|
1604 |
-
$aurthor_name = get_the_author_meta( 'display_name' , $author_id );
|
1605 |
-
}
|
1606 |
-
|
1607 |
-
|
1608 |
switch ($schema_type) {
|
1609 |
|
1610 |
case 'TechArticle':
|
@@ -1615,15 +1607,11 @@ Class saswp_output_service{
|
|
1615 |
'@id' => get_permalink().'/#techarticle',
|
1616 |
'url' => get_permalink(),
|
1617 |
'mainEntityOfPage' => get_permalink(),
|
1618 |
-
'headline' =>
|
1619 |
'description' => saswp_get_the_excerpt(),
|
1620 |
'datePublished' => esc_html($date),
|
1621 |
'dateModified' => esc_html($modified_date),
|
1622 |
-
'author' =>
|
1623 |
-
'@type' => 'Person',
|
1624 |
-
'name' => esc_attr($aurthor_name),
|
1625 |
-
'description' => esc_attr($author_desc),
|
1626 |
-
),
|
1627 |
'publisher' => array(
|
1628 |
'@type' => 'Organization',
|
1629 |
'logo' => array(
|
@@ -1646,15 +1634,11 @@ Class saswp_output_service{
|
|
1646 |
'@id' => get_permalink().'/#article',
|
1647 |
'url' => get_permalink(),
|
1648 |
'mainEntityOfPage' => get_permalink(),
|
1649 |
-
'headline' =>
|
1650 |
'description' => saswp_get_the_excerpt(),
|
1651 |
'datePublished' => esc_html($date),
|
1652 |
'dateModified' => esc_html($modified_date),
|
1653 |
-
'author' =>
|
1654 |
-
'@type' => 'Person',
|
1655 |
-
'name' => esc_attr($aurthor_name),
|
1656 |
-
'description' => esc_attr($author_desc),
|
1657 |
-
),
|
1658 |
'publisher' => array(
|
1659 |
'@type' => 'Organization',
|
1660 |
'logo' => array(
|
@@ -1680,22 +1664,18 @@ Class saswp_output_service{
|
|
1680 |
'@context' => 'http://schema.org',
|
1681 |
'@type' => 'WebPage' ,
|
1682 |
'@id' => get_permalink().'/#webpage',
|
1683 |
-
'name' =>
|
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' =>
|
1691 |
'description' => saswp_get_the_excerpt(),
|
1692 |
'datePublished' => esc_html($date),
|
1693 |
'dateModified' => esc_html($modified_date),
|
1694 |
-
'author' =>
|
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(
|
@@ -1924,7 +1904,7 @@ Class saswp_output_service{
|
|
1924 |
|
1925 |
}
|
1926 |
|
1927 |
-
if(isset($custom_logo)){
|
1928 |
|
1929 |
$logo = array_key_exists(0, $custom_logo)? $custom_logo[0]:'';
|
1930 |
$height = array_key_exists(1, $custom_logo)? $custom_logo[1]:'';
|
1 |
<?php
|
2 |
+
// Exit if accessed directly.
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
4 |
+
|
5 |
+
Class saswp_output_service{
|
6 |
/**
|
7 |
* List of hooks used in current class
|
8 |
*/
|
1113 |
}
|
1114 |
|
1115 |
$dw_qa['@type'] = 'Question';
|
1116 |
+
$dw_qa['name'] = saswp_get_the_title();
|
1117 |
$dw_qa['upvoteCount'] = get_post_meta( $post_id, '_dwqa_votes', true );
|
1118 |
|
1119 |
$args = array(
|
1561 |
*/
|
1562 |
public function saswp_schema_markup_generator($schema_type){
|
1563 |
|
1564 |
+
global $post;
|
|
|
1565 |
global $sd_data;
|
1566 |
|
1567 |
$logo = '';
|
1590 |
}
|
1591 |
|
1592 |
$input1 = array();
|
1593 |
+
|
|
|
|
|
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");
|
1597 |
$modified_date = get_the_modified_date("Y-m-d\TH:i:s\Z");
|
|
|
|
|
|
|
1598 |
|
1599 |
+
|
|
|
|
|
|
|
|
|
1600 |
switch ($schema_type) {
|
1601 |
|
1602 |
case 'TechArticle':
|
1607 |
'@id' => get_permalink().'/#techarticle',
|
1608 |
'url' => get_permalink(),
|
1609 |
'mainEntityOfPage' => get_permalink(),
|
1610 |
+
'headline' => saswp_get_the_title(),
|
1611 |
'description' => saswp_get_the_excerpt(),
|
1612 |
'datePublished' => esc_html($date),
|
1613 |
'dateModified' => esc_html($modified_date),
|
1614 |
+
'author' => saswp_get_author_details(),
|
|
|
|
|
|
|
|
|
1615 |
'publisher' => array(
|
1616 |
'@type' => 'Organization',
|
1617 |
'logo' => array(
|
1634 |
'@id' => get_permalink().'/#article',
|
1635 |
'url' => get_permalink(),
|
1636 |
'mainEntityOfPage' => get_permalink(),
|
1637 |
+
'headline' => saswp_get_the_title(),
|
1638 |
'description' => saswp_get_the_excerpt(),
|
1639 |
'datePublished' => esc_html($date),
|
1640 |
'dateModified' => esc_html($modified_date),
|
1641 |
+
'author' => saswp_get_author_details(),
|
|
|
|
|
|
|
|
|
1642 |
'publisher' => array(
|
1643 |
'@type' => 'Organization',
|
1644 |
'logo' => array(
|
1664 |
'@context' => 'http://schema.org',
|
1665 |
'@type' => 'WebPage' ,
|
1666 |
'@id' => get_permalink().'/#webpage',
|
1667 |
+
'name' => saswp_get_the_title(),
|
1668 |
'url' => get_permalink(),
|
1669 |
'description' => saswp_get_the_excerpt(),
|
1670 |
'mainEntity' => array(
|
1671 |
'@type' => 'Article',
|
1672 |
'mainEntityOfPage' => get_permalink(),
|
1673 |
'image' => esc_url($image_details[0]),
|
1674 |
+
'headline' => saswp_get_the_title(),
|
1675 |
'description' => saswp_get_the_excerpt(),
|
1676 |
'datePublished' => esc_html($date),
|
1677 |
'dateModified' => esc_html($modified_date),
|
1678 |
+
'author' => saswp_get_author_details(),
|
|
|
|
|
|
|
|
|
1679 |
'publisher' => array(
|
1680 |
'@type' => 'Organization',
|
1681 |
'logo' => array(
|
1904 |
|
1905 |
}
|
1906 |
|
1907 |
+
if(isset($custom_logo) && is_array($custom_logo)){
|
1908 |
|
1909 |
$logo = array_key_exists(0, $custom_logo)? $custom_logo[0]:'';
|
1910 |
$height = array_key_exists(1, $custom_logo)? $custom_logo[1]:'';
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
|
2 |
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.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -74,6 +74,10 @@ Schema & Structured Data for WP & AMP adds Google Rich Snippets markup according
|
|
74 |
|
75 |
Some useful extensions to extend Schema & Structured Data for WP & AMP features, check [Woocommerce Compatibility For Schema](https://structured-data-for-wp.com/extensions/woocommerce-compatibility-for-schema/), [Cooked Compatibility For Schema](https://structured-data-for-wp.com/extensions/cooked-compatibility-for-schema/) and We are going to add more.
|
76 |
|
|
|
|
|
|
|
|
|
77 |
### Bug Reports
|
78 |
|
79 |
Bug reports for Schema & Structured Data for WP & AMP are [welcomed on GitHub](https://github.com/ahmedkaludi/schema-and-structured-data-for-wp/issues). Please note GitHub is not a support forum, and issues that aren't properly qualified as bugs will be closed.
|
@@ -99,6 +103,18 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
|
|
99 |
|
100 |
== Changelog ==
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
= 1.8.6 (07 June 2019) =
|
103 |
|
104 |
* Bug Fixed: Notice: Undefined variable: custom_markup #308
|
1 |
+
=== Schema & Structured Data for WP & AMP ===
|
2 |
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.7
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
74 |
|
75 |
Some useful extensions to extend Schema & Structured Data for WP & AMP features, check [Woocommerce Compatibility For Schema](https://structured-data-for-wp.com/extensions/woocommerce-compatibility-for-schema/), [Cooked Compatibility For Schema](https://structured-data-for-wp.com/extensions/cooked-compatibility-for-schema/) and We are going to add more.
|
76 |
|
77 |
+
### Support
|
78 |
+
|
79 |
+
We try our best to provide support on WordPress.org forums. However, We have a special [team support](https://structured-data-for-wp.com/contact-us/) where you can ask us questions and get help. Delivering a good user experience means a lot to us and so we try our best to reply each and every question that gets asked.
|
80 |
+
|
81 |
### Bug Reports
|
82 |
|
83 |
Bug reports for Schema & Structured Data for WP & AMP are [welcomed on GitHub](https://github.com/ahmedkaludi/schema-and-structured-data-for-wp/issues). Please note GitHub is not a support forum, and issues that aren't properly qualified as bugs will be closed.
|
103 |
|
104 |
== Changelog ==
|
105 |
|
106 |
+
= 1.8.7 (21 June 2019) =
|
107 |
+
|
108 |
+
* Bug Fixed: Fatal error ( Uncaught Error: Cannot use object of type Closure as array ) #317
|
109 |
+
* Bug Fixed: Call to undefined function ampforwp_is_home() #330
|
110 |
+
* Bug Fixed: Micro Data cleanup properly does not work #337
|
111 |
+
* Bug Fixed: View Post option should not be there in schema post type admin menu bar #327
|
112 |
+
* Bug Fixed: count(): Parameter must be an array or an object that implements Countable in #309
|
113 |
+
* Improvement: If Yoast plugin is active then the checkbox should be on by default in the compatibility section #338
|
114 |
+
* Improvement: Change message "AMP Requires Selected Plugin" in AMP tab #328
|
115 |
+
* Added: Aggregate rating fields in Recipe Schema type #331
|
116 |
+
|
117 |
+
|
118 |
= 1.8.6 (07 June 2019) =
|
119 |
|
120 |
* Bug Fixed: Notice: Undefined variable: custom_markup #308
|
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.
|
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.
|
17 |
define('SASWP_DIR_NAME_FILE', __FILE__ );
|
18 |
define('SASWP_DIR_NAME', dirname( __FILE__ ));
|
19 |
define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
|
@@ -69,10 +69,9 @@ require_once SASWP_DIR_NAME.'/view/post_specific.php';
|
|
69 |
require_once SASWP_DIR_NAME.'/view/review.php';
|
70 |
require_once SASWP_DIR_NAME.'/output/review-output.php';
|
71 |
require_once SASWP_DIR_NAME.'/output/service.php';
|
|
|
72 |
//Google Review Files
|
73 |
|
74 |
-
|
75 |
-
|
76 |
function saswp_include_require_files(){
|
77 |
|
78 |
global $sd_data;
|
@@ -82,8 +81,7 @@ if(isset($sd_data['saswp-google-review']) && $sd_data['saswp-google-review'] ==
|
|
82 |
require_once SASWP_DIR_NAME.'/google_review/google_review.php';
|
83 |
require_once SASWP_DIR_NAME.'/google_review/google_review_page.php';
|
84 |
require_once SASWP_DIR_NAME.'/google_review/google_review_setup.php';
|
85 |
-
|
86 |
-
|
87 |
}
|
88 |
|
89 |
}
|
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.7
|
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.7');
|
17 |
define('SASWP_DIR_NAME_FILE', __FILE__ );
|
18 |
define('SASWP_DIR_NAME', dirname( __FILE__ ));
|
19 |
define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
|
69 |
require_once SASWP_DIR_NAME.'/view/review.php';
|
70 |
require_once SASWP_DIR_NAME.'/output/review-output.php';
|
71 |
require_once SASWP_DIR_NAME.'/output/service.php';
|
72 |
+
require_once SASWP_DIR_NAME.'/google_review/google_review_widget.php';
|
73 |
//Google Review Files
|
74 |
|
|
|
|
|
75 |
function saswp_include_require_files(){
|
76 |
|
77 |
global $sd_data;
|
81 |
require_once SASWP_DIR_NAME.'/google_review/google_review.php';
|
82 |
require_once SASWP_DIR_NAME.'/google_review/google_review_page.php';
|
83 |
require_once SASWP_DIR_NAME.'/google_review/google_review_setup.php';
|
84 |
+
|
|
|
85 |
}
|
86 |
|
87 |
}
|
view/post_specific.php
CHANGED
@@ -1975,10 +1975,12 @@ class saswp_post_specific {
|
|
1975 |
|
1976 |
case 'checkbox':
|
1977 |
|
1978 |
-
$rating_class = '
|
1979 |
-
|
1980 |
-
|
1981 |
-
|
|
|
|
|
1982 |
$input = sprintf(
|
1983 |
'<input %s %s id="%s" name="%s" type="checkbox" value="1">',
|
1984 |
$rating_class,
|
@@ -2080,12 +2082,26 @@ class saswp_post_specific {
|
|
2080 |
$meta_field['id'] == 'saswp_product_schema_rating_'.$schema_id ||
|
2081 |
$meta_field['id'] == 'saswp_review_schema_rating_'.$schema_id ||
|
2082 |
$meta_field['id'] == 'local_rating_'.$schema_id ||
|
2083 |
-
$meta_field['id'] == 'saswp_software_schema_rating_'.$schema_id ||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2084 |
|
2085 |
$meta_field['id'] == 'saswp_service_schema_review_count_'.$schema_id ||
|
2086 |
$meta_field['id'] == 'saswp_product_schema_review_count_'.$schema_id ||
|
2087 |
$meta_field['id'] == 'saswp_review_schema_review_count_'.$schema_id ||
|
2088 |
$meta_field['id'] == 'local_review_count_'.$schema_id ||
|
|
|
|
|
2089 |
$meta_field['id'] == 'saswp_software_schema_rating_count_'.$schema_id
|
2090 |
|
2091 |
)
|
@@ -2509,7 +2525,7 @@ class saswp_post_specific {
|
|
2509 |
|
2510 |
}
|
2511 |
$current_user = wp_get_current_user();
|
2512 |
-
$author_desc
|
2513 |
$author_details = get_avatar_data($current_user->ID);
|
2514 |
$schema_type = esc_sql ( get_post_meta($schema_id, 'schema_type', true) );
|
2515 |
|
@@ -2760,7 +2776,7 @@ class saswp_post_specific {
|
|
2760 |
'label' => 'Headline',
|
2761 |
'id' => 'saswp_blogposting_headline_'.$schema_id,
|
2762 |
'type' => 'text',
|
2763 |
-
'default'=>
|
2764 |
),
|
2765 |
array(
|
2766 |
'label' => 'Description',
|
@@ -2772,7 +2788,7 @@ class saswp_post_specific {
|
|
2772 |
'label' => 'Name',
|
2773 |
'id' => 'saswp_blogposting_name_'.$schema_id,
|
2774 |
'type' => 'text',
|
2775 |
-
'default' =>
|
2776 |
),
|
2777 |
array(
|
2778 |
'label' => 'URL',
|
@@ -2821,7 +2837,22 @@ class saswp_post_specific {
|
|
2821 |
'id' => 'saswp_blogposting_speakable_'.$schema_id,
|
2822 |
'type' => 'checkbox',
|
2823 |
|
2824 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2825 |
);
|
2826 |
break;
|
2827 |
|
@@ -2859,7 +2890,7 @@ class saswp_post_specific {
|
|
2859 |
'label' => 'Headline',
|
2860 |
'id' => 'saswp_newsarticle_headline_'.$schema_id,
|
2861 |
'type' => 'text',
|
2862 |
-
'default' =>
|
2863 |
),
|
2864 |
array(
|
2865 |
'label' => 'Date Published',
|
@@ -2889,19 +2920,18 @@ class saswp_post_specific {
|
|
2889 |
'label' => 'Article Body',
|
2890 |
'id' => 'saswp_newsarticle_body_'.$schema_id,
|
2891 |
'type' => 'textarea',
|
2892 |
-
'default' =>
|
2893 |
),
|
2894 |
array(
|
2895 |
'label' => 'Name',
|
2896 |
'id' => 'saswp_newsarticle_name_'.$schema_id,
|
2897 |
'type' => 'text',
|
2898 |
-
'default' =>
|
2899 |
),
|
2900 |
array(
|
2901 |
'label' => 'Thumbnail URL',
|
2902 |
'id' => 'saswp_newsarticle_thumbnailurl_'.$schema_id,
|
2903 |
-
'type' => 'text'
|
2904 |
-
'default' => $image_details[0]
|
2905 |
),
|
2906 |
array(
|
2907 |
'label' => 'Word Count',
|
@@ -2950,12 +2980,27 @@ class saswp_post_specific {
|
|
2950 |
'id' => 'saswp_newsarticle_organization_logo_'.$schema_id,
|
2951 |
'type' => 'media',
|
2952 |
'default' => isset($sd_data['sd_logo'])? $sd_data['sd_logo']['url']:''
|
2953 |
-
),
|
2954 |
array(
|
2955 |
'label' => 'Speakable',
|
2956 |
'id' => 'saswp_newsarticle_speakable_'.$schema_id,
|
2957 |
'type' => 'checkbox',
|
2958 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2959 |
)
|
2960 |
);
|
2961 |
break;
|
@@ -2966,7 +3011,7 @@ class saswp_post_specific {
|
|
2966 |
'label' => 'Name',
|
2967 |
'id' => 'saswp_webpage_name_'.$schema_id,
|
2968 |
'type' => 'text',
|
2969 |
-
'default' =>
|
2970 |
),
|
2971 |
array(
|
2972 |
'label' => 'URL',
|
@@ -2989,14 +3034,13 @@ class saswp_post_specific {
|
|
2989 |
array(
|
2990 |
'label' => 'Image',
|
2991 |
'id' => 'saswp_webpage_image_'.$schema_id,
|
2992 |
-
'type' => 'media',
|
2993 |
-
'default' => $image_details[0]
|
2994 |
),
|
2995 |
array(
|
2996 |
'label' => 'Headline',
|
2997 |
'id' => 'saswp_webpage_headline_'.$schema_id,
|
2998 |
'type' => 'text',
|
2999 |
-
'default' =>
|
3000 |
),
|
3001 |
|
3002 |
array(
|
@@ -3052,17 +3096,22 @@ class saswp_post_specific {
|
|
3052 |
'type' => 'text',
|
3053 |
'default' => get_permalink()
|
3054 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
3055 |
array(
|
3056 |
'label' => 'Image',
|
3057 |
'id' => 'saswp_article_image_'.$schema_id,
|
3058 |
-
'type' => 'media'
|
3059 |
-
'default' => $image_details[0]
|
3060 |
),
|
3061 |
array(
|
3062 |
'label' => 'Headline',
|
3063 |
'id' => 'saswp_article_headline_'.$schema_id,
|
3064 |
'type' => 'text',
|
3065 |
-
'default' =>
|
3066 |
),
|
3067 |
array(
|
3068 |
'label' => 'Description',
|
@@ -3111,6 +3160,21 @@ class saswp_post_specific {
|
|
3111 |
'id' => 'saswp_article_speakable_'.$schema_id,
|
3112 |
'type' => 'checkbox',
|
3113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3114 |
)
|
3115 |
);
|
3116 |
break;
|
@@ -3242,7 +3306,7 @@ class saswp_post_specific {
|
|
3242 |
'label' => 'Headline',
|
3243 |
'id' => 'saswp_tech_article_headline_'.$schema_id,
|
3244 |
'type' => 'text',
|
3245 |
-
'default' =>
|
3246 |
),
|
3247 |
array(
|
3248 |
'label' => 'Description',
|
@@ -3291,6 +3355,21 @@ class saswp_post_specific {
|
|
3291 |
'id' => 'saswp_tech_article_speakable_'.$schema_id,
|
3292 |
'type' => 'checkbox',
|
3293 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3294 |
)
|
3295 |
);
|
3296 |
break;
|
@@ -3301,7 +3380,7 @@ class saswp_post_specific {
|
|
3301 |
'label' => 'Name',
|
3302 |
'id' => 'saswp_course_name_'.$schema_id,
|
3303 |
'type' => 'text',
|
3304 |
-
'default' =>
|
3305 |
),
|
3306 |
array(
|
3307 |
'label' => 'Description',
|
@@ -3348,7 +3427,7 @@ class saswp_post_specific {
|
|
3348 |
'label' => 'Headline',
|
3349 |
'id' => 'saswp_dfp_headline_'.$schema_id,
|
3350 |
'type' => 'text',
|
3351 |
-
'default' =>
|
3352 |
),
|
3353 |
array(
|
3354 |
'label' => 'Description',
|
@@ -3402,8 +3481,13 @@ class saswp_post_specific {
|
|
3402 |
'label' => 'Name',
|
3403 |
'id' => 'saswp_recipe_name_'.$schema_id,
|
3404 |
'type' => 'text',
|
3405 |
-
'default' =>
|
3406 |
),
|
|
|
|
|
|
|
|
|
|
|
3407 |
array(
|
3408 |
'label' => 'Date Published',
|
3409 |
'id' => 'saswp_recipe_date_published_'.$schema_id,
|
@@ -3593,7 +3677,23 @@ class saswp_post_specific {
|
|
3593 |
'attributes' => array(
|
3594 |
'placeholder' => 'PT1M33S'
|
3595 |
),
|
3596 |
-
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3597 |
);
|
3598 |
break;
|
3599 |
|
@@ -4046,7 +4146,7 @@ class saswp_post_specific {
|
|
4046 |
'label' => 'Headline',
|
4047 |
'id' => 'saswp_video_object_headline_'.$schema_id,
|
4048 |
'type' => 'text',
|
4049 |
-
'default' =>
|
4050 |
),
|
4051 |
array(
|
4052 |
'label' => 'Date Published',
|
@@ -4070,7 +4170,7 @@ class saswp_post_specific {
|
|
4070 |
'label' => 'Name',
|
4071 |
'id' => 'saswp_video_object_name_'.$schema_id,
|
4072 |
'type' => 'text',
|
4073 |
-
'default' =>
|
4074 |
),
|
4075 |
array(
|
4076 |
'label' => 'Upload Date',
|
1975 |
|
1976 |
case 'checkbox':
|
1977 |
|
1978 |
+
$rating_class = '';
|
1979 |
+
|
1980 |
+
if (strpos($meta_field['id'], 'speakable') === false){
|
1981 |
+
$rating_class = 'class="saswp-enable-rating-review-'.strtolower($schema_type).'"';
|
1982 |
+
}
|
1983 |
+
|
1984 |
$input = sprintf(
|
1985 |
'<input %s %s id="%s" name="%s" type="checkbox" value="1">',
|
1986 |
$rating_class,
|
2082 |
$meta_field['id'] == 'saswp_product_schema_rating_'.$schema_id ||
|
2083 |
$meta_field['id'] == 'saswp_review_schema_rating_'.$schema_id ||
|
2084 |
$meta_field['id'] == 'local_rating_'.$schema_id ||
|
2085 |
+
$meta_field['id'] == 'saswp_software_schema_rating_'.$schema_id ||
|
2086 |
+
|
2087 |
+
$meta_field['id'] == 'saswp_article_rating_'.$schema_id ||
|
2088 |
+
$meta_field['id'] == 'saswp_article_review_count_'.$schema_id ||
|
2089 |
+
|
2090 |
+
$meta_field['id'] == 'saswp_newsarticle_rating_'.$schema_id ||
|
2091 |
+
$meta_field['id'] == 'saswp_newsarticle_review_count_'.$schema_id ||
|
2092 |
+
|
2093 |
+
$meta_field['id'] == 'saswp_blogposting_rating_'.$schema_id ||
|
2094 |
+
$meta_field['id'] == 'saswp_blogposting_review_count_'.$schema_id ||
|
2095 |
+
|
2096 |
+
$meta_field['id'] == 'saswp_tech_article_rating_'.$schema_id ||
|
2097 |
+
$meta_field['id'] == 'saswp_tech_article_review_count_'.$schema_id ||
|
2098 |
|
2099 |
$meta_field['id'] == 'saswp_service_schema_review_count_'.$schema_id ||
|
2100 |
$meta_field['id'] == 'saswp_product_schema_review_count_'.$schema_id ||
|
2101 |
$meta_field['id'] == 'saswp_review_schema_review_count_'.$schema_id ||
|
2102 |
$meta_field['id'] == 'local_review_count_'.$schema_id ||
|
2103 |
+
$meta_field['id'] == 'saswp_recipe_schema_rating_'.$schema_id ||
|
2104 |
+
$meta_field['id'] == 'saswp_recipe_schema_review_count_'.$schema_id ||
|
2105 |
$meta_field['id'] == 'saswp_software_schema_rating_count_'.$schema_id
|
2106 |
|
2107 |
)
|
2525 |
|
2526 |
}
|
2527 |
$current_user = wp_get_current_user();
|
2528 |
+
$author_desc = get_the_author_meta( 'user_description' );
|
2529 |
$author_details = get_avatar_data($current_user->ID);
|
2530 |
$schema_type = esc_sql ( get_post_meta($schema_id, 'schema_type', true) );
|
2531 |
|
2776 |
'label' => 'Headline',
|
2777 |
'id' => 'saswp_blogposting_headline_'.$schema_id,
|
2778 |
'type' => 'text',
|
2779 |
+
'default'=> saswp_get_the_title()
|
2780 |
),
|
2781 |
array(
|
2782 |
'label' => 'Description',
|
2788 |
'label' => 'Name',
|
2789 |
'id' => 'saswp_blogposting_name_'.$schema_id,
|
2790 |
'type' => 'text',
|
2791 |
+
'default' => saswp_get_the_title()
|
2792 |
),
|
2793 |
array(
|
2794 |
'label' => 'URL',
|
2837 |
'id' => 'saswp_blogposting_speakable_'.$schema_id,
|
2838 |
'type' => 'checkbox',
|
2839 |
|
2840 |
+
),
|
2841 |
+
array(
|
2842 |
+
'label' => 'Aggregate Rating',
|
2843 |
+
'id' => 'saswp_blogposting_enable_rating_'.$schema_id,
|
2844 |
+
'type' => 'checkbox',
|
2845 |
+
),
|
2846 |
+
array(
|
2847 |
+
'label' => 'Rating Value',
|
2848 |
+
'id' => 'saswp_blogposting_rating_'.$schema_id,
|
2849 |
+
'type' => 'text',
|
2850 |
+
),
|
2851 |
+
array(
|
2852 |
+
'label' => 'Review Count',
|
2853 |
+
'id' => 'saswp_blogposting_review_count_'.$schema_id,
|
2854 |
+
'type' => 'text',
|
2855 |
+
)
|
2856 |
);
|
2857 |
break;
|
2858 |
|
2890 |
'label' => 'Headline',
|
2891 |
'id' => 'saswp_newsarticle_headline_'.$schema_id,
|
2892 |
'type' => 'text',
|
2893 |
+
'default' => saswp_get_the_title(),
|
2894 |
),
|
2895 |
array(
|
2896 |
'label' => 'Date Published',
|
2920 |
'label' => 'Article Body',
|
2921 |
'id' => 'saswp_newsarticle_body_'.$schema_id,
|
2922 |
'type' => 'textarea',
|
2923 |
+
'default' => $post->post_content
|
2924 |
),
|
2925 |
array(
|
2926 |
'label' => 'Name',
|
2927 |
'id' => 'saswp_newsarticle_name_'.$schema_id,
|
2928 |
'type' => 'text',
|
2929 |
+
'default' => saswp_get_the_title()
|
2930 |
),
|
2931 |
array(
|
2932 |
'label' => 'Thumbnail URL',
|
2933 |
'id' => 'saswp_newsarticle_thumbnailurl_'.$schema_id,
|
2934 |
+
'type' => 'text'
|
|
|
2935 |
),
|
2936 |
array(
|
2937 |
'label' => 'Word Count',
|
2980 |
'id' => 'saswp_newsarticle_organization_logo_'.$schema_id,
|
2981 |
'type' => 'media',
|
2982 |
'default' => isset($sd_data['sd_logo'])? $sd_data['sd_logo']['url']:''
|
2983 |
+
),
|
2984 |
array(
|
2985 |
'label' => 'Speakable',
|
2986 |
'id' => 'saswp_newsarticle_speakable_'.$schema_id,
|
2987 |
'type' => 'checkbox',
|
2988 |
|
2989 |
+
),
|
2990 |
+
array(
|
2991 |
+
'label' => 'Aggregate Rating',
|
2992 |
+
'id' => 'saswp_newsarticle_enable_rating_'.$schema_id,
|
2993 |
+
'type' => 'checkbox',
|
2994 |
+
),
|
2995 |
+
array(
|
2996 |
+
'label' => 'Rating Value',
|
2997 |
+
'id' => 'saswp_newsarticle_rating_'.$schema_id,
|
2998 |
+
'type' => 'text',
|
2999 |
+
),
|
3000 |
+
array(
|
3001 |
+
'label' => 'Review Count',
|
3002 |
+
'id' => 'saswp_newsarticle_review_count_'.$schema_id,
|
3003 |
+
'type' => 'text',
|
3004 |
)
|
3005 |
);
|
3006 |
break;
|
3011 |
'label' => 'Name',
|
3012 |
'id' => 'saswp_webpage_name_'.$schema_id,
|
3013 |
'type' => 'text',
|
3014 |
+
'default' => saswp_get_the_title()
|
3015 |
),
|
3016 |
array(
|
3017 |
'label' => 'URL',
|
3034 |
array(
|
3035 |
'label' => 'Image',
|
3036 |
'id' => 'saswp_webpage_image_'.$schema_id,
|
3037 |
+
'type' => 'media',
|
|
|
3038 |
),
|
3039 |
array(
|
3040 |
'label' => 'Headline',
|
3041 |
'id' => 'saswp_webpage_headline_'.$schema_id,
|
3042 |
'type' => 'text',
|
3043 |
+
'default' => saswp_get_the_title(),
|
3044 |
),
|
3045 |
|
3046 |
array(
|
3096 |
'type' => 'text',
|
3097 |
'default' => get_permalink()
|
3098 |
),
|
3099 |
+
array(
|
3100 |
+
'label' => 'URL',
|
3101 |
+
'id' => 'saswp_article_url_'.$schema_id,
|
3102 |
+
'type' => 'text',
|
3103 |
+
'default' => get_permalink(),
|
3104 |
+
),
|
3105 |
array(
|
3106 |
'label' => 'Image',
|
3107 |
'id' => 'saswp_article_image_'.$schema_id,
|
3108 |
+
'type' => 'media'
|
|
|
3109 |
),
|
3110 |
array(
|
3111 |
'label' => 'Headline',
|
3112 |
'id' => 'saswp_article_headline_'.$schema_id,
|
3113 |
'type' => 'text',
|
3114 |
+
'default' => saswp_get_the_title()
|
3115 |
),
|
3116 |
array(
|
3117 |
'label' => 'Description',
|
3160 |
'id' => 'saswp_article_speakable_'.$schema_id,
|
3161 |
'type' => 'checkbox',
|
3162 |
|
3163 |
+
),
|
3164 |
+
array(
|
3165 |
+
'label' => 'Aggregate Rating',
|
3166 |
+
'id' => 'saswp_article_enable_rating_'.$schema_id,
|
3167 |
+
'type' => 'checkbox',
|
3168 |
+
),
|
3169 |
+
array(
|
3170 |
+
'label' => 'Rating Value',
|
3171 |
+
'id' => 'saswp_article_rating_'.$schema_id,
|
3172 |
+
'type' => 'text',
|
3173 |
+
),
|
3174 |
+
array(
|
3175 |
+
'label' => 'Review Count',
|
3176 |
+
'id' => 'saswp_article_review_count_'.$schema_id,
|
3177 |
+
'type' => 'text',
|
3178 |
)
|
3179 |
);
|
3180 |
break;
|
3306 |
'label' => 'Headline',
|
3307 |
'id' => 'saswp_tech_article_headline_'.$schema_id,
|
3308 |
'type' => 'text',
|
3309 |
+
'default' => saswp_get_the_title()
|
3310 |
),
|
3311 |
array(
|
3312 |
'label' => 'Description',
|
3355 |
'id' => 'saswp_tech_article_speakable_'.$schema_id,
|
3356 |
'type' => 'checkbox',
|
3357 |
|
3358 |
+
),
|
3359 |
+
array(
|
3360 |
+
'label' => 'Aggregate Rating',
|
3361 |
+
'id' => 'saswp_tech_article_enable_rating_'.$schema_id,
|
3362 |
+
'type' => 'checkbox',
|
3363 |
+
),
|
3364 |
+
array(
|
3365 |
+
'label' => 'Rating Value',
|
3366 |
+
'id' => 'saswp_tech_article_rating_'.$schema_id,
|
3367 |
+
'type' => 'text',
|
3368 |
+
),
|
3369 |
+
array(
|
3370 |
+
'label' => 'Review Count',
|
3371 |
+
'id' => 'saswp_tech_article_review_count_'.$schema_id,
|
3372 |
+
'type' => 'text',
|
3373 |
)
|
3374 |
);
|
3375 |
break;
|
3380 |
'label' => 'Name',
|
3381 |
'id' => 'saswp_course_name_'.$schema_id,
|
3382 |
'type' => 'text',
|
3383 |
+
'default' => saswp_get_the_title()
|
3384 |
),
|
3385 |
array(
|
3386 |
'label' => 'Description',
|
3427 |
'label' => 'Headline',
|
3428 |
'id' => 'saswp_dfp_headline_'.$schema_id,
|
3429 |
'type' => 'text',
|
3430 |
+
'default' => saswp_get_the_title()
|
3431 |
),
|
3432 |
array(
|
3433 |
'label' => 'Description',
|
3481 |
'label' => 'Name',
|
3482 |
'id' => 'saswp_recipe_name_'.$schema_id,
|
3483 |
'type' => 'text',
|
3484 |
+
'default' => saswp_get_the_title()
|
3485 |
),
|
3486 |
+
array(
|
3487 |
+
'label' => 'Image',
|
3488 |
+
'id' => 'saswp_recipe_image_'.$schema_id,
|
3489 |
+
'type' => 'media'
|
3490 |
+
),
|
3491 |
array(
|
3492 |
'label' => 'Date Published',
|
3493 |
'id' => 'saswp_recipe_date_published_'.$schema_id,
|
3677 |
'attributes' => array(
|
3678 |
'placeholder' => 'PT1M33S'
|
3679 |
),
|
3680 |
+
),
|
3681 |
+
array(
|
3682 |
+
'label' => 'Aggregate Rating',
|
3683 |
+
'id' => 'saswp_recipe_schema_enable_rating_'.$schema_id,
|
3684 |
+
'type' => 'checkbox',
|
3685 |
+
),
|
3686 |
+
array(
|
3687 |
+
'label' => 'Rating',
|
3688 |
+
'id' => 'saswp_recipe_schema_rating_'.$schema_id,
|
3689 |
+
'type' => 'text',
|
3690 |
+
),
|
3691 |
+
array(
|
3692 |
+
'label' => 'Number of Reviews',
|
3693 |
+
'id' => 'saswp_recipe_schema_review_count_'.$schema_id,
|
3694 |
+
'type' => 'text',
|
3695 |
+
)
|
3696 |
+
|
3697 |
);
|
3698 |
break;
|
3699 |
|
4146 |
'label' => 'Headline',
|
4147 |
'id' => 'saswp_video_object_headline_'.$schema_id,
|
4148 |
'type' => 'text',
|
4149 |
+
'default' => saswp_get_the_title()
|
4150 |
),
|
4151 |
array(
|
4152 |
'label' => 'Date Published',
|
4170 |
'label' => 'Name',
|
4171 |
'id' => 'saswp_video_object_name_'.$schema_id,
|
4172 |
'type' => 'text',
|
4173 |
+
'default' => saswp_get_the_title()
|
4174 |
),
|
4175 |
array(
|
4176 |
'label' => 'Upload Date',
|