Version Description
(09 July 2019) =
- Bug Fixed: Undefined variable: schema in /view/post_specific.php #376
- Bug Fixed: URL Field is Recommended in How to supply schema. #375
- Bug Fixed: The text inside tag 'script type=application/ld+json' contains 'html comments', which is disallowed. #374
Download this release
Release Info
Developer | magazine3 |
Plugin | Schema & Structured Data for WP & AMP |
Version | 1.8.9.1 |
Comparing to | |
See all releases |
Code changes from version 1.8.9 to 1.8.9.1
- admin_section/common-function.php +2 -1
- admin_section/js/main-script.js +76 -27
- admin_section/js/main-script.min.js +1 -1701
- output/output.php +8 -6
- readme.txt +7 -1
- structured-data-for-wp.php +2 -2
- view/post_specific.php +22 -13
admin_section/common-function.php
CHANGED
@@ -1838,8 +1838,9 @@ if ( ! defined('ABSPATH') ) exit;
|
|
1838 |
$content = '';
|
1839 |
if(is_object($post)){
|
1840 |
$content = get_post_field('post_content', $post->ID);
|
|
|
1841 |
}
|
1842 |
-
|
1843 |
return $content;
|
1844 |
|
1845 |
}
|
1838 |
$content = '';
|
1839 |
if(is_object($post)){
|
1840 |
$content = get_post_field('post_content', $post->ID);
|
1841 |
+
$content = wp_strip_all_tags(strip_shortcodes($content));
|
1842 |
}
|
1843 |
+
|
1844 |
return $content;
|
1845 |
|
1846 |
}
|
admin_section/js/main-script.js
CHANGED
@@ -9,6 +9,55 @@ function getParameterByName(name, url) {
|
|
9 |
if (!results[2]) return "";
|
10 |
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
11 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
jQuery(document).ready(function($){
|
13 |
|
14 |
/* Newletters js starts here */
|
@@ -1204,9 +1253,7 @@ jQuery(document).ready(function($){
|
|
1204 |
},'json');
|
1205 |
|
1206 |
});
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
//Trip schema starts here
|
1211 |
|
1212 |
$(document).on("click", ".saswp-trip-itinerary", function(e){
|
@@ -1424,7 +1471,7 @@ jQuery(document).ready(function($){
|
|
1424 |
//Medical condition schema ends here
|
1425 |
|
1426 |
//How to schema js starts here
|
1427 |
-
|
1428 |
$(document).on("click", ".saswp-how-to-supply", function(e){
|
1429 |
e.preventDefault();
|
1430 |
|
@@ -1436,31 +1483,30 @@ jQuery(document).ready(function($){
|
|
1436 |
if(!index){
|
1437 |
index = 0;
|
1438 |
}
|
1439 |
-
|
1440 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1441 |
|
1442 |
-
|
1443 |
-
|
1444 |
-
+ '<table class="form-table saswp-how-to-supply-table">'
|
1445 |
-
+ '<tr>'
|
1446 |
-
+ '<th>Supply Name</th><td><input style="width:100%" type="text" id="saswp_howto_supply_name_'+index+'_'+schema_id+'" name="howto_supply_'+schema_id+'['+index+'][saswp_howto_supply_name]"></td>'
|
1447 |
-
+ '</tr>'
|
1448 |
-
+ '<tr>'
|
1449 |
-
+ '<th>Supply Image</th>'
|
1450 |
-
+ '<td>'
|
1451 |
-
+ '<fieldset>'
|
1452 |
-
+ '<input style="width:80%" type="text" id="saswp_howto_supply_image_'+index+'_'+schema_id+'" name="saswp_howto_supply_image_'+index+'_'+schema_id+'">'
|
1453 |
-
+ '<input type="hidden" data-id="saswp_howto_supply_image_'+index+'_'+schema_id+'_id" name="howto_supply_'+schema_id+'['+index+'][saswp_howto_supply_image_id]" id="saswp_howto_supply_image_'+index+'_'+schema_id+'_id">'
|
1454 |
-
+ '<input data-id="media" style="width: 19%" class="button" id="saswp_howto_supply_image_'+index+'_'+schema_id+'_button" name="saswp_howto_supply_image_'+index+'_'+schema_id+'_button" type="button" value="Upload">'
|
1455 |
-
+ '<div class="saswp_image_div_saswp_howto_supply_image_'+index+'_'+schema_id+'">'
|
1456 |
-
+ '</div>'
|
1457 |
-
+ '</fieldset>'
|
1458 |
-
+ '</td>'
|
1459 |
-
+ '</tr>'
|
1460 |
-
+ '</table>'
|
1461 |
-
+ '</div>';
|
1462 |
if(html){
|
1463 |
-
$('.saswp-
|
1464 |
}
|
1465 |
|
1466 |
|
@@ -1487,6 +1533,9 @@ jQuery(document).ready(function($){
|
|
1487 |
+ '<th>Tool Name</th><td><input style="width:100%" type="text" id="saswp_howto_tool_name_'+index+'_'+schema_id+'" name="howto_tool_'+schema_id+'['+index+'][saswp_howto_tool_name]"></td>'
|
1488 |
+ '</tr>'
|
1489 |
+ '<tr>'
|
|
|
|
|
|
|
1490 |
+ '<th>Tool Image</th>'
|
1491 |
+ '<td>'
|
1492 |
+ '<fieldset>'
|
9 |
if (!results[2]) return "";
|
10 |
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
11 |
}
|
12 |
+
|
13 |
+
function saswp_fields_html_generator(index, schema_id, fields_type, div_type, schema_fields){
|
14 |
+
|
15 |
+
var html = '';
|
16 |
+
|
17 |
+
html += '<div class="saswp-'+div_type+'-table-div" data-id="'+index+'">'
|
18 |
+
+ '<a class="saswp-table-close">X</a>'
|
19 |
+
+ '<table class="form-table saswp-'+div_type+'-table">'
|
20 |
+
|
21 |
+
$.each(schema_fields, function(eachindex, element){
|
22 |
+
|
23 |
+
switch(element.type) {
|
24 |
+
|
25 |
+
case "text":
|
26 |
+
|
27 |
+
html += '<tr>'
|
28 |
+
+ '<th>'+element.label+'</th><td><input style="width:100%" type="text" id="'+element.name+'_'+index+'_'+schema_id+'" name="'+fields_type+schema_id+'['+index+']['+element.name+']"></td>'
|
29 |
+
+ '</tr>';
|
30 |
+
|
31 |
+
break;
|
32 |
+
|
33 |
+
case "media":
|
34 |
+
|
35 |
+
html += '<tr>'
|
36 |
+
+ '<th>'+element.label+'</th>'
|
37 |
+
+ '<td>'
|
38 |
+
+ '<fieldset>'
|
39 |
+
+ '<input style="width:80%" type="text" id="'+element.name+'_'+index+'_'+schema_id+'" name="'+element.name+'_'+index+'_'+schema_id+'">'
|
40 |
+
+ '<input type="hidden" data-id="'+element.name+'_'+index+'_'+schema_id+'_id" name="'+fields_type+schema_id+'['+index+']['+element.name+'_id]" id="'+element.name+'_'+index+'_'+schema_id+'_id">'
|
41 |
+
+ '<input data-id="media" style="width: 19%" class="button" id="'+element.name+'_'+index+'_'+schema_id+'_button" name="'+element.name+'_'+index+'_'+schema_id+'_button" type="button" value="Upload">'
|
42 |
+
+ '<div class="saswp_image_div_'+element.name+'_'+index+'_'+schema_id+'">'
|
43 |
+
+ '</div>'
|
44 |
+
+ '</fieldset>'
|
45 |
+
+ '</td>'
|
46 |
+
+ '</tr>';
|
47 |
+
|
48 |
+
break;
|
49 |
+
default:
|
50 |
+
// code block
|
51 |
+
}
|
52 |
+
|
53 |
+
});
|
54 |
+
html += '</table>'
|
55 |
+
+ '</div>';
|
56 |
+
|
57 |
+
return html;
|
58 |
+
|
59 |
+
}
|
60 |
+
|
61 |
jQuery(document).ready(function($){
|
62 |
|
63 |
/* Newletters js starts here */
|
1253 |
},'json');
|
1254 |
|
1255 |
});
|
1256 |
+
|
|
|
|
|
1257 |
//Trip schema starts here
|
1258 |
|
1259 |
$(document).on("click", ".saswp-trip-itinerary", function(e){
|
1471 |
//Medical condition schema ends here
|
1472 |
|
1473 |
//How to schema js starts here
|
1474 |
+
|
1475 |
$(document).on("click", ".saswp-how-to-supply", function(e){
|
1476 |
e.preventDefault();
|
1477 |
|
1483 |
if(!index){
|
1484 |
index = 0;
|
1485 |
}
|
1486 |
+
var fields_type = 'howto_supply_';
|
1487 |
+
var div_type = 'how-to-supply';
|
1488 |
+
var schema_fields = [
|
1489 |
+
{
|
1490 |
+
label: "Supply Name",
|
1491 |
+
name : "saswp_howto_supply_name",
|
1492 |
+
type : "text"
|
1493 |
+
},
|
1494 |
+
{
|
1495 |
+
label: "Supply URL",
|
1496 |
+
name : "saswp_howto_supply_url",
|
1497 |
+
type : "text"
|
1498 |
+
},
|
1499 |
+
{
|
1500 |
+
label: "Supply Image",
|
1501 |
+
name : "saswp_howto_supply_image",
|
1502 |
+
type : "media"
|
1503 |
+
}
|
1504 |
+
];
|
1505 |
|
1506 |
+
var html = saswp_fields_html_generator(index, schema_id, fields_type, div_type, schema_fields);
|
1507 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1508 |
if(html){
|
1509 |
+
$('.saswp-'+div_type+'-section[data-id="'+schema_id+'"]').append(html);
|
1510 |
}
|
1511 |
|
1512 |
|
1533 |
+ '<th>Tool Name</th><td><input style="width:100%" type="text" id="saswp_howto_tool_name_'+index+'_'+schema_id+'" name="howto_tool_'+schema_id+'['+index+'][saswp_howto_tool_name]"></td>'
|
1534 |
+ '</tr>'
|
1535 |
+ '<tr>'
|
1536 |
+
+ '<th>Tool URL</th><td><input style="width:100%" type="text" id="saswp_howto_tool_url_'+index+'_'+schema_id+'" name="howto_tool_'+schema_id+'['+index+'][saswp_howto_tool_url]"></td>'
|
1537 |
+
+ '</tr>'
|
1538 |
+
+ '<tr>'
|
1539 |
+ '<th>Tool Image</th>'
|
1540 |
+ '<td>'
|
1541 |
+ '<fieldset>'
|
admin_section/js/main-script.min.js
CHANGED
@@ -1,1701 +1 @@
|
|
1 |
-
function getParameterByName(name, url) {
|
2 |
-
if (!url){
|
3 |
-
url = window.location.href;
|
4 |
-
}
|
5 |
-
name = name.replace(/[\[\]]/g, "\\$&");
|
6 |
-
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
|
7 |
-
results = regex.exec(url);
|
8 |
-
if (!results) return null;
|
9 |
-
if (!results[2]) return "";
|
10 |
-
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
11 |
-
}
|
12 |
-
jQuery(document).ready(function($){
|
13 |
-
|
14 |
-
/* Newletters js starts here */
|
15 |
-
|
16 |
-
if(saswp_localize_data.do_tour){
|
17 |
-
|
18 |
-
var content = '<h3>Thanks for using Structured Data!</h3>';
|
19 |
-
content += '<p>Do you want the latest on <b>Structured Data update</b> before others and some best resources on monetization in a single email? - Free just for users of Structured Data!</p>';
|
20 |
-
content += '<style type="text/css">';
|
21 |
-
content += '.wp-pointer-buttons{ padding:0; overflow: hidden; }';
|
22 |
-
content += '.wp-pointer-content .button-secondary{ left: -25px;background: transparent;top: 5px; border: 0;position: relative; padding: 0; box-shadow: none;margin: 0;color: #0085ba;} .wp-pointer-content .button-primary{ display:none} #afw_mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }';
|
23 |
-
content += '</style>';
|
24 |
-
content += '<div id="afw_mc_embed_signup">';
|
25 |
-
content += '<form action="//app.mailerlite.com/webforms/submit/o1s7u3" data-id="258182" data-code="o1s7u3" method="POST" target="_blank">';
|
26 |
-
content += '<div id="afw_mc_embed_signup_scroll">';
|
27 |
-
content += '<div class="afw-mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">';
|
28 |
-
content += '<input type="text" name="fields[name]" class="form-control" placeholder="Name" hidden value="'+saswp_localize_data.current_user_name+'" style="display:none">';
|
29 |
-
content += '<input type="text" value="'+saswp_localize_data.current_user_email+'" name="fields[email]" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">';
|
30 |
-
content += '<input type="text" name="fields[company]" class="form-control" placeholder="Website" hidden style=" display:none; width: 168px; padding: 6px 5px;" value="'+saswp_localize_data.get_home_url+'">';
|
31 |
-
content += '<input type="hidden" name="ml-submit" value="1" />';
|
32 |
-
content += '</div>';
|
33 |
-
content += '<div id="mce-responses">';
|
34 |
-
content += '<div class="response" id="mce-error-response" style="display:none"></div>';
|
35 |
-
content += '<div class="response" id="mce-success-response" style="display:none"></div>';
|
36 |
-
content += '</div>';
|
37 |
-
content += '<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>';
|
38 |
-
content += '<input type="submit" value="Subscribe" name="subscribe" id="pointer-close" class="button mc-newsletter-sent" style=" background: #0085ba; border-color: #006799; padding: 0px 16px; text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799; height: 30px; margin-top: 1px; color: #fff; box-shadow: 0 1px 0 #006799;">';
|
39 |
-
content += '</div>';
|
40 |
-
content += '</form>';
|
41 |
-
content += '</div>';
|
42 |
-
|
43 |
-
var setup;
|
44 |
-
var wp_pointers_tour_opts = {
|
45 |
-
content:content,
|
46 |
-
position:{
|
47 |
-
edge:"top",
|
48 |
-
align:"left"
|
49 |
-
}
|
50 |
-
};
|
51 |
-
|
52 |
-
wp_pointers_tour_opts = $.extend (wp_pointers_tour_opts, {
|
53 |
-
buttons: function (event, t) {
|
54 |
-
button= jQuery ('<a id="pointer-close" class="button-secondary">' + saswp_localize_data.button1 + '</a>');
|
55 |
-
button_2= jQuery ('#pointer-close.button');
|
56 |
-
button.bind ('click.pointer', function () {
|
57 |
-
t.element.pointer ('close');
|
58 |
-
});
|
59 |
-
button_2.on('click', function() {
|
60 |
-
t.element.pointer ('close');
|
61 |
-
} );
|
62 |
-
return button;
|
63 |
-
},
|
64 |
-
close: function () {
|
65 |
-
$.post (saswp_localize_data.ajax_url, {
|
66 |
-
pointer: 'saswp_subscribe_pointer222',
|
67 |
-
action: 'dismiss-wp-pointer'
|
68 |
-
});
|
69 |
-
},
|
70 |
-
show: function(event, t){
|
71 |
-
t.pointer.css({'left':'170px', 'top':'160px'});
|
72 |
-
}
|
73 |
-
});
|
74 |
-
setup = function () {
|
75 |
-
$(saswp_localize_data.displayID).pointer(wp_pointers_tour_opts).pointer('open');
|
76 |
-
if (saswp_localize_data.button2) {
|
77 |
-
jQuery ('#pointer-close').after ('<a id="pointer-primary" class="button-primary">' + saswp_localize_data.button2+ '</a>');
|
78 |
-
jQuery ('#pointer-primary').click (function () {
|
79 |
-
saswp_localize_data.function_name;
|
80 |
-
});
|
81 |
-
jQuery ('#pointer-close').click (function () {
|
82 |
-
$.post (saswp_localize_data.ajax_url, {
|
83 |
-
pointer: 'saswp_subscribe_pointer222',
|
84 |
-
action: 'dismiss-wp-pointer'
|
85 |
-
});
|
86 |
-
});
|
87 |
-
}
|
88 |
-
};
|
89 |
-
if (wp_pointers_tour_opts.position && wp_pointers_tour_opts.position.defer_loading) {
|
90 |
-
$(window).bind('load.wp-pointers', setup);
|
91 |
-
}
|
92 |
-
else {
|
93 |
-
setup ();
|
94 |
-
}
|
95 |
-
|
96 |
-
}
|
97 |
-
|
98 |
-
/* Newletters js ends here */
|
99 |
-
|
100 |
-
|
101 |
-
$(".saswp-tabs a").click(function(e){
|
102 |
-
var href = $(this).attr('href');
|
103 |
-
var currentTab = getParameterByName('tab',href);
|
104 |
-
if(!currentTab){
|
105 |
-
currentTab = "general";
|
106 |
-
}
|
107 |
-
$(this).siblings().removeClass("nav-tab-active");
|
108 |
-
$(this).addClass("nav-tab-active");
|
109 |
-
$(".form-wrap").find(".saswp-"+currentTab).siblings().hide();
|
110 |
-
$(".form-wrap .saswp-"+currentTab).show();
|
111 |
-
window.history.pushState("", "", href);
|
112 |
-
return false;
|
113 |
-
});
|
114 |
-
|
115 |
-
$(".saswp-schame-type-select").change(function(){
|
116 |
-
$(".saswp-custom-fields-table").html('');
|
117 |
-
var schematype = $ (this).val();
|
118 |
-
|
119 |
-
$(".saswp-option-table-class tr").each(function(index,value){
|
120 |
-
if(index>0){
|
121 |
-
$(this).hide();
|
122 |
-
$(this).find('select').attr('disabled', true);
|
123 |
-
}
|
124 |
-
});
|
125 |
-
if(schematype == 'TechArticle' || schematype == 'Article' || schematype == 'Blogposting' || schematype == 'NewsArticle' || schematype == 'WebPage'){
|
126 |
-
|
127 |
-
$(".saswp-enable-speakable").parent().parent().show();
|
128 |
-
}else{
|
129 |
-
$(".saswp-enable-speakable").parent().parent().hide();
|
130 |
-
}
|
131 |
-
|
132 |
-
if(schematype == 'local_business'){
|
133 |
-
$(".saswp-option-table-class tr").eq(1).show();
|
134 |
-
$(".saswp-business-text-field-tr").show();
|
135 |
-
$(".saswp-option-table-class tr").find('select').attr('disabled', false);
|
136 |
-
// $("#saswp_dayofweek").attr('disabled', false);
|
137 |
-
$('.select-post-type').val('show_globally').trigger('change');
|
138 |
-
}
|
139 |
-
if(schematype == 'Service'){
|
140 |
-
$(".saswp-service-text-field-tr").show();
|
141 |
-
$(".saswp-option-table-class tr").find('select').attr('disabled', false);
|
142 |
-
}
|
143 |
-
if(schematype == 'Review'){
|
144 |
-
$(".saswp-review-text-field-tr").show();
|
145 |
-
$(".saswp-option-table-class tr").find('select').attr('disabled', false);
|
146 |
-
saswp_item_reviewed_call();
|
147 |
-
}
|
148 |
-
if(schematype == 'Product'){
|
149 |
-
$(".saswp-product-text-field-tr").show();
|
150 |
-
$(".saswp-option-table-class tr").find('select').attr('disabled', false);
|
151 |
-
}
|
152 |
-
if(schematype == 'Event'){
|
153 |
-
$(".saswp-event-text-field-tr").show();
|
154 |
-
$(".saswp-option-table-class tr").find('select').attr('disabled', false);
|
155 |
-
}
|
156 |
-
if(schematype == 'AudioObject'){
|
157 |
-
$(".saswp-audio-text-field-tr").show();
|
158 |
-
}
|
159 |
-
if(schematype == 'SoftwareApplication'){
|
160 |
-
$(".saswp-softwareapplication-text-field-tr").show();
|
161 |
-
}
|
162 |
-
|
163 |
-
$(".saswp-schem-type-note").addClass('saswp_hide');
|
164 |
-
if(schematype == 'qanda'){
|
165 |
-
$(".saswp-schem-type-note").removeClass('saswp_hide');
|
166 |
-
}
|
167 |
-
|
168 |
-
$(".saswp-job-posting-note").addClass('saswp_hide');
|
169 |
-
|
170 |
-
// if(schematype == 'JobPosting'){
|
171 |
-
// $(".saswp-job-posting-note").removeClass('saswp_hide');
|
172 |
-
// }
|
173 |
-
|
174 |
-
saswp_enable_rating_review();
|
175 |
-
});
|
176 |
-
|
177 |
-
$("#saswp_business_type").change(function(){
|
178 |
-
var businesstype = $ (this).val();
|
179 |
-
var schematype = $(".saswp-schame-type-select").val();
|
180 |
-
|
181 |
-
$(".saswp-option-table-class tr").each(function(index,value){
|
182 |
-
if(index>1){
|
183 |
-
$(this).hide();
|
184 |
-
$(this).find('select').attr('disabled', true);
|
185 |
-
}
|
186 |
-
});
|
187 |
-
|
188 |
-
if(schematype == 'TechArticle' || schematype == 'Article' || schematype == 'Blogposting' || schematype == 'NewsArticle' || schematype == 'WebPage'){
|
189 |
-
|
190 |
-
$(".saswp-enable-speakable").parent().parent().show();
|
191 |
-
}else{
|
192 |
-
$(".saswp-enable-speakable").parent().parent().hide();
|
193 |
-
}
|
194 |
-
|
195 |
-
if(schematype == 'local_business'){
|
196 |
-
$(".saswp-"+businesstype+'-tr').show();
|
197 |
-
$(".saswp-business-text-field-tr").show();
|
198 |
-
$(".saswp-"+businesstype+'-tr').find('select').attr('disabled', false);
|
199 |
-
// $("#saswp_dayofweek").attr('disabled', false);
|
200 |
-
}
|
201 |
-
if(schematype == 'Service'){
|
202 |
-
$(".saswp-service-text-field-tr").show();
|
203 |
-
$(".saswp-service-text-field-tr").find('select').attr('disabled', false);
|
204 |
-
}
|
205 |
-
if(schematype == 'Product'){
|
206 |
-
$(".saswp-product-text-field-tr").show();
|
207 |
-
$(".saswp-product-text-field-tr").find('select').attr('disabled', false);
|
208 |
-
}
|
209 |
-
if(schematype == 'AudioObject'){
|
210 |
-
$(".saswp-audio-text-field-tr").show();
|
211 |
-
}
|
212 |
-
if(schematype == 'SoftwareApplication'){
|
213 |
-
$(".saswp-softwareapplication-text-field-tr").show();
|
214 |
-
}
|
215 |
-
|
216 |
-
if(schematype == 'Review'){
|
217 |
-
$(".saswp-review-text-field-tr").show();
|
218 |
-
$(".saswp-review-text-field-tr").find('select').attr('disabled', false);
|
219 |
-
}
|
220 |
-
if(schematype == 'Event'){
|
221 |
-
$(".saswp-event-text-field-tr").show();
|
222 |
-
$(".saswp-event-text-field-tr").find('select').attr('disabled', false);
|
223 |
-
}
|
224 |
-
saswp_enable_rating_review();
|
225 |
-
}).change();
|
226 |
-
|
227 |
-
|
228 |
-
//Settings page jquery starts here
|
229 |
-
|
230 |
-
|
231 |
-
function saswp_compatibliy_notes(current, id){
|
232 |
-
|
233 |
-
var plugin_name = id.replace('-checkbox','');
|
234 |
-
var text = $("#"+plugin_name).next('p').text();
|
235 |
-
|
236 |
-
if (current.is(':checked') && text !=='') {
|
237 |
-
$("#"+plugin_name).next('p').removeClass('saswp_hide');
|
238 |
-
}else{
|
239 |
-
|
240 |
-
if($("#"+plugin_name).next('p').attr('data-id') == 1){
|
241 |
-
$("#"+plugin_name).next('p').text('This feature is only available in pro version');
|
242 |
-
}else{
|
243 |
-
$("#"+plugin_name).next('p').addClass('saswp_hide');
|
244 |
-
}
|
245 |
-
}
|
246 |
-
|
247 |
-
}
|
248 |
-
|
249 |
-
|
250 |
-
$(".saswp-checkbox").change(function(){
|
251 |
-
|
252 |
-
var id = $(this).attr("id");
|
253 |
-
var current = $(this);
|
254 |
-
|
255 |
-
|
256 |
-
switch(id){
|
257 |
-
case 'saswp-for-wordpress-checkbox':
|
258 |
-
|
259 |
-
if ($(this).is(':checked')) {
|
260 |
-
$("#saswp-for-wordpress").val(1);
|
261 |
-
}else{
|
262 |
-
$("#saswp-for-wordpress").val(0);
|
263 |
-
}
|
264 |
-
break;
|
265 |
-
case 'saswp-facebook-enable-checkbox':
|
266 |
-
|
267 |
-
if ($(this).is(':checked')) {
|
268 |
-
$("#saswp-facebook-enable").val(1);
|
269 |
-
$("#sd_facebook").show();
|
270 |
-
}else{
|
271 |
-
$("#saswp-facebook-enable").val(0);
|
272 |
-
$("#sd_facebook").hide();
|
273 |
-
}
|
274 |
-
break;
|
275 |
-
case 'saswp-twitter-enable-checkbox':
|
276 |
-
|
277 |
-
if ($(this).is(':checked')) {
|
278 |
-
$("#saswp-twitter-enable").val(1);
|
279 |
-
$("#sd_twitter").show();
|
280 |
-
}else{
|
281 |
-
$("#saswp-twitter-enable").val(0);
|
282 |
-
$("#sd_twitter").hide();
|
283 |
-
}
|
284 |
-
break;
|
285 |
-
case 'saswp-google-plus-enable-checkbox':
|
286 |
-
|
287 |
-
if ($(this).is(':checked')) {
|
288 |
-
$("#saswp-google-plus-enable").val(1);
|
289 |
-
$("#sd_google_plus").show();
|
290 |
-
}else{
|
291 |
-
$("#saswp-google-plus-enable").val(0);
|
292 |
-
$("#sd_google_plus").hide();
|
293 |
-
}
|
294 |
-
break;
|
295 |
-
case 'saswp-instagram-enable-checkbox':
|
296 |
-
|
297 |
-
if ($(this).is(':checked')) {
|
298 |
-
$("#saswp-instagram-enable").val(1);
|
299 |
-
$("#sd_instagram").show();
|
300 |
-
}else{
|
301 |
-
$("#saswp-instagram-enable").val(0);
|
302 |
-
$("#sd_instagram").hide();
|
303 |
-
}
|
304 |
-
break;
|
305 |
-
case 'saswp-youtube-enable-checkbox':
|
306 |
-
|
307 |
-
if ($(this).is(':checked')) {
|
308 |
-
$("#sd_youtube").show();
|
309 |
-
$("#saswp-youtube-enable").val(1);
|
310 |
-
}else{
|
311 |
-
$("#saswp-youtube-enable").val(0);
|
312 |
-
$("#sd_youtube").hide();
|
313 |
-
}
|
314 |
-
break;
|
315 |
-
case 'saswp-linkedin-enable-checkbox':
|
316 |
-
|
317 |
-
if ($(this).is(':checked')) {
|
318 |
-
$("#saswp-linkedin-enable").val(1);
|
319 |
-
$("#sd_linkedin").show();
|
320 |
-
}else{
|
321 |
-
$("#saswp-linkedin-enable").val(0);
|
322 |
-
$("#sd_linkedin").hide();
|
323 |
-
}
|
324 |
-
break;
|
325 |
-
case 'saswp-pinterest-enable-checkbox':
|
326 |
-
|
327 |
-
if ($(this).is(':checked')) {
|
328 |
-
$("#saswp-pinterest-enable").val(1);
|
329 |
-
$("#sd_pinterest").show();
|
330 |
-
}else{
|
331 |
-
$("#saswp-pinterest-enable").val(0);
|
332 |
-
$("#sd_pinterest").hide();
|
333 |
-
}
|
334 |
-
break;
|
335 |
-
case 'saswp-soundcloud-enable-checkbox':
|
336 |
-
|
337 |
-
if ($(this).is(':checked')) {
|
338 |
-
$("#saswp-soundcloud-enable").val(1);
|
339 |
-
$("#sd_soundcloud").show();
|
340 |
-
}else{
|
341 |
-
$("#saswp-soundcloud-enable").val(0);
|
342 |
-
$("#sd_soundcloud").hide();
|
343 |
-
}
|
344 |
-
break;
|
345 |
-
case 'saswp-tumblr-enable-checkbox':
|
346 |
-
|
347 |
-
if ($(this).is(':checked')) {
|
348 |
-
$("#saswp-tumblr-enable").val(1);
|
349 |
-
$("#sd_tumblr").show();
|
350 |
-
}else{
|
351 |
-
$("#saswp-tumblr-enable").val(0);
|
352 |
-
$("#sd_tumblr").hide();
|
353 |
-
}
|
354 |
-
break;
|
355 |
-
case 'saswp-for-amp-checkbox':
|
356 |
-
|
357 |
-
if ($(this).is(':checked')) {
|
358 |
-
$("#saswp-for-amp").val(1);
|
359 |
-
}else{
|
360 |
-
$("#saswp-for-amp").val(0);
|
361 |
-
}
|
362 |
-
break;
|
363 |
-
case 'saswp_kb_contact_1_checkbox':
|
364 |
-
|
365 |
-
if ($(this).is(':checked')) {
|
366 |
-
$("#saswp_kb_contact_1").val(1);
|
367 |
-
$("#saswp_kb_telephone, #saswp_contact_type").parent().parent('li').removeClass("saswp-display-none");
|
368 |
-
}else{
|
369 |
-
$("#saswp_kb_contact_1").val(0);
|
370 |
-
$("#saswp_kb_telephone, #saswp_contact_type").parent().parent('li').addClass("saswp-display-none");
|
371 |
-
}
|
372 |
-
break;
|
373 |
-
case 'saswp-logo-dimensions-check':
|
374 |
-
|
375 |
-
if ($(this).is(':checked')) {
|
376 |
-
$("#saswp-logo-dimensions").val(1);
|
377 |
-
$("#saswp-logo-width, #saswp-logo-height").parent().parent('li').show();
|
378 |
-
}else{
|
379 |
-
$("#saswp-logo-dimensions").val(0);
|
380 |
-
$("#saswp-logo-width, #saswp-logo-height").parent().parent('li').hide();
|
381 |
-
}
|
382 |
-
break;
|
383 |
-
case 'saswp_archive_schema_checkbox':
|
384 |
-
|
385 |
-
if ($(this).is(':checked')) {
|
386 |
-
$("#saswp_archive_schema").val(1);
|
387 |
-
$(".saswp_archive_schema_type_class").parent().parent().show();
|
388 |
-
}else{
|
389 |
-
$("#saswp_archive_schema").val(0);
|
390 |
-
$(".saswp_archive_schema_type_class").parent().parent().hide();
|
391 |
-
}
|
392 |
-
break;
|
393 |
-
|
394 |
-
case 'saswp_website_schema_checkbox':
|
395 |
-
|
396 |
-
if ($(this).is(':checked')) {
|
397 |
-
$("#saswp_website_schema").val(1);
|
398 |
-
$("#saswp_search_box_schema").parent().parent().show();
|
399 |
-
}else{
|
400 |
-
$("#saswp_website_schema").val(0);
|
401 |
-
$("#saswp_search_box_schema").parent().parent().hide();
|
402 |
-
}
|
403 |
-
break;
|
404 |
-
|
405 |
-
case 'saswp_search_box_schema_checkbox':
|
406 |
-
|
407 |
-
if ($(this).is(':checked')) {
|
408 |
-
$("#saswp_search_box_schema").val(1);
|
409 |
-
}else{
|
410 |
-
$("#saswp_search_box_schema").val(0);
|
411 |
-
}
|
412 |
-
break;
|
413 |
-
|
414 |
-
case 'saswp_breadcrumb_schema_checkbox':
|
415 |
-
|
416 |
-
if ($(this).is(':checked')) {
|
417 |
-
$("#saswp_breadcrumb_schema").val(1);
|
418 |
-
}else{
|
419 |
-
$("#saswp_breadcrumb_schema").val(0);
|
420 |
-
}
|
421 |
-
break;
|
422 |
-
|
423 |
-
case 'saswp_site_navigation_menu_checkbox':
|
424 |
-
|
425 |
-
if ($(this).is(':checked')) {
|
426 |
-
$("#saswp_site_navigation_menu").val(1);
|
427 |
-
$(".saswp-nav-menu-list").show();
|
428 |
-
}else{
|
429 |
-
$("#saswp_site_navigation_menu").val(0);
|
430 |
-
$(".saswp-nav-menu-list").hide();
|
431 |
-
}
|
432 |
-
break;
|
433 |
-
|
434 |
-
case 'saswp_comments_schema_checkbox':
|
435 |
-
|
436 |
-
if ($(this).is(':checked')) {
|
437 |
-
$("#saswp_comments_schema").val(1);
|
438 |
-
}else{
|
439 |
-
$("#saswp_comments_schema").val(0);
|
440 |
-
}
|
441 |
-
break;
|
442 |
-
|
443 |
-
case 'saswp-compativility-checkbox':
|
444 |
-
|
445 |
-
if ($(this).is(':checked')) {
|
446 |
-
$("#saswp-flexmlx-compativility").val(1);
|
447 |
-
}else{
|
448 |
-
$("#saswp-flexmlx-compativility").val(0);
|
449 |
-
}
|
450 |
-
break;
|
451 |
-
|
452 |
-
case 'saswp-review-module-checkbox':
|
453 |
-
|
454 |
-
if ($(this).is(':checked')) {
|
455 |
-
$("#saswp-review-module").val(1);
|
456 |
-
}else{
|
457 |
-
$("#saswp-review-module").val(0);
|
458 |
-
}
|
459 |
-
break;
|
460 |
-
|
461 |
-
case 'saswp-kk-star-raring-checkbox':
|
462 |
-
|
463 |
-
saswp_compatibliy_notes(current, id);
|
464 |
-
if ($(this).is(':checked')) {
|
465 |
-
$("#saswp-kk-star-raring").val(1);
|
466 |
-
}else{
|
467 |
-
$("#saswp-kk-star-raring").val(0);
|
468 |
-
}
|
469 |
-
break;
|
470 |
-
case 'saswp-woocommerce-checkbox':
|
471 |
-
saswp_compatibliy_notes(current, id);
|
472 |
-
if ($(this).is(':checked')) {
|
473 |
-
$("#saswp-woocommerce").val(1);
|
474 |
-
}else{
|
475 |
-
$("#saswp-woocommerce").val(0);
|
476 |
-
}
|
477 |
-
break;
|
478 |
-
|
479 |
-
case 'saswp-extra-checkbox':
|
480 |
-
saswp_compatibliy_notes(current, id);
|
481 |
-
if ($(this).is(':checked')) {
|
482 |
-
$("#saswp-extra").val(1);
|
483 |
-
}else{
|
484 |
-
$("#saswp-extra").val(0);
|
485 |
-
}
|
486 |
-
break;
|
487 |
-
|
488 |
-
case 'saswp-dw-question-answer-checkbox':
|
489 |
-
saswp_compatibliy_notes(current, id);
|
490 |
-
if ($(this).is(':checked')) {
|
491 |
-
$("#saswp-dw-question-answer").val(1);
|
492 |
-
}else{
|
493 |
-
$("#saswp-dw-question-answer").val(0);
|
494 |
-
}
|
495 |
-
break;
|
496 |
-
|
497 |
-
case 'saswp-wp-job-manager-checkbox':
|
498 |
-
saswp_compatibliy_notes(current, id);
|
499 |
-
if ($(this).is(':checked')) {
|
500 |
-
$("#saswp-wp-job-manager").val(1);
|
501 |
-
}else{
|
502 |
-
$("#saswp-wp-job-manager").val(0);
|
503 |
-
}
|
504 |
-
break;
|
505 |
-
|
506 |
-
case 'saswp-yoast-checkbox':
|
507 |
-
saswp_compatibliy_notes(current, id);
|
508 |
-
if ($(this).is(':checked')) {
|
509 |
-
$("#saswp-yoast").val(1);
|
510 |
-
}else{
|
511 |
-
$("#saswp-yoast").val(0);
|
512 |
-
}
|
513 |
-
break;
|
514 |
-
|
515 |
-
case 'saswp-rankmath-checkbox':
|
516 |
-
saswp_compatibliy_notes(current, id);
|
517 |
-
if ($(this).is(':checked')) {
|
518 |
-
$("#saswp-rankmath").val(1);
|
519 |
-
}else{
|
520 |
-
$("#saswp-rankmath").val(0);
|
521 |
-
}
|
522 |
-
break;
|
523 |
-
|
524 |
-
case 'saswp-tagyeem-checkbox':
|
525 |
-
saswp_compatibliy_notes(current, id);
|
526 |
-
if ($(this).is(':checked')) {
|
527 |
-
$("#saswp-tagyeem").val(1);
|
528 |
-
}else{
|
529 |
-
$("#saswp-tagyeem").val(0);
|
530 |
-
}
|
531 |
-
break;
|
532 |
-
|
533 |
-
case 'saswp-the-events-calendar-checkbox':
|
534 |
-
saswp_compatibliy_notes(current, id);
|
535 |
-
if ($(this).is(':checked')) {
|
536 |
-
$("#saswp-the-events-calendar").val(1);
|
537 |
-
}else{
|
538 |
-
$("#saswp-the-events-calendar").val(0);
|
539 |
-
}
|
540 |
-
break;
|
541 |
-
|
542 |
-
|
543 |
-
case 'saswp-woocommerce-booking-checkbox':
|
544 |
-
saswp_compatibliy_notes(current, id);
|
545 |
-
if ($(this).is(':checked')) {
|
546 |
-
$("#saswp-woocommerce-booking").val(1);
|
547 |
-
$("#saswp-woocommerce-booking-main").val(1);
|
548 |
-
}else{
|
549 |
-
$("#saswp-woocommerce-booking").val(0);
|
550 |
-
$("#saswp-woocommerce-booking-main").val(0);
|
551 |
-
}
|
552 |
-
break;
|
553 |
-
|
554 |
-
case 'saswp-woocommerce-booking-main-checkbox':
|
555 |
-
saswp_compatibliy_notes(current, id);
|
556 |
-
if ($(this).is(':checked')) {
|
557 |
-
$("#saswp-woocommerce-booking-main").val(1);
|
558 |
-
$("#saswp-woocommerce-booking").val(1);
|
559 |
-
}else{
|
560 |
-
$("#saswp-woocommerce-booking-main").val(0);
|
561 |
-
$("#saswp-woocommerce-booking").val(0);
|
562 |
-
}
|
563 |
-
break;
|
564 |
-
|
565 |
-
case 'saswp-woocommerce-membership-checkbox':
|
566 |
-
saswp_compatibliy_notes(current, id);
|
567 |
-
if ($(this).is(':checked')) {
|
568 |
-
$("#saswp-woocommerce-membership").val(1);
|
569 |
-
}else{
|
570 |
-
$("#saswp-woocommerce-membership").val(0);
|
571 |
-
}
|
572 |
-
break;
|
573 |
-
|
574 |
-
case 'saswp-defragment-checkbox':
|
575 |
-
|
576 |
-
if ($(this).is(':checked')) {
|
577 |
-
$("#saswp-defragment").val(1);
|
578 |
-
}else{
|
579 |
-
$("#saswp-defragment").val(0);
|
580 |
-
}
|
581 |
-
break;
|
582 |
-
|
583 |
-
case 'saswp-cooked-checkbox':
|
584 |
-
saswp_compatibliy_notes(current, id);
|
585 |
-
if ($(this).is(':checked')) {
|
586 |
-
$("#saswp-cooked").val(1);
|
587 |
-
}else{
|
588 |
-
$("#saswp-cooked").val(0);
|
589 |
-
}
|
590 |
-
break;
|
591 |
-
|
592 |
-
case 'saswp-flexmlx-compativility-checkbox':
|
593 |
-
saswp_compatibliy_notes(current, id);
|
594 |
-
if ($(this).is(':checked')) {
|
595 |
-
$("#saswp-flexmlx-compativility").val(1);
|
596 |
-
}else{
|
597 |
-
$("#saswp-flexmlx-compativility").val(0);
|
598 |
-
}
|
599 |
-
break;
|
600 |
-
|
601 |
-
case 'saswp-google-review-checkbox':
|
602 |
-
|
603 |
-
if ($(this).is(':checked')) {
|
604 |
-
$("#saswp-google-review").val(1);
|
605 |
-
$("#saswp_google_place_api_key").parent().parent().show();
|
606 |
-
}else{
|
607 |
-
$("#saswp-google-review").val(0);
|
608 |
-
$("#saswp_google_place_api_key").parent().parent().hide();
|
609 |
-
}
|
610 |
-
break;
|
611 |
-
|
612 |
-
case 'saswp-markup-footer-checkbox':
|
613 |
-
|
614 |
-
if ($(this).is(':checked')) {
|
615 |
-
$("#saswp-markup-footer").val(1);
|
616 |
-
}else{
|
617 |
-
$("#saswp-markup-footer").val(0);
|
618 |
-
}
|
619 |
-
break;
|
620 |
-
|
621 |
-
case 'saswp-pretty-print-checkbox':
|
622 |
-
|
623 |
-
if ($(this).is(':checked')) {
|
624 |
-
$("#saswp-pretty-print").val(1);
|
625 |
-
}else{
|
626 |
-
$("#saswp-pretty-print").val(0);
|
627 |
-
}
|
628 |
-
break;
|
629 |
-
|
630 |
-
case 'saswp-wppostratings-raring-checkbox':
|
631 |
-
saswp_compatibliy_notes(current, id);
|
632 |
-
if ($(this).is(':checked')) {
|
633 |
-
$("#saswp-wppostratings-raring").val(1);
|
634 |
-
}else{
|
635 |
-
$("#saswp-wppostratings-raring").val(0);
|
636 |
-
}
|
637 |
-
break;
|
638 |
-
|
639 |
-
case 'saswp-bbpress-checkbox':
|
640 |
-
saswp_compatibliy_notes(current, id);
|
641 |
-
if ($(this).is(':checked')) {
|
642 |
-
$("#saswp-bbpress").val(1);
|
643 |
-
}else{
|
644 |
-
$("#saswp-bbpress").val(0);
|
645 |
-
}
|
646 |
-
break;
|
647 |
-
|
648 |
-
case 'saswp-microdata-cleanup-checkbox':
|
649 |
-
|
650 |
-
if ($(this).is(':checked')) {
|
651 |
-
$("#saswp-microdata-cleanup").val(1);
|
652 |
-
}else{
|
653 |
-
$("#saswp-microdata-cleanup").val(0);
|
654 |
-
}
|
655 |
-
break;
|
656 |
-
|
657 |
-
|
658 |
-
default:
|
659 |
-
break;
|
660 |
-
}
|
661 |
-
|
662 |
-
}).change();
|
663 |
-
|
664 |
-
$("#saswp_kb_type").change(function(){
|
665 |
-
|
666 |
-
var datatype = $(this).val();
|
667 |
-
|
668 |
-
$(".saswp_org_fields, .saswp_person_fields").parent().parent().addClass('saswp_hide');
|
669 |
-
$(".saswp_kg_logo").parent().parent().parent().addClass('saswp_hide');
|
670 |
-
$("#sd-person-image").parent().parent().parent().addClass('saswp_hide');
|
671 |
-
|
672 |
-
|
673 |
-
if(datatype == 'Organization'){
|
674 |
-
|
675 |
-
$(".saswp_org_fields").parent().parent().removeClass('saswp_hide');
|
676 |
-
$(".saswp_person_fields").parent().parent().addClass('saswp_hide');
|
677 |
-
$(".saswp_kg_logo").parent().parent().parent().removeClass('saswp_hide');
|
678 |
-
$("#sd-person-image").parent().parent().parent().addClass('saswp_hide');
|
679 |
-
}
|
680 |
-
if(datatype == 'Person'){
|
681 |
-
|
682 |
-
$(".saswp_org_fields").parent().parent().addClass('saswp_hide');
|
683 |
-
$(".saswp_person_fields").parent().parent().removeClass('saswp_hide');
|
684 |
-
$(".saswp_kg_logo").parent().parent().parent().removeClass('saswp_hide');
|
685 |
-
$("#sd-person-image").parent().parent().parent().removeClass('saswp_hide');
|
686 |
-
}
|
687 |
-
|
688 |
-
}).change();
|
689 |
-
|
690 |
-
$(document).on("click", "input[data-id=media]" ,function(e) { // Application Icon upload
|
691 |
-
e.preventDefault();
|
692 |
-
var current = $(this);
|
693 |
-
var button = current;
|
694 |
-
var id = button.attr('id').replace('_button', '');
|
695 |
-
var saswpMediaUploader = wp.media({
|
696 |
-
title: "Application Icon",
|
697 |
-
button: {
|
698 |
-
text: "Select Icon"
|
699 |
-
},
|
700 |
-
multiple: false, // Set this to true to allow multiple files to be selected
|
701 |
-
library:{type : 'image'}
|
702 |
-
})
|
703 |
-
.on("select", function() {
|
704 |
-
var attachment = saswpMediaUploader.state().get('selection').first().toJSON();
|
705 |
-
|
706 |
-
$("#"+id).val(attachment.url);
|
707 |
-
$("input[data-id='"+id+"_id']").val(attachment.id);
|
708 |
-
$("input[data-id='"+id+"_height']").val(attachment.height);
|
709 |
-
$("input[data-id='"+id+"_width']").val(attachment.width);
|
710 |
-
$("input[data-id='"+id+"_thumbnail']").val(attachment.url);
|
711 |
-
|
712 |
-
if(current.attr('id') === 'sd_default_image_button'){
|
713 |
-
|
714 |
-
$("#sd_default_image_width").val(attachment.width);
|
715 |
-
$("#sd_default_image_height").val(attachment.height);
|
716 |
-
|
717 |
-
}
|
718 |
-
$(".saswp_image_div_"+id).html('<div class="saswp_image_thumbnail"><img class="saswp_image_prev" src="'+attachment.url+'"/><a data-id="'+id+'" href="#" class="saswp_prev_close">X</a></div>');
|
719 |
-
|
720 |
-
})
|
721 |
-
.open();
|
722 |
-
});
|
723 |
-
|
724 |
-
$(document).on("click", ".saswp_prev_close", function(e){
|
725 |
-
e.preventDefault();
|
726 |
-
|
727 |
-
var id = $(this).attr('data-id');
|
728 |
-
console.log(id);
|
729 |
-
$(this).parent().remove();
|
730 |
-
$("#"+id).val('');
|
731 |
-
$("input[data-id='"+id+"_id']").val('');
|
732 |
-
$("input[data-id='"+id+"_height']").val('');
|
733 |
-
$("input[data-id='"+id+"_width']").val('');
|
734 |
-
$("input[data-id='"+id+"_thumbnail']").val('');
|
735 |
-
|
736 |
-
if(id === 'sd_default_image'){
|
737 |
-
|
738 |
-
$("#sd_default_image_width").val('');
|
739 |
-
$("#sd_default_image_height").val('');
|
740 |
-
|
741 |
-
}
|
742 |
-
|
743 |
-
|
744 |
-
});
|
745 |
-
|
746 |
-
//Settings page jquery ends here
|
747 |
-
|
748 |
-
|
749 |
-
$(document).on("change",".saswp-schema-type-toggle", function(e){
|
750 |
-
var schema_id = $(this).attr("data-schema-id");
|
751 |
-
var post_id = $(this).attr("data-post-id");
|
752 |
-
if($(this).is(':checked')){
|
753 |
-
var status = 1;
|
754 |
-
}else{
|
755 |
-
var status = 0;
|
756 |
-
}
|
757 |
-
$.ajax({
|
758 |
-
type: "POST",
|
759 |
-
url:ajaxurl,
|
760 |
-
dataType: "json",
|
761 |
-
data:{action:"saswp_enable_disable_schema_on_post",status:status, schema_id:schema_id, post_id:post_id, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
|
762 |
-
success:function(response){
|
763 |
-
},
|
764 |
-
error: function(response){
|
765 |
-
console.log(response);
|
766 |
-
}
|
767 |
-
});
|
768 |
-
|
769 |
-
});
|
770 |
-
|
771 |
-
|
772 |
-
$(document).on("click",".saswp-reset-data", function(e){
|
773 |
-
e.preventDefault();
|
774 |
-
|
775 |
-
var saswp_confirm = confirm("Are you sure?");
|
776 |
-
|
777 |
-
if(saswp_confirm == true){
|
778 |
-
|
779 |
-
$.ajax({
|
780 |
-
type: "POST",
|
781 |
-
url:ajaxurl,
|
782 |
-
dataType: "json",
|
783 |
-
data:{action:"saswp_reset_all_settings", saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
|
784 |
-
success:function(response){
|
785 |
-
setTimeout(function(){ location.reload(); }, 1000);
|
786 |
-
},
|
787 |
-
error: function(response){
|
788 |
-
console.log(response);
|
789 |
-
}
|
790 |
-
});
|
791 |
-
|
792 |
-
}
|
793 |
-
|
794 |
-
|
795 |
-
});
|
796 |
-
|
797 |
-
//Licensing jquery starts here
|
798 |
-
$(document).on("click",".saswp_license_activation", function(e){
|
799 |
-
e.preventDefault();
|
800 |
-
|
801 |
-
var license_status = $(this).attr('license-status');
|
802 |
-
var add_on = $(this).attr('add-on');
|
803 |
-
var license_key = $("#"+add_on+"_addon_license_key").val();
|
804 |
-
|
805 |
-
if(license_status && add_on && license_key){
|
806 |
-
|
807 |
-
$.ajax({
|
808 |
-
type: "POST",
|
809 |
-
url:ajaxurl,
|
810 |
-
dataType: "json",
|
811 |
-
data:{action:"saswp_license_status_check",license_key:license_key,license_status:license_status, add_on:add_on, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
|
812 |
-
success:function(response){
|
813 |
-
|
814 |
-
$("#"+add_on+"_addon_license_key_status").val(response['status']);
|
815 |
-
|
816 |
-
if(response['status'] =='active'){
|
817 |
-
$(".saswp-"+add_on+"-dashicons").addClass('dashicons-yes');
|
818 |
-
$(".saswp-"+add_on+"-dashicons").removeClass('dashicons-no-alt');
|
819 |
-
$(".saswp-"+add_on+"-dashicons").css("color", "green");
|
820 |
-
|
821 |
-
$(".saswp_license_activation[add-on='" + add_on + "']").attr("license-status", "inactive");
|
822 |
-
$(".saswp_license_activation[add-on='" + add_on + "']").text("Deactivate");
|
823 |
-
|
824 |
-
$(".saswp_license_status_msg[add-on='" + add_on + "']").text('Activated');
|
825 |
-
|
826 |
-
$(".saswp_license_status_msg[add-on='" + add_on + "']").css("color", "green");
|
827 |
-
$(".saswp_license_status_msg[add-on='" + add_on + "']").text(response['message']);
|
828 |
-
|
829 |
-
}else{
|
830 |
-
|
831 |
-
$(".saswp-"+add_on+"-dashicons").addClass('dashicons-no-alt');
|
832 |
-
$(".saswp-"+add_on+"-dashicons").removeClass('dashicons-yes');
|
833 |
-
$(".saswp-"+add_on+"-dashicons").css("color", "red");
|
834 |
-
|
835 |
-
$(".saswp_license_activation[add-on='" + add_on + "']").attr("license-status", "active");
|
836 |
-
$(".saswp_license_activation[add-on='" + add_on + "']").text("Activate");
|
837 |
-
|
838 |
-
$(".saswp_license_status_msg[add-on='" + add_on + "']").css("color", "red");
|
839 |
-
$(".saswp_license_status_msg[add-on='" + add_on + "']").text(response['message']);
|
840 |
-
}
|
841 |
-
|
842 |
-
},
|
843 |
-
error: function(response){
|
844 |
-
console.log(response);
|
845 |
-
}
|
846 |
-
});
|
847 |
-
|
848 |
-
}
|
849 |
-
|
850 |
-
});
|
851 |
-
//Licensing jquery ends here
|
852 |
-
//query form send starts here
|
853 |
-
|
854 |
-
$(".saswp-send-query").on("click", function(e){
|
855 |
-
e.preventDefault();
|
856 |
-
var message = $("#saswp_query_message").val();
|
857 |
-
if($.trim(message) !=''){
|
858 |
-
$.ajax({
|
859 |
-
type: "POST",
|
860 |
-
url:ajaxurl,
|
861 |
-
dataType: "json",
|
862 |
-
data:{action:"saswp_send_query_message", message:message, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
|
863 |
-
success:function(response){
|
864 |
-
if(response['status'] =='t'){
|
865 |
-
$(".saswp-query-success").show();
|
866 |
-
$(".saswp-query-error").hide();
|
867 |
-
}else{
|
868 |
-
console.log('dd');
|
869 |
-
$(".saswp-query-success").hide();
|
870 |
-
$(".saswp-query-error").show();
|
871 |
-
}
|
872 |
-
},
|
873 |
-
error: function(response){
|
874 |
-
console.log(response);
|
875 |
-
}
|
876 |
-
});
|
877 |
-
}else{
|
878 |
-
alert('Please enter the message');
|
879 |
-
}
|
880 |
-
|
881 |
-
});
|
882 |
-
|
883 |
-
//Importer from schema plugin starts here
|
884 |
-
|
885 |
-
$(".saswp-import-plugins").on("click", function(e){
|
886 |
-
e.preventDefault();
|
887 |
-
var current_selection = $(this);
|
888 |
-
current_selection.addClass('updating-message');
|
889 |
-
var plugin_name = $(this).attr('data-id');
|
890 |
-
$.get(ajaxurl,
|
891 |
-
{ action:"saswp_import_plugin_data", plugin_name:plugin_name, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
|
892 |
-
function(response){
|
893 |
-
if(response['status'] =='t'){
|
894 |
-
$(current_selection).parent().find(".saswp-imported-message").text(response['message']);
|
895 |
-
$(current_selection).parent().find(".saswp-imported-message").removeClass('saswp-error');
|
896 |
-
setTimeout(function(){ location.reload(); }, 2000);
|
897 |
-
}else{
|
898 |
-
$(current_selection).parent().find(".saswp-imported-message").addClass('saswp-error');
|
899 |
-
$(current_selection).parent().find(".saswp-imported-message").text(response['message']);
|
900 |
-
}
|
901 |
-
current_selection.removeClass('updating-message');
|
902 |
-
},'json');
|
903 |
-
});
|
904 |
-
|
905 |
-
|
906 |
-
$(".saswp-feedback-no-thanks").on("click", function(e){
|
907 |
-
e.preventDefault();
|
908 |
-
$.get(ajaxurl,
|
909 |
-
{ action:"saswp_feeback_no_thanks"},
|
910 |
-
function(response){
|
911 |
-
if(response['status'] =='t'){
|
912 |
-
$(".saswp-feedback-notice").hide();
|
913 |
-
}
|
914 |
-
},'json');
|
915 |
-
});
|
916 |
-
|
917 |
-
$(".saswp-feedback-remindme").on("click", function(e){
|
918 |
-
e.preventDefault();
|
919 |
-
$.get(ajaxurl,
|
920 |
-
{ action:"saswp_feeback_remindme"},
|
921 |
-
function(response){
|
922 |
-
if(response['status'] =='t'){
|
923 |
-
$(".saswp-feedback-notice").hide();
|
924 |
-
}
|
925 |
-
},'json');
|
926 |
-
});
|
927 |
-
|
928 |
-
$(document).on("change",'.saswp-local-business-type-select', function(e){
|
929 |
-
e.preventDefault();
|
930 |
-
var current = $(this);
|
931 |
-
var business_type = $(this).val();
|
932 |
-
$.get(ajaxurl,
|
933 |
-
{ action:"saswp_get_sub_business_ajax", business_type:business_type, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
|
934 |
-
function(response){
|
935 |
-
|
936 |
-
if(response['status'] =='t'){
|
937 |
-
$(".saswp-local-business-name-select").parents('tr').remove();
|
938 |
-
var schema_id = current.parents('.saswp-post-specific-wrapper').attr('data-id');
|
939 |
-
var html ='<tr><th><label for="saswp_business_name_'+schema_id+'">Sub Business Type</label></th>';
|
940 |
-
html +='<td><select class="saswp-local-business-name-select" id="saswp_business_name_'+schema_id+'" name="saswp_business_name_'+schema_id+'">';
|
941 |
-
$.each(response['result'], function(index, element){
|
942 |
-
html +='<option value="'+index+'">'+element+'</option>';
|
943 |
-
});
|
944 |
-
html +='</select></td>';
|
945 |
-
html +='</tr>';
|
946 |
-
current.parents('.form-table tr:first').after(html);
|
947 |
-
}else{
|
948 |
-
$(".saswp-local-business-name-select").parents('tr').remove();
|
949 |
-
}
|
950 |
-
},'json');
|
951 |
-
});
|
952 |
-
|
953 |
-
|
954 |
-
function saswp_item_reviewed_call(){
|
955 |
-
|
956 |
-
$(".saswp-item-reviewed").change(function(e){
|
957 |
-
e.preventDefault();
|
958 |
-
var schema_type ="";
|
959 |
-
|
960 |
-
if($('select#schema_type option:selected').val()){
|
961 |
-
schema_type = $('select#schema_type option:selected').val();
|
962 |
-
}
|
963 |
-
if($(".saswp-tab-links.selected").attr('saswp-schema-type')){
|
964 |
-
schema_type = $(".saswp-tab-links.selected").attr('saswp-schema-type');
|
965 |
-
}
|
966 |
-
|
967 |
-
if(schema_type === 'Review'){
|
968 |
-
|
969 |
-
var current = $(this);
|
970 |
-
var item = $(this).val();
|
971 |
-
var post_id = saswp_localize_data.post_id;
|
972 |
-
var schema_id = $(current).attr('data-id');
|
973 |
-
var post_specific = $(current).attr('post-specific');
|
974 |
-
$.get(ajaxurl,
|
975 |
-
{ action:"saswp_get_item_reviewed_fields",schema_id:schema_id, post_specific:post_specific ,item:item, post_id:post_id, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
|
976 |
-
function(response){
|
977 |
-
|
978 |
-
$(current).parent().parent().nextAll().remove(".saswp-review-tr");
|
979 |
-
$(current).parent().parent().after(response);
|
980 |
-
|
981 |
-
});
|
982 |
-
|
983 |
-
}
|
984 |
-
|
985 |
-
|
986 |
-
}).change();
|
987 |
-
|
988 |
-
}
|
989 |
-
saswp_item_reviewed_call();
|
990 |
-
|
991 |
-
function saswpAddTimepicker(){
|
992 |
-
$('.saswp-local-schema-time-picker').timepicker({ 'timeFormat': 'H:i:s'});
|
993 |
-
}
|
994 |
-
$('.saswp-local-schema-time-picker').timepicker({ 'timeFormat': 'H:i:s'});
|
995 |
-
|
996 |
-
$(document).on("click",".saswp-add-custom-schema", function(e){
|
997 |
-
|
998 |
-
e.preventDefault();
|
999 |
-
|
1000 |
-
$(".saswp-add-custom-schema-field").removeClass('saswp_hide');
|
1001 |
-
$(this).hide();
|
1002 |
-
|
1003 |
-
});
|
1004 |
-
|
1005 |
-
$(document).on("click", ".saswp-delete-custom-schema", function(e){
|
1006 |
-
|
1007 |
-
e.preventDefault();
|
1008 |
-
|
1009 |
-
$("#saswp_custom_schema_field").val('');
|
1010 |
-
$(".saswp-add-custom-schema-field").addClass('saswp_hide');
|
1011 |
-
$(".saswp-add-custom-schema").show();
|
1012 |
-
|
1013 |
-
});
|
1014 |
-
|
1015 |
-
$(".saswp-modify_schema_post_enable").on("click", function(e){
|
1016 |
-
var current = $(this);
|
1017 |
-
current.addClass('updating-message');
|
1018 |
-
e.preventDefault();
|
1019 |
-
$.get(ajaxurl,
|
1020 |
-
{ action:"saswp_modify_schema_post_enable", post_id: saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
|
1021 |
-
function(response){
|
1022 |
-
current.remove();
|
1023 |
-
$(".saswp-add-custom-schema-div").remove();
|
1024 |
-
$("#post_specific .inside").append(response);
|
1025 |
-
current.removeClass('updating-message');
|
1026 |
-
saswpAddTimepicker();
|
1027 |
-
saswp_schema_datepicker();
|
1028 |
-
saswp_enable_rating_review();
|
1029 |
-
saswp_item_reviewed_call();
|
1030 |
-
});
|
1031 |
-
|
1032 |
-
});
|
1033 |
-
saswp_schema_datepicker();
|
1034 |
-
function saswp_schema_datepicker(){
|
1035 |
-
|
1036 |
-
$('.saswp-local-schema-datepicker-picker').datepicker({
|
1037 |
-
dateFormat: "yy-mm-dd",
|
1038 |
-
minDate: 0
|
1039 |
-
});
|
1040 |
-
}
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
//Review js starts here
|
1045 |
-
|
1046 |
-
$(document).on("click", ".saswp-add-more-item",function(e){
|
1047 |
-
e.preventDefault();
|
1048 |
-
var rows = $('.saswp-review-item-list-table tr').length;
|
1049 |
-
console.log(rows);
|
1050 |
-
var html = '<tr class="saswp-review-item-tr">';
|
1051 |
-
html += '<td>Review Item Feature</td>';
|
1052 |
-
html += '<td><input type="text" name="saswp-review-item-feature[]"></td>';
|
1053 |
-
html += '<td>Rating</td>';
|
1054 |
-
html += '<td><input step="0.1" min="0" max="5" type="number" name="saswp-review-item-star-rating[]"></td>';
|
1055 |
-
html += '<td><a type="button" class="saswp-remove-review-item button">x</a></td>';
|
1056 |
-
html += '</tr>';
|
1057 |
-
$(".saswp-review-item-list-table").append(html);
|
1058 |
-
|
1059 |
-
});
|
1060 |
-
|
1061 |
-
$(document).on("click", ".saswp-remove-review-item", function(e){
|
1062 |
-
e.preventDefault();
|
1063 |
-
$(this).parent().parent('tr').remove();
|
1064 |
-
});
|
1065 |
-
|
1066 |
-
$(document).on("focusout", ".saswp-review-item-tr input[type=number]", function(e){
|
1067 |
-
e.preventDefault();
|
1068 |
-
var total_rating = 0;
|
1069 |
-
var element_count = $(".saswp-review-item-tr input[type=number]").length;
|
1070 |
-
$(".saswp-review-item-tr input[type=number]").each(function(index, element){
|
1071 |
-
if($(element).val() ==''){
|
1072 |
-
total_rating += parseFloat(0);
|
1073 |
-
}else{
|
1074 |
-
total_rating += parseFloat($(element).val());
|
1075 |
-
}
|
1076 |
-
|
1077 |
-
});
|
1078 |
-
var over_all_rating = total_rating / element_count;
|
1079 |
-
$("#saswp-review-item-over-all").val(over_all_rating);
|
1080 |
-
});
|
1081 |
-
|
1082 |
-
$("#saswp-review-location").change(function(){
|
1083 |
-
var location = $(this).val();
|
1084 |
-
$(".saswp-review-shortcode").addClass('saswp_hide');
|
1085 |
-
if(location == 3){
|
1086 |
-
$(".saswp-review-shortcode").removeClass('saswp_hide');
|
1087 |
-
}
|
1088 |
-
}).change();
|
1089 |
-
|
1090 |
-
$("#saswp-review-item-enable").change(function(){
|
1091 |
-
if ($(this).is(':checked')) {
|
1092 |
-
$(".saswp-review-fields").show();
|
1093 |
-
}else{
|
1094 |
-
$(".saswp-review-fields").hide();
|
1095 |
-
}
|
1096 |
-
}).change();
|
1097 |
-
|
1098 |
-
$(document).on("click", ".saswp-restore-post-schema", function(e){
|
1099 |
-
e.preventDefault();
|
1100 |
-
var current = $(this);
|
1101 |
-
current.addClass('updating-message');
|
1102 |
-
|
1103 |
-
if($(".saswp-post-specific-schema-ids").val()){
|
1104 |
-
var schema_ids = JSON.parse($(".saswp-post-specific-schema-ids").val());
|
1105 |
-
}
|
1106 |
-
|
1107 |
-
$.post(ajaxurl,
|
1108 |
-
{ action:"saswp_restore_schema", schema_ids:schema_ids,post_id: saswp_localize_data.post_id, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
|
1109 |
-
function(response){
|
1110 |
-
if(response['status'] =='t'){
|
1111 |
-
setTimeout(function(){ location.reload(); }, 1000);
|
1112 |
-
}else{
|
1113 |
-
alert(response['msg']);
|
1114 |
-
setTimeout(function(){ location.reload(); }, 1000);
|
1115 |
-
}
|
1116 |
-
current.removeClass('updating-message');
|
1117 |
-
},'json');
|
1118 |
-
});
|
1119 |
-
|
1120 |
-
//Review js ends here
|
1121 |
-
|
1122 |
-
$(document).on("click","div.saswp-tab ul.saswp-tab-nav a", function(e){
|
1123 |
-
e.preventDefault();
|
1124 |
-
var attr = $(this).attr('data-id');
|
1125 |
-
$(".saswp-post-specific-wrapper").hide();
|
1126 |
-
$("#"+attr).show();
|
1127 |
-
$('div.saswp-tab ul.saswp-tab-nav a').removeClass('selected');
|
1128 |
-
$('div.saswp-tab ul.saswp-tab-nav li').removeClass('selected');
|
1129 |
-
$(this).addClass('selected');
|
1130 |
-
$(this).parent().addClass('selected');
|
1131 |
-
saswp_enable_rating_review();
|
1132 |
-
});
|
1133 |
-
|
1134 |
-
|
1135 |
-
$('#saswp-global-tabs a:first').addClass('saswp-global-selected');
|
1136 |
-
$('.saswp-global-container').hide();
|
1137 |
-
$('.saswp-global-container:first').show();
|
1138 |
-
|
1139 |
-
$('#saswp-global-tabs a').click(function(){
|
1140 |
-
var t = $(this).attr('data-id');
|
1141 |
-
|
1142 |
-
if(!$(this).hasClass('saswp-global-selected')){
|
1143 |
-
$('#saswp-global-tabs a').removeClass('saswp-global-selected');
|
1144 |
-
$(this).addClass('saswp-global-selected');
|
1145 |
-
|
1146 |
-
$('.saswp-global-container').hide();
|
1147 |
-
$('#'+t).show();
|
1148 |
-
}
|
1149 |
-
});
|
1150 |
-
|
1151 |
-
//Importer from schema plugin ends here
|
1152 |
-
|
1153 |
-
//custom fields modify schema starts here
|
1154 |
-
|
1155 |
-
//Changing the url of add new schema type
|
1156 |
-
$('a[href="'+saswp_localize_data.new_url_selector+'"]').attr( 'href', saswp_localize_data.new_url_href);
|
1157 |
-
|
1158 |
-
|
1159 |
-
$("#saswp_enable_custom_field").change(function(){
|
1160 |
-
if ($(this).is(':checked')) {
|
1161 |
-
$(".saswp-custom-fields-div").show();
|
1162 |
-
}else{
|
1163 |
-
$(".saswp-custom-fields-div").hide();
|
1164 |
-
}
|
1165 |
-
});
|
1166 |
-
$(document).on('change','.saswp-custom-fields-name',function(){
|
1167 |
-
|
1168 |
-
$(this).parent().parent('tr').find("td:eq(1)").html('');
|
1169 |
-
var field_name = $(this).val();
|
1170 |
-
var html = '';
|
1171 |
-
html += '<select class="saswp-custom-fields-select2" name="saswp_custom_fields['+field_name+']">';
|
1172 |
-
html += '</select>';
|
1173 |
-
$(this).parent().parent('tr').find("td:eq(1)").html(html);
|
1174 |
-
saswpCustomSelect2();
|
1175 |
-
} );
|
1176 |
-
|
1177 |
-
|
1178 |
-
$(document).on("click", '.saswp-skip-button', function(e){
|
1179 |
-
e.preventDefault();
|
1180 |
-
$(this).parent().parent().hide();
|
1181 |
-
|
1182 |
-
$.post(ajaxurl,
|
1183 |
-
{ action:"saswp_skip_wizard", saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
|
1184 |
-
function(response){
|
1185 |
-
|
1186 |
-
},'json');
|
1187 |
-
|
1188 |
-
});
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
//Trip schema starts here
|
1193 |
-
|
1194 |
-
$(document).on("click", ".saswp-trip-itinerary", function(e){
|
1195 |
-
e.preventDefault();
|
1196 |
-
|
1197 |
-
var schema_id = $(this).attr('data-id');
|
1198 |
-
var count = $(".saswp-trip-itinerary-table-div").length;
|
1199 |
-
var index = $( ".saswp-trip-itinerary-table-div:nth-child("+count+")" ).attr('data-id');
|
1200 |
-
index = ++index;
|
1201 |
-
|
1202 |
-
if(!index){
|
1203 |
-
index = 0;
|
1204 |
-
}
|
1205 |
-
|
1206 |
-
var html = '';
|
1207 |
-
|
1208 |
-
html += '<div class="saswp-trip-itinerary-table-div" data-id="'+index+'">'
|
1209 |
-
+ '<a class="saswp-table-close">X</a>'
|
1210 |
-
+ '<table class="form-table saswp-trip-itinerary-table">'
|
1211 |
-
|
1212 |
-
+ '<tr>'
|
1213 |
-
+ '<th>Itinerary Type</th>'
|
1214 |
-
+ '<td>'
|
1215 |
-
+ '<select id="saswp_trip_itinerary_type_'+index+'_'+schema_id+'" name="trip_itinerary_'+schema_id+'['+index+'][saswp_trip_itinerary_type]">'
|
1216 |
-
+ '<option value="City">City</option>'
|
1217 |
-
+ '<option value="LandmarksOrHistoricalBuildings">LandmarksOrHistoricalBuildings</option>'
|
1218 |
-
+ '<option value="AdministrativeArea">AdministrativeArea</option>'
|
1219 |
-
+ '<option value="LakeBodyOfWater">LakeBodyOfWater</option>'
|
1220 |
-
+ '</select></td>'
|
1221 |
-
+ '</tr>'
|
1222 |
-
|
1223 |
-
+ '<tr>'
|
1224 |
-
+ '<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>'
|
1225 |
-
+ '</tr>'
|
1226 |
-
|
1227 |
-
+ '<tr>'
|
1228 |
-
+ '<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>'
|
1229 |
-
+ '</tr>'
|
1230 |
-
|
1231 |
-
+ '<tr>'
|
1232 |
-
+ '<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>'
|
1233 |
-
+ '</tr>'
|
1234 |
-
|
1235 |
-
+ '</table>'
|
1236 |
-
+ '</div>';
|
1237 |
-
if(html){
|
1238 |
-
$('.saswp-trip-itinerary-section[data-id="'+schema_id+'"]').append(html);
|
1239 |
-
}
|
1240 |
-
|
1241 |
-
|
1242 |
-
});
|
1243 |
-
|
1244 |
-
//Trip schema ends here
|
1245 |
-
|
1246 |
-
//TvSeries schema starts here
|
1247 |
-
|
1248 |
-
$(document).on("click", ".saswp-tvseries-actor", function(e){
|
1249 |
-
e.preventDefault();
|
1250 |
-
|
1251 |
-
var schema_id = $(this).attr('data-id');
|
1252 |
-
var count = $(".saswp-tvseries-actor-table-div").length;
|
1253 |
-
var index = $( ".saswp-tvseries-actor-table-div:nth-child("+count+")" ).attr('data-id');
|
1254 |
-
index = ++index;
|
1255 |
-
|
1256 |
-
if(!index){
|
1257 |
-
index = 0;
|
1258 |
-
}
|
1259 |
-
|
1260 |
-
var html = '';
|
1261 |
-
|
1262 |
-
html += '<div class="saswp-tvseries-actor-table-div" data-id="'+index+'">'
|
1263 |
-
+ '<a class="saswp-table-close">X</a>'
|
1264 |
-
+ '<table class="form-table saswp-tvseries-actor-table">'
|
1265 |
-
+ '<tr>'
|
1266 |
-
+ '<th>Actor Name</th><td><input style="width:100%" type="text" id="saswp_tvseries_actor_name_'+index+'_'+schema_id+'" name="tvseries_actor_'+schema_id+'['+index+'][saswp_tvseries_actor_name]"></td>'
|
1267 |
-
+ '</tr>'
|
1268 |
-
+ '</table>'
|
1269 |
-
+ '</div>';
|
1270 |
-
if(html){
|
1271 |
-
$('.saswp-tvseries-actor-section[data-id="'+schema_id+'"]').append(html);
|
1272 |
-
}
|
1273 |
-
|
1274 |
-
|
1275 |
-
});
|
1276 |
-
|
1277 |
-
$(document).on("click", ".saswp-tvseries-season", function(e){
|
1278 |
-
e.preventDefault();
|
1279 |
-
|
1280 |
-
var schema_id = $(this).attr('data-id');
|
1281 |
-
var count = $(".saswp-tvseries-season-table-div").length;
|
1282 |
-
var index = $( ".saswp-tvseries-season-table-div:nth-child("+count+")" ).attr('data-id');
|
1283 |
-
index = ++index;
|
1284 |
-
|
1285 |
-
if(!index){
|
1286 |
-
index = 0;
|
1287 |
-
}
|
1288 |
-
|
1289 |
-
var html = '';
|
1290 |
-
|
1291 |
-
html += '<div class="saswp-tvseries-season-table-div" data-id="'+index+'">'
|
1292 |
-
+ '<a class="saswp-table-close">X</a>'
|
1293 |
-
+ '<table class="form-table saswp-tvseries-season-table">'
|
1294 |
-
+ '<tr>'
|
1295 |
-
+ '<th>Season</th><td><input style="width:100%" type="text" id="saswp_tvseries_season_name_'+index+'_'+schema_id+'" name="tvseries_season_'+schema_id+'['+index+'][saswp_tvseries_season_name]"></td>'
|
1296 |
-
+ '</tr>'
|
1297 |
-
+ '<tr>'
|
1298 |
-
+ '<th>Season Published Date</th><td><input class="saswp-local-schema-datepicker-picker" style="width:100%" type="text" id="saswp_tvseries_season_published_date_'+index+'_'+schema_id+'" name="tvseries_season_'+schema_id+'['+index+'][saswp_tvseries_season_published_date]"></td>'
|
1299 |
-
+ '</tr>'
|
1300 |
-
+ '<tr>'
|
1301 |
-
+ '<th>Number Of Episodes</th><td><input style="width:100%" type="text" id="saswp_tvseries_season_episodes_'+index+'_'+schema_id+'" name="tvseries_season_'+schema_id+'['+index+'][saswp_tvseries_season_episodes]"></td>'
|
1302 |
-
+ '</tr>'
|
1303 |
-
+ '</table>'
|
1304 |
-
+ '</div>';
|
1305 |
-
if(html){
|
1306 |
-
|
1307 |
-
$('.saswp-tvseries-season-section[data-id="'+schema_id+'"]').append(html);
|
1308 |
-
saswp_schema_datepicker();
|
1309 |
-
|
1310 |
-
}
|
1311 |
-
|
1312 |
-
|
1313 |
-
});
|
1314 |
-
|
1315 |
-
//TvSeries schema ends here
|
1316 |
-
|
1317 |
-
//Medical condition schema starts here
|
1318 |
-
|
1319 |
-
$(document).on("click", ".saswp-mc-cause", function(e){
|
1320 |
-
e.preventDefault();
|
1321 |
-
|
1322 |
-
var schema_id = $(this).attr('data-id');
|
1323 |
-
var count = $(".saswp-mc-cause-table-div").length;
|
1324 |
-
var index = $( ".saswp-mc-cause-table-div:nth-child("+count+")" ).attr('data-id');
|
1325 |
-
index = ++index;
|
1326 |
-
|
1327 |
-
if(!index){
|
1328 |
-
index = 0;
|
1329 |
-
}
|
1330 |
-
|
1331 |
-
var html = '';
|
1332 |
-
|
1333 |
-
html += '<div class="saswp-mc-cause-table-div" data-id="'+index+'">'
|
1334 |
-
+ '<a class="saswp-table-close">X</a>'
|
1335 |
-
+ '<table class="form-table saswp-mc-cause-table">'
|
1336 |
-
+ '<tr>'
|
1337 |
-
+ '<th>Cause</th><td><input style="width:100%" type="text" id="saswp_mc_cause_name_'+index+'_'+schema_id+'" name="mc_cause_'+schema_id+'['+index+'][saswp_mc_cause_name]"></td>'
|
1338 |
-
+ '</tr>'
|
1339 |
-
+ '</table>'
|
1340 |
-
+ '</div>';
|
1341 |
-
if(html){
|
1342 |
-
$('.saswp-mc-cause-section[data-id="'+schema_id+'"]').append(html);
|
1343 |
-
}
|
1344 |
-
|
1345 |
-
|
1346 |
-
});
|
1347 |
-
|
1348 |
-
$(document).on("click", ".saswp-mc-symptom", function(e){
|
1349 |
-
e.preventDefault();
|
1350 |
-
|
1351 |
-
var schema_id = $(this).attr('data-id');
|
1352 |
-
var count = $(".saswp-mc-symptom-table-div").length;
|
1353 |
-
var index = $( ".saswp-mc-symptom-table-div:nth-child("+count+")" ).attr('data-id');
|
1354 |
-
index = ++index;
|
1355 |
-
|
1356 |
-
if(!index){
|
1357 |
-
index = 0;
|
1358 |
-
}
|
1359 |
-
|
1360 |
-
var html = '';
|
1361 |
-
|
1362 |
-
html += '<div class="saswp-mc-symptom-table-div" data-id="'+index+'">'
|
1363 |
-
+ '<a class="saswp-table-close">X</a>'
|
1364 |
-
+ '<table class="form-table saswp-mc-symptom-table">'
|
1365 |
-
+ '<tr>'
|
1366 |
-
+ '<th>Symptom Name</th><td><input style="width:100%" type="text" id="saswp_mc_symptom_name_'+index+'_'+schema_id+'" name="mc_symptom_'+schema_id+'['+index+'][saswp_mc_symptom_name]"></td>'
|
1367 |
-
+ '</tr>'
|
1368 |
-
+ '</table>'
|
1369 |
-
+ '</div>';
|
1370 |
-
if(html){
|
1371 |
-
$('.saswp-mc-symptom-section[data-id="'+schema_id+'"]').append(html);
|
1372 |
-
}
|
1373 |
-
|
1374 |
-
|
1375 |
-
});
|
1376 |
-
|
1377 |
-
$(document).on("click", ".saswp-mc-risk_factor", function(e){
|
1378 |
-
e.preventDefault();
|
1379 |
-
|
1380 |
-
var schema_id = $(this).attr('data-id');
|
1381 |
-
var count = $(".saswp-mc-risk_factor-table-div").length;
|
1382 |
-
var index = $( ".saswp-mc-risk_factor-table-div:nth-child("+count+")" ).attr('data-id');
|
1383 |
-
index = ++index;
|
1384 |
-
|
1385 |
-
if(!index){
|
1386 |
-
index = 0;
|
1387 |
-
}
|
1388 |
-
|
1389 |
-
var html = '';
|
1390 |
-
|
1391 |
-
html += '<div class="saswp-mc-risk_factor-table-div" data-id="'+index+'">'
|
1392 |
-
+ '<a class="saswp-table-close">X</a>'
|
1393 |
-
+ '<table class="form-table saswp-mc-risk_factor-table">'
|
1394 |
-
+ '<tr>'
|
1395 |
-
+ '<th>Risk Factor Name</th><td><input style="width:100%" type="text" id="saswp_mc_risk_factor_name_'+index+'_'+schema_id+'" name="mc_risk_factor_'+schema_id+'['+index+'][saswp_mc_risk_factor_name]"></td>'
|
1396 |
-
+ '</tr>'
|
1397 |
-
+ '</table>'
|
1398 |
-
+ '</div>';
|
1399 |
-
if(html){
|
1400 |
-
$('.saswp-mc-risk_factor-section[data-id="'+schema_id+'"]').append(html);
|
1401 |
-
}
|
1402 |
-
|
1403 |
-
|
1404 |
-
});
|
1405 |
-
|
1406 |
-
//Medical condition schema ends here
|
1407 |
-
|
1408 |
-
//How to schema js starts here
|
1409 |
-
|
1410 |
-
$(document).on("click", ".saswp-how-to-supply", function(e){
|
1411 |
-
e.preventDefault();
|
1412 |
-
|
1413 |
-
var schema_id = $(this).attr('data-id');
|
1414 |
-
var count = $(".saswp-how-to-supply-table-div").length;
|
1415 |
-
var index = $( ".saswp-how-to-supply-table-div:nth-child("+count+")" ).attr('data-id');
|
1416 |
-
index = ++index;
|
1417 |
-
|
1418 |
-
if(!index){
|
1419 |
-
index = 0;
|
1420 |
-
}
|
1421 |
-
|
1422 |
-
var html = '';
|
1423 |
-
|
1424 |
-
html += '<div class="saswp-how-to-supply-table-div" data-id="'+index+'">'
|
1425 |
-
+ '<a class="saswp-table-close">X</a>'
|
1426 |
-
+ '<table class="form-table saswp-how-to-supply-table">'
|
1427 |
-
+ '<tr>'
|
1428 |
-
+ '<th>Supply Name</th><td><input style="width:100%" type="text" id="saswp_howto_supply_name_'+index+'_'+schema_id+'" name="howto_supply_'+schema_id+'['+index+'][saswp_howto_supply_name]"></td>'
|
1429 |
-
+ '</tr>'
|
1430 |
-
+ '<tr>'
|
1431 |
-
+ '<th>Supply Image</th>'
|
1432 |
-
+ '<td>'
|
1433 |
-
+ '<fieldset>'
|
1434 |
-
+ '<input style="width:80%" type="text" id="saswp_howto_supply_image_'+index+'_'+schema_id+'" name="saswp_howto_supply_image_'+index+'_'+schema_id+'">'
|
1435 |
-
+ '<input type="hidden" data-id="saswp_howto_supply_image_'+index+'_'+schema_id+'_id" name="howto_supply_'+schema_id+'['+index+'][saswp_howto_supply_image_id]" id="saswp_howto_supply_image_'+index+'_'+schema_id+'_id">'
|
1436 |
-
+ '<input data-id="media" style="width: 19%" class="button" id="saswp_howto_supply_image_'+index+'_'+schema_id+'_button" name="saswp_howto_supply_image_'+index+'_'+schema_id+'_button" type="button" value="Upload">'
|
1437 |
-
+ '<div class="saswp_image_div_saswp_howto_supply_image_'+index+'_'+schema_id+'">'
|
1438 |
-
+ '</div>'
|
1439 |
-
+ '</fieldset>'
|
1440 |
-
+ '</td>'
|
1441 |
-
+ '</tr>'
|
1442 |
-
+ '</table>'
|
1443 |
-
+ '</div>';
|
1444 |
-
if(html){
|
1445 |
-
$('.saswp-how-to-supply-section[data-id="'+schema_id+'"]').append(html);
|
1446 |
-
}
|
1447 |
-
|
1448 |
-
|
1449 |
-
});
|
1450 |
-
|
1451 |
-
$(document).on("click", ".saswp-how-to-tool", function(e){
|
1452 |
-
e.preventDefault();
|
1453 |
-
|
1454 |
-
var schema_id = $(this).attr('data-id');
|
1455 |
-
var count = $(".saswp-how-to-tool-table-div").length;
|
1456 |
-
var index = $( ".saswp-how-to-tool-table-div:nth-child("+count+")" ).attr('data-id');
|
1457 |
-
index = ++index;
|
1458 |
-
|
1459 |
-
if(!index){
|
1460 |
-
index = 0;
|
1461 |
-
}
|
1462 |
-
|
1463 |
-
var html = '';
|
1464 |
-
|
1465 |
-
html += '<div class="saswp-how-to-tool-table-div" data-id="'+index+'">'
|
1466 |
-
+ '<a class="saswp-table-close">X</a>'
|
1467 |
-
+ '<table class="form-table saswp-how-to-tool-table">'
|
1468 |
-
+ '<tr>'
|
1469 |
-
+ '<th>Tool Name</th><td><input style="width:100%" type="text" id="saswp_howto_tool_name_'+index+'_'+schema_id+'" name="howto_tool_'+schema_id+'['+index+'][saswp_howto_tool_name]"></td>'
|
1470 |
-
+ '</tr>'
|
1471 |
-
+ '<tr>'
|
1472 |
-
+ '<th>Tool Image</th>'
|
1473 |
-
+ '<td>'
|
1474 |
-
+ '<fieldset>'
|
1475 |
-
+ '<input style="width:80%" type="text" id="saswp_howto_tool_image_'+index+'_'+schema_id+'" name="saswp_howto_tool_image_'+index+'_'+schema_id+'">'
|
1476 |
-
+ '<input type="hidden" data-id="saswp_howto_tool_image_'+index+'_'+schema_id+'_id" name="howto_tool_'+schema_id+'['+index+'][saswp_howto_tool_image_id]" id="saswp_howto_tool_image_'+index+'_'+schema_id+'_id">'
|
1477 |
-
+ '<input data-id="media" style="width: 19%" class="button" id="saswp_howto_tool_image_'+index+'_'+schema_id+'_button" name="saswp_howto_tool_image_'+index+'_'+schema_id+'_button" type="button" value="Upload">'
|
1478 |
-
+ '<div class="saswp_image_div_saswp_howto_tool_image_'+index+'_'+schema_id+'">'
|
1479 |
-
+ '</div>'
|
1480 |
-
+ '</fieldset>'
|
1481 |
-
+ '</td>'
|
1482 |
-
+ '</tr>'
|
1483 |
-
+ '</table>'
|
1484 |
-
+ '</div>';
|
1485 |
-
if(html){
|
1486 |
-
$('.saswp-how-to-tool-section[data-id="'+schema_id+'"]').append(html);
|
1487 |
-
}
|
1488 |
-
|
1489 |
-
|
1490 |
-
});
|
1491 |
-
|
1492 |
-
$(document).on("click", ".saswp-how-to-step", function(e){
|
1493 |
-
e.preventDefault();
|
1494 |
-
|
1495 |
-
var schema_id = $(this).attr('data-id');
|
1496 |
-
var count = $(".saswp-how-to-step-table-div").length;
|
1497 |
-
var index = $( ".saswp-how-to-step-table-div:nth-child("+count+")" ).attr('data-id');
|
1498 |
-
index = ++index;
|
1499 |
-
|
1500 |
-
if(!index){
|
1501 |
-
index = 0;
|
1502 |
-
}
|
1503 |
-
|
1504 |
-
var html = '';
|
1505 |
-
|
1506 |
-
html+='<div class="saswp-how-to-step-table-div" data-id="'+index+'">'
|
1507 |
-
+ '<a class="saswp-table-close">X</a>'
|
1508 |
-
+ '<table class="form-table saswp-how-to-step-table">'
|
1509 |
-
+ '<tr>'
|
1510 |
-
+ '<th>Step Name</th><td><input style="width:100%" type="text" id="saswp_howto_step_name_'+index+'_'+schema_id+'" name="howto_step_'+schema_id+'['+index+'][saswp_howto_step_name]" ></td>'
|
1511 |
-
+ '</tr>'
|
1512 |
-
+ '<tr>'
|
1513 |
-
+ '<th>HowToDirection Text</th><td><input style="width:100%" type="text" id="saswp_howto_direction_text_'+index+'_'+schema_id+'" name="howto_step_'+schema_id+'['+index+'][saswp_howto_direction_text]"></td>'
|
1514 |
-
+ '</tr>'
|
1515 |
-
+ '<tr>'
|
1516 |
-
+ '<th>HowToTip Text</th><td><input style="width:100%" type="text" id="saswp_howto_tip_text_'+index+'_'+schema_id+'" name="howto_step_'+schema_id+'['+index+'][saswp_howto_tip_text]"></td>'
|
1517 |
-
+ '</tr>'
|
1518 |
-
+ '<tr>'
|
1519 |
-
+ '<th>Step Image</th>'
|
1520 |
-
+ '<td>'
|
1521 |
-
+ '<fieldset>'
|
1522 |
-
+ '<input style="width:80%" type="text" id="saswp_howto_step_image_'+index+'_'+schema_id+'" name="saswp_howto_step_image_'+schema_id+'['+index+']">'
|
1523 |
-
+ '<input type="hidden" data-id="saswp_howto_step_image_'+index+'_'+schema_id+'_id" name="howto_step_'+schema_id+'['+index+'][saswp_howto_step_image_id]" id="saswp_howto_step_image_'+index+'_'+schema_id+'_id">'
|
1524 |
-
+ '<input data-id="media" style="width: 19%" class="button" id="saswp_howto_step_image_'+index+'_'+schema_id+'_button" name="saswp_howto_step_image_'+index+'_'+schema_id+'_button" type="button" value="Upload">'
|
1525 |
-
+ '<div class="saswp_image_div_saswp_howto_step_image_'+index+'_'+schema_id+'">'
|
1526 |
-
+ '</div>'
|
1527 |
-
+ '</fieldset>'
|
1528 |
-
+ '</td>'
|
1529 |
-
+ '</tr>'
|
1530 |
-
+ '</table>'
|
1531 |
-
+ '</div>';
|
1532 |
-
|
1533 |
-
if(html){
|
1534 |
-
$('.saswp-how-to-step-section[data-id="'+schema_id+'"]').append(html);
|
1535 |
-
}
|
1536 |
-
|
1537 |
-
|
1538 |
-
});
|
1539 |
-
|
1540 |
-
$(document).on("click", ".saswp-table-close", function(){
|
1541 |
-
$(this).parent().remove();
|
1542 |
-
});
|
1543 |
-
|
1544 |
-
//How to schema js ends here
|
1545 |
-
|
1546 |
-
$(document).on("click", '.saswp-add-custom-fields', function(){
|
1547 |
-
var schema_type = $('select#schema_type option:selected').val();
|
1548 |
-
var post_id = $('#post_ID').val();
|
1549 |
-
if(schema_type !=''){
|
1550 |
-
$.ajax({
|
1551 |
-
type: "POST",
|
1552 |
-
url:ajaxurl,
|
1553 |
-
dataType: "json",
|
1554 |
-
data:{action:"saswp_get_schema_type_fields",post_id:post_id, schema_type:schema_type, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
|
1555 |
-
success:function(response){
|
1556 |
-
|
1557 |
-
if(response.length !=0){
|
1558 |
-
var i =0;
|
1559 |
-
var name ='';
|
1560 |
-
var html = '<tr>';
|
1561 |
-
html += '<td>';
|
1562 |
-
|
1563 |
-
html += '<select class="saswp-custom-fields-name">';
|
1564 |
-
$.each(response, function(key,value){
|
1565 |
-
if(i==0){
|
1566 |
-
name = key;
|
1567 |
-
}
|
1568 |
-
html += '<option value="'+key+'">'+value+'</option>';
|
1569 |
-
i++;
|
1570 |
-
});
|
1571 |
-
html += '</select>';
|
1572 |
-
|
1573 |
-
html += '</td>';
|
1574 |
-
html += '<td>';
|
1575 |
-
html += '<select class="saswp-custom-fields-select2" name="saswp_custom_fields['+name+']">';
|
1576 |
-
html += '</select>';
|
1577 |
-
html += '</td>';
|
1578 |
-
html += '</tr>';
|
1579 |
-
$(".saswp-custom-fields-table").append(html);
|
1580 |
-
saswpCustomSelect2();
|
1581 |
-
}
|
1582 |
-
},
|
1583 |
-
error: function(response){
|
1584 |
-
console.log(response);
|
1585 |
-
}
|
1586 |
-
});
|
1587 |
-
}
|
1588 |
-
});
|
1589 |
-
saswpCustomSelect2();
|
1590 |
-
function saswpCustomSelect2(){
|
1591 |
-
if((saswp_localize_data.post_type == 'saswp' || saswp_localize_data.page_now =='saswp') && saswp_localize_data.page_now !='saswp_page_structured_data_options'){
|
1592 |
-
|
1593 |
-
$('.saswp-custom-fields-select2').select2({
|
1594 |
-
ajax: {
|
1595 |
-
type: "POST",
|
1596 |
-
url: ajaxurl, // AJAX URL is predefined in WordPress admin
|
1597 |
-
dataType: 'json',
|
1598 |
-
delay: 250, // delay in ms while typing when to perform a AJAX search
|
1599 |
-
data: function (params) {
|
1600 |
-
return {
|
1601 |
-
saswp_security_nonce: saswp_localize_data.saswp_security_nonce,
|
1602 |
-
q: params.term, // search query
|
1603 |
-
action: 'saswp_get_custom_meta_fields' // AJAX action for admin-ajax.php
|
1604 |
-
};
|
1605 |
-
},
|
1606 |
-
processResults: function( data ) {
|
1607 |
-
return {
|
1608 |
-
results: data
|
1609 |
-
};
|
1610 |
-
},
|
1611 |
-
cache: true
|
1612 |
-
},
|
1613 |
-
minimumInputLength: 2 // the minimum of symbols to input before perform a search
|
1614 |
-
});
|
1615 |
-
|
1616 |
-
}
|
1617 |
-
|
1618 |
-
}
|
1619 |
-
|
1620 |
-
function saswp_enable_rating_review(){
|
1621 |
-
var schema_type ="";
|
1622 |
-
if($('select#schema_type option:selected').val()){
|
1623 |
-
schema_type = $('select#schema_type option:selected').val();
|
1624 |
-
}
|
1625 |
-
if($(".saswp-tab-links.selected").attr('saswp-schema-type')){
|
1626 |
-
schema_type = $(".saswp-tab-links.selected").attr('saswp-schema-type');
|
1627 |
-
}
|
1628 |
-
|
1629 |
-
if(schema_type){
|
1630 |
-
$(".saswp-enable-rating-review-"+schema_type.toLowerCase()).change(function(){
|
1631 |
-
|
1632 |
-
if($(this).is(':checked')){
|
1633 |
-
$(this).parent().parent().siblings('.saswp-rating-review-'+schema_type.toLowerCase()).show();
|
1634 |
-
}else{
|
1635 |
-
$(this).parent().parent().siblings('.saswp-rating-review-'+schema_type.toLowerCase()).hide();
|
1636 |
-
}
|
1637 |
-
|
1638 |
-
}).change();
|
1639 |
-
}
|
1640 |
-
|
1641 |
-
}
|
1642 |
-
saswp_enable_rating_review();
|
1643 |
-
|
1644 |
-
//custom fields modify schema ends here
|
1645 |
-
|
1646 |
-
|
1647 |
-
//Google review js starts here
|
1648 |
-
|
1649 |
-
$('a[href="'+saswp_localize_data.collection_post_add_url+'"]').attr( 'href', saswp_localize_data.collection_post_add_new_url);
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
$(document).on("click", '.saswp_coonect_google_place', function(){
|
1654 |
-
|
1655 |
-
var place_id = $("#saswp_google_place_id").val();
|
1656 |
-
var language = $("#saswp_language_list").val();
|
1657 |
-
var google_api = $("#saswp_googel_api").val();
|
1658 |
-
|
1659 |
-
if(place_id !=''){
|
1660 |
-
$.ajax({
|
1661 |
-
type: "POST",
|
1662 |
-
url:ajaxurl,
|
1663 |
-
dataType: "json",
|
1664 |
-
data:{action:"saswp_connect_google_place",place_id:place_id, language:language, google_api:google_api, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
|
1665 |
-
success:function(response){
|
1666 |
-
console.log(response['status']);
|
1667 |
-
},
|
1668 |
-
error: function(response){
|
1669 |
-
console.log(response);
|
1670 |
-
}
|
1671 |
-
});
|
1672 |
-
}
|
1673 |
-
});
|
1674 |
-
|
1675 |
-
//google review js ends here
|
1676 |
-
|
1677 |
-
//Adding settings button beside add schema type button on schema type list page
|
1678 |
-
|
1679 |
-
if ('saswp' == saswp_localize_data.post_type && saswp_localize_data.page_now == 'edit.php') {
|
1680 |
-
|
1681 |
-
jQuery(jQuery(".wrap a")[0]).after("<a href='"+saswp_localize_data.saswp_settings_url+"' id='' class='page-title-action'>Settings</a>");
|
1682 |
-
|
1683 |
-
}
|
1684 |
-
|
1685 |
-
$('#saswp-tools-tabs a:first').addClass('saswp-global-selected');
|
1686 |
-
$('.saswp-tools-container').hide();
|
1687 |
-
$('.saswp-tools-container:first').show();
|
1688 |
-
|
1689 |
-
$('#saswp-tools-tabs a').click(function(){
|
1690 |
-
var t = $(this).attr('data-id');
|
1691 |
-
|
1692 |
-
if(!$(this).hasClass('saswp-global-selected')){
|
1693 |
-
$('#saswp-tools-tabs a').removeClass('saswp-global-selected');
|
1694 |
-
$(this).addClass('saswp-global-selected');
|
1695 |
-
|
1696 |
-
$('.saswp-tools-container').hide();
|
1697 |
-
$('#'+t).show();
|
1698 |
-
}
|
1699 |
-
});
|
1700 |
-
|
1701 |
-
});
|
1 |
+
function getParameterByName(s,e){e||(e=window.location.href),s=s.replace(/[\[\]]/g,"\\$&");var a=new RegExp("[?&]"+s+"(=([^&#]*)|&|#|$)").exec(e);return a?a[2]?decodeURIComponent(a[2].replace(/\+/g," ")):"":null}function saswp_fields_html_generator(s,e,a,t,i){var o="";return o+='<div class="saswp-'+t+'-table-div" data-id="'+s+'"><a class="saswp-table-close">X</a><table class="form-table saswp-'+t+'-table">',$.each(i,function(t,i){switch(i.type){case"text":o+="<tr><th>"+i.label+'</th><td><input style="width:100%" type="text" id="'+i.name+"_"+s+"_"+e+'" name="'+a+e+"["+s+"]["+i.name+']"></td></tr>';break;case"media":o+="<tr><th>"+i.label+'</th><td><fieldset><input style="width:80%" type="text" id="'+i.name+"_"+s+"_"+e+'" name="'+i.name+"_"+s+"_"+e+'"><input type="hidden" data-id="'+i.name+"_"+s+"_"+e+'_id" name="'+a+e+"["+s+"]["+i.name+'_id]" id="'+i.name+"_"+s+"_"+e+'_id"><input data-id="media" style="width: 19%" class="button" id="'+i.name+"_"+s+"_"+e+'_button" name="'+i.name+"_"+s+"_"+e+'_button" type="button" value="Upload"><div class="saswp_image_div_'+i.name+"_"+s+"_"+e+'"></div></fieldset></td></tr>'}}),o+="</table></div>"}jQuery(document).ready(function(s){if(saswp_localize_data.do_tour){var e,a="<h3>Thanks for using Structured Data!</h3>";a+="<p>Do you want the latest on <b>Structured Data update</b> before others and some best resources on monetization in a single email? - Free just for users of Structured Data!</p>",a+='<style type="text/css">',a+=".wp-pointer-buttons{ padding:0; overflow: hidden; }",a+=".wp-pointer-content .button-secondary{ left: -25px;background: transparent;top: 5px; border: 0;position: relative; padding: 0; box-shadow: none;margin: 0;color: #0085ba;} .wp-pointer-content .button-primary{ display:none}\t#afw_mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }",a+="</style>",a+='<div id="afw_mc_embed_signup">',a+='<form action="//app.mailerlite.com/webforms/submit/o1s7u3" data-id="258182" data-code="o1s7u3" method="POST" target="_blank">',a+='<div id="afw_mc_embed_signup_scroll">',a+='<div class="afw-mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">',a+='<input type="text" name="fields[name]" class="form-control" placeholder="Name" hidden value="'+saswp_localize_data.current_user_name+'" style="display:none">',a+='<input type="text" value="'+saswp_localize_data.current_user_email+'" name="fields[email]" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">',a+='<input type="text" name="fields[company]" class="form-control" placeholder="Website" hidden style=" display:none; width: 168px; padding: 6px 5px;" value="'+saswp_localize_data.get_home_url+'">',a+='<input type="hidden" name="ml-submit" value="1" />',a+="</div>",a+='<div id="mce-responses">',a+='<div class="response" id="mce-error-response" style="display:none"></div>',a+='<div class="response" id="mce-success-response" style="display:none"></div>',a+="</div>",a+='<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>',a+='<input type="submit" value="Subscribe" name="subscribe" id="pointer-close" class="button mc-newsletter-sent" style=" background: #0085ba; border-color: #006799; padding: 0px 16px; text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799; height: 30px; margin-top: 1px; color: #fff; box-shadow: 0 1px 0 #006799;">',a+="</div>",a+="</form>";var t={content:a+="</div>",position:{edge:"top",align:"left"}};e=function(){s(saswp_localize_data.displayID).pointer(t).pointer("open"),saswp_localize_data.button2&&(jQuery("#pointer-close").after('<a id="pointer-primary" class="button-primary">'+saswp_localize_data.button2+"</a>"),jQuery("#pointer-primary").click(function(){saswp_localize_data.function_name}),jQuery("#pointer-close").click(function(){s.post(saswp_localize_data.ajax_url,{pointer:"saswp_subscribe_pointer222",action:"dismiss-wp-pointer"})}))},(t=s.extend(t,{buttons:function(s,e){return button=jQuery('<a id="pointer-close" class="button-secondary">'+saswp_localize_data.button1+"</a>"),button_2=jQuery("#pointer-close.button"),button.bind("click.pointer",function(){e.element.pointer("close")}),button_2.on("click",function(){e.element.pointer("close")}),button},close:function(){s.post(saswp_localize_data.ajax_url,{pointer:"saswp_subscribe_pointer222",action:"dismiss-wp-pointer"})},show:function(s,e){e.pointer.css({left:"170px",top:"160px"})}})).position&&t.position.defer_loading?s(window).bind("load.wp-pointers",e):e()}function i(e,a){var t=a.replace("-checkbox",""),i=s("#"+t).next("p").text();e.is(":checked")&&""!==i?s("#"+t).next("p").removeClass("saswp_hide"):1==s("#"+t).next("p").attr("data-id")?s("#"+t).next("p").text("This feature is only available in pro version"):s("#"+t).next("p").addClass("saswp_hide")}function o(){s(".saswp-item-reviewed").change(function(e){e.preventDefault();var a="";if(s("select#schema_type option:selected").val()&&(a=s("select#schema_type option:selected").val()),s(".saswp-tab-links.selected").attr("saswp-schema-type")&&(a=s(".saswp-tab-links.selected").attr("saswp-schema-type")),"Review"===a){var t=s(this),i=s(this).val(),o=saswp_localize_data.post_id,p=s(t).attr("data-id"),n=s(t).attr("post-specific");s.get(ajaxurl,{action:"saswp_get_item_reviewed_fields",schema_id:p,post_specific:n,item:i,post_id:o,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){s(t).parent().parent().nextAll().remove(".saswp-review-tr"),s(t).parent().parent().after(e)})}}).change()}function p(){s(".saswp-local-schema-datepicker-picker").datepicker({dateFormat:"yy-mm-dd",minDate:0})}function n(){"saswp"!=saswp_localize_data.post_type&&"saswp"!=saswp_localize_data.page_now||"saswp_page_structured_data_options"==saswp_localize_data.page_now||s(".saswp-custom-fields-select2").select2({ajax:{type:"POST",url:ajaxurl,dataType:"json",delay:250,data:function(s){return{saswp_security_nonce:saswp_localize_data.saswp_security_nonce,q:s.term,action:"saswp_get_custom_meta_fields"}},processResults:function(s){return{results:s}},cache:!0},minimumInputLength:2})}function c(){var e="";s("select#schema_type option:selected").val()&&(e=s("select#schema_type option:selected").val()),s(".saswp-tab-links.selected").attr("saswp-schema-type")&&(e=s(".saswp-tab-links.selected").attr("saswp-schema-type")),e&&s(".saswp-enable-rating-review-"+e.toLowerCase()).change(function(){s(this).is(":checked")?s(this).parent().parent().siblings(".saswp-rating-review-"+e.toLowerCase()).show():s(this).parent().parent().siblings(".saswp-rating-review-"+e.toLowerCase()).hide()}).change()}s(".saswp-tabs a").click(function(e){var a=s(this).attr("href"),t=getParameterByName("tab",a);return t||(t="general"),s(this).siblings().removeClass("nav-tab-active"),s(this).addClass("nav-tab-active"),s(".form-wrap").find(".saswp-"+t).siblings().hide(),s(".form-wrap .saswp-"+t).show(),window.history.pushState("","",a),!1}),s(".saswp-schame-type-select").change(function(){s(".saswp-custom-fields-table").html("");var e=s(this).val();s(".saswp-option-table-class tr").each(function(e,a){e>0&&(s(this).hide(),s(this).find("select").attr("disabled",!0))}),"TechArticle"==e||"Article"==e||"Blogposting"==e||"NewsArticle"==e||"WebPage"==e?s(".saswp-enable-speakable").parent().parent().show():s(".saswp-enable-speakable").parent().parent().hide(),"local_business"==e&&(s(".saswp-option-table-class tr").eq(1).show(),s(".saswp-business-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1),s(".select-post-type").val("show_globally").trigger("change")),"Service"==e&&(s(".saswp-service-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"Review"==e&&(s(".saswp-review-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1),o()),"Product"==e&&(s(".saswp-product-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"Event"==e&&(s(".saswp-event-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"AudioObject"==e&&s(".saswp-audio-text-field-tr").show(),"SoftwareApplication"==e&&s(".saswp-softwareapplication-text-field-tr").show(),s(".saswp-schem-type-note").addClass("saswp_hide"),"qanda"==e&&s(".saswp-schem-type-note").removeClass("saswp_hide"),s(".saswp-job-posting-note").addClass("saswp_hide"),c()}),s("#saswp_business_type").change(function(){var e=s(this).val(),a=s(".saswp-schame-type-select").val();s(".saswp-option-table-class tr").each(function(e,a){e>1&&(s(this).hide(),s(this).find("select").attr("disabled",!0))}),"TechArticle"==a||"Article"==a||"Blogposting"==a||"NewsArticle"==a||"WebPage"==a?s(".saswp-enable-speakable").parent().parent().show():s(".saswp-enable-speakable").parent().parent().hide(),"local_business"==a&&(s(".saswp-"+e+"-tr").show(),s(".saswp-business-text-field-tr").show(),s(".saswp-"+e+"-tr").find("select").attr("disabled",!1)),"Service"==a&&(s(".saswp-service-text-field-tr").show(),s(".saswp-service-text-field-tr").find("select").attr("disabled",!1)),"Product"==a&&(s(".saswp-product-text-field-tr").show(),s(".saswp-product-text-field-tr").find("select").attr("disabled",!1)),"AudioObject"==a&&s(".saswp-audio-text-field-tr").show(),"SoftwareApplication"==a&&s(".saswp-softwareapplication-text-field-tr").show(),"Review"==a&&(s(".saswp-review-text-field-tr").show(),s(".saswp-review-text-field-tr").find("select").attr("disabled",!1)),"Event"==a&&(s(".saswp-event-text-field-tr").show(),s(".saswp-event-text-field-tr").find("select").attr("disabled",!1)),c()}).change(),s(".saswp-checkbox").change(function(){var e=s(this).attr("id"),a=s(this);switch(e){case"saswp-for-wordpress-checkbox":s(this).is(":checked")?s("#saswp-for-wordpress").val(1):s("#saswp-for-wordpress").val(0);break;case"saswp-facebook-enable-checkbox":s(this).is(":checked")?(s("#saswp-facebook-enable").val(1),s("#sd_facebook").show()):(s("#saswp-facebook-enable").val(0),s("#sd_facebook").hide());break;case"saswp-twitter-enable-checkbox":s(this).is(":checked")?(s("#saswp-twitter-enable").val(1),s("#sd_twitter").show()):(s("#saswp-twitter-enable").val(0),s("#sd_twitter").hide());break;case"saswp-google-plus-enable-checkbox":s(this).is(":checked")?(s("#saswp-google-plus-enable").val(1),s("#sd_google_plus").show()):(s("#saswp-google-plus-enable").val(0),s("#sd_google_plus").hide());break;case"saswp-instagram-enable-checkbox":s(this).is(":checked")?(s("#saswp-instagram-enable").val(1),s("#sd_instagram").show()):(s("#saswp-instagram-enable").val(0),s("#sd_instagram").hide());break;case"saswp-youtube-enable-checkbox":s(this).is(":checked")?(s("#sd_youtube").show(),s("#saswp-youtube-enable").val(1)):(s("#saswp-youtube-enable").val(0),s("#sd_youtube").hide());break;case"saswp-linkedin-enable-checkbox":s(this).is(":checked")?(s("#saswp-linkedin-enable").val(1),s("#sd_linkedin").show()):(s("#saswp-linkedin-enable").val(0),s("#sd_linkedin").hide());break;case"saswp-pinterest-enable-checkbox":s(this).is(":checked")?(s("#saswp-pinterest-enable").val(1),s("#sd_pinterest").show()):(s("#saswp-pinterest-enable").val(0),s("#sd_pinterest").hide());break;case"saswp-soundcloud-enable-checkbox":s(this).is(":checked")?(s("#saswp-soundcloud-enable").val(1),s("#sd_soundcloud").show()):(s("#saswp-soundcloud-enable").val(0),s("#sd_soundcloud").hide());break;case"saswp-tumblr-enable-checkbox":s(this).is(":checked")?(s("#saswp-tumblr-enable").val(1),s("#sd_tumblr").show()):(s("#saswp-tumblr-enable").val(0),s("#sd_tumblr").hide());break;case"saswp-for-amp-checkbox":s(this).is(":checked")?s("#saswp-for-amp").val(1):s("#saswp-for-amp").val(0);break;case"saswp_kb_contact_1_checkbox":s(this).is(":checked")?(s("#saswp_kb_contact_1").val(1),s("#saswp_kb_telephone, #saswp_contact_type").parent().parent("li").removeClass("saswp-display-none")):(s("#saswp_kb_contact_1").val(0),s("#saswp_kb_telephone, #saswp_contact_type").parent().parent("li").addClass("saswp-display-none"));break;case"saswp-logo-dimensions-check":s(this).is(":checked")?(s("#saswp-logo-dimensions").val(1),s("#saswp-logo-width, #saswp-logo-height").parent().parent("li").show()):(s("#saswp-logo-dimensions").val(0),s("#saswp-logo-width, #saswp-logo-height").parent().parent("li").hide());break;case"saswp_archive_schema_checkbox":s(this).is(":checked")?(s("#saswp_archive_schema").val(1),s(".saswp_archive_schema_type_class").parent().parent().show()):(s("#saswp_archive_schema").val(0),s(".saswp_archive_schema_type_class").parent().parent().hide());break;case"saswp_website_schema_checkbox":s(this).is(":checked")?(s("#saswp_website_schema").val(1),s("#saswp_search_box_schema").parent().parent().show()):(s("#saswp_website_schema").val(0),s("#saswp_search_box_schema").parent().parent().hide());break;case"saswp_search_box_schema_checkbox":s(this).is(":checked")?s("#saswp_search_box_schema").val(1):s("#saswp_search_box_schema").val(0);break;case"saswp_breadcrumb_schema_checkbox":s(this).is(":checked")?s("#saswp_breadcrumb_schema").val(1):s("#saswp_breadcrumb_schema").val(0);break;case"saswp_site_navigation_menu_checkbox":s(this).is(":checked")?(s("#saswp_site_navigation_menu").val(1),s(".saswp-nav-menu-list").show()):(s("#saswp_site_navigation_menu").val(0),s(".saswp-nav-menu-list").hide());break;case"saswp_comments_schema_checkbox":s(this).is(":checked")?s("#saswp_comments_schema").val(1):s("#saswp_comments_schema").val(0);break;case"saswp-compativility-checkbox":s(this).is(":checked")?s("#saswp-flexmlx-compativility").val(1):s("#saswp-flexmlx-compativility").val(0);break;case"saswp-review-module-checkbox":s(this).is(":checked")?s("#saswp-review-module").val(1):s("#saswp-review-module").val(0);break;case"saswp-kk-star-raring-checkbox":i(a,e),s(this).is(":checked")?s("#saswp-kk-star-raring").val(1):s("#saswp-kk-star-raring").val(0);break;case"saswp-woocommerce-checkbox":i(a,e),s(this).is(":checked")?s("#saswp-woocommerce").val(1):s("#saswp-woocommerce").val(0);break;case"saswp-extra-checkbox":i(a,e),s(this).is(":checked")?s("#saswp-extra").val(1):s("#saswp-extra").val(0);break;case"saswp-dw-question-answer-checkbox":i(a,e),s(this).is(":checked")?s("#saswp-dw-question-answer").val(1):s("#saswp-dw-question-answer").val(0);break;case"saswp-wp-job-manager-checkbox":i(a,e),s(this).is(":checked")?s("#saswp-wp-job-manager").val(1):s("#saswp-wp-job-manager").val(0);break;case"saswp-yoast-checkbox":i(a,e),s(this).is(":checked")?s("#saswp-yoast").val(1):s("#saswp-yoast").val(0);break;case"saswp-rankmath-checkbox":i(a,e),s(this).is(":checked")?s("#saswp-rankmath").val(1):s("#saswp-rankmath").val(0);break;case"saswp-tagyeem-checkbox":i(a,e),s(this).is(":checked")?s("#saswp-tagyeem").val(1):s("#saswp-tagyeem").val(0);break;case"saswp-the-events-calendar-checkbox":i(a,e),s(this).is(":checked")?s("#saswp-the-events-calendar").val(1):s("#saswp-the-events-calendar").val(0);break;case"saswp-woocommerce-booking-checkbox":i(a,e),s(this).is(":checked")?(s("#saswp-woocommerce-booking").val(1),s("#saswp-woocommerce-booking-main").val(1)):(s("#saswp-woocommerce-booking").val(0),s("#saswp-woocommerce-booking-main").val(0));break;case"saswp-woocommerce-booking-main-checkbox":i(a,e),s(this).is(":checked")?(s("#saswp-woocommerce-booking-main").val(1),s("#saswp-woocommerce-booking").val(1)):(s("#saswp-woocommerce-booking-main").val(0),s("#saswp-woocommerce-booking").val(0));break;case"saswp-woocommerce-membership-checkbox":i(a,e),s(this).is(":checked")?s("#saswp-woocommerce-membership").val(1):s("#saswp-woocommerce-membership").val(0);break;case"saswp-defragment-checkbox":s(this).is(":checked")?s("#saswp-defragment").val(1):s("#saswp-defragment").val(0);break;case"saswp-cooked-checkbox":i(a,e),s(this).is(":checked")?s("#saswp-cooked").val(1):s("#saswp-cooked").val(0);break;case"saswp-flexmlx-compativility-checkbox":i(a,e),s(this).is(":checked")?s("#saswp-flexmlx-compativility").val(1):s("#saswp-flexmlx-compativility").val(0);break;case"saswp-google-review-checkbox":s(this).is(":checked")?(s("#saswp-google-review").val(1),s("#saswp_google_place_api_key").parent().parent().show()):(s("#saswp-google-review").val(0),s("#saswp_google_place_api_key").parent().parent().hide());break;case"saswp-markup-footer-checkbox":s(this).is(":checked")?s("#saswp-markup-footer").val(1):s("#saswp-markup-footer").val(0);break;case"saswp-pretty-print-checkbox":s(this).is(":checked")?s("#saswp-pretty-print").val(1):s("#saswp-pretty-print").val(0);break;case"saswp-wppostratings-raring-checkbox":i(a,e),s(this).is(":checked")?s("#saswp-wppostratings-raring").val(1):s("#saswp-wppostratings-raring").val(0);break;case"saswp-bbpress-checkbox":i(a,e),s(this).is(":checked")?s("#saswp-bbpress").val(1):s("#saswp-bbpress").val(0);break;case"saswp-microdata-cleanup-checkbox":s(this).is(":checked")?s("#saswp-microdata-cleanup").val(1):s("#saswp-microdata-cleanup").val(0)}}).change(),s("#saswp_kb_type").change(function(){var e=s(this).val();s(".saswp_org_fields, .saswp_person_fields").parent().parent().addClass("saswp_hide"),s(".saswp_kg_logo").parent().parent().parent().addClass("saswp_hide"),s("#sd-person-image").parent().parent().parent().addClass("saswp_hide"),"Organization"==e&&(s(".saswp_org_fields").parent().parent().removeClass("saswp_hide"),s(".saswp_person_fields").parent().parent().addClass("saswp_hide"),s(".saswp_kg_logo").parent().parent().parent().removeClass("saswp_hide"),s("#sd-person-image").parent().parent().parent().addClass("saswp_hide")),"Person"==e&&(s(".saswp_org_fields").parent().parent().addClass("saswp_hide"),s(".saswp_person_fields").parent().parent().removeClass("saswp_hide"),s(".saswp_kg_logo").parent().parent().parent().removeClass("saswp_hide"),s("#sd-person-image").parent().parent().parent().removeClass("saswp_hide"))}).change(),s(document).on("click","input[data-id=media]",function(e){e.preventDefault();var a=s(this),t=a.attr("id").replace("_button",""),i=wp.media({title:"Application Icon",button:{text:"Select Icon"},multiple:!1,library:{type:"image"}}).on("select",function(){var e=i.state().get("selection").first().toJSON();s("#"+t).val(e.url),s("input[data-id='"+t+"_id']").val(e.id),s("input[data-id='"+t+"_height']").val(e.height),s("input[data-id='"+t+"_width']").val(e.width),s("input[data-id='"+t+"_thumbnail']").val(e.url),"sd_default_image_button"===a.attr("id")&&(s("#sd_default_image_width").val(e.width),s("#sd_default_image_height").val(e.height)),s(".saswp_image_div_"+t).html('<div class="saswp_image_thumbnail"><img class="saswp_image_prev" src="'+e.url+'"/><a data-id="'+t+'" href="#" class="saswp_prev_close">X</a></div>')}).open()}),s(document).on("click",".saswp_prev_close",function(e){e.preventDefault();var a=s(this).attr("data-id");console.log(a),s(this).parent().remove(),s("#"+a).val(""),s("input[data-id='"+a+"_id']").val(""),s("input[data-id='"+a+"_height']").val(""),s("input[data-id='"+a+"_width']").val(""),s("input[data-id='"+a+"_thumbnail']").val(""),"sd_default_image"===a&&(s("#sd_default_image_width").val(""),s("#sd_default_image_height").val(""))}),s(document).on("change",".saswp-schema-type-toggle",function(e){var a=s(this).attr("data-schema-id"),t=s(this).attr("data-post-id");if(s(this).is(":checked"))var i=1;else i=0;s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_enable_disable_schema_on_post",status:i,schema_id:a,post_id:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){},error:function(s){console.log(s)}})}),s(document).on("click",".saswp-reset-data",function(e){e.preventDefault(),1==confirm("Are you sure?")&&s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_reset_all_settings",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){setTimeout(function(){location.reload()},1e3)},error:function(s){console.log(s)}})}),s(document).on("click",".saswp_license_activation",function(e){e.preventDefault();var a=s(this).attr("license-status"),t=s(this).attr("add-on"),i=s("#"+t+"_addon_license_key").val();a&&t&&i&&s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_license_status_check",license_key:i,license_status:a,add_on:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){s("#"+t+"_addon_license_key_status").val(e.status),"active"==e.status?(s(".saswp-"+t+"-dashicons").addClass("dashicons-yes"),s(".saswp-"+t+"-dashicons").removeClass("dashicons-no-alt"),s(".saswp-"+t+"-dashicons").css("color","green"),s(".saswp_license_activation[add-on='"+t+"']").attr("license-status","inactive"),s(".saswp_license_activation[add-on='"+t+"']").text("Deactivate"),s(".saswp_license_status_msg[add-on='"+t+"']").text("Activated"),s(".saswp_license_status_msg[add-on='"+t+"']").css("color","green"),s(".saswp_license_status_msg[add-on='"+t+"']").text(e.message)):(s(".saswp-"+t+"-dashicons").addClass("dashicons-no-alt"),s(".saswp-"+t+"-dashicons").removeClass("dashicons-yes"),s(".saswp-"+t+"-dashicons").css("color","red"),s(".saswp_license_activation[add-on='"+t+"']").attr("license-status","active"),s(".saswp_license_activation[add-on='"+t+"']").text("Activate"),s(".saswp_license_status_msg[add-on='"+t+"']").css("color","red"),s(".saswp_license_status_msg[add-on='"+t+"']").text(e.message))},error:function(s){console.log(s)}})}),s(".saswp-send-query").on("click",function(e){e.preventDefault();var a=s("#saswp_query_message").val();""!=s.trim(a)?s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_send_query_message",message:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){"t"==e.status?(s(".saswp-query-success").show(),s(".saswp-query-error").hide()):(console.log("dd"),s(".saswp-query-success").hide(),s(".saswp-query-error").show())},error:function(s){console.log(s)}}):alert("Please enter the message")}),s(".saswp-import-plugins").on("click",function(e){e.preventDefault();var a=s(this);a.addClass("updating-message");var t=s(this).attr("data-id");s.get(ajaxurl,{action:"saswp_import_plugin_data",plugin_name:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){"t"==e.status?(s(a).parent().find(".saswp-imported-message").text(e.message),s(a).parent().find(".saswp-imported-message").removeClass("saswp-error"),setTimeout(function(){location.reload()},2e3)):(s(a).parent().find(".saswp-imported-message").addClass("saswp-error"),s(a).parent().find(".saswp-imported-message").text(e.message)),a.removeClass("updating-message")},"json")}),s(".saswp-feedback-no-thanks").on("click",function(e){e.preventDefault(),s.get(ajaxurl,{action:"saswp_feeback_no_thanks"},function(e){"t"==e.status&&s(".saswp-feedback-notice").hide()},"json")}),s(".saswp-feedback-remindme").on("click",function(e){e.preventDefault(),s.get(ajaxurl,{action:"saswp_feeback_remindme"},function(e){"t"==e.status&&s(".saswp-feedback-notice").hide()},"json")}),s(document).on("change",".saswp-local-business-type-select",function(e){e.preventDefault();var a=s(this),t=s(this).val();s.get(ajaxurl,{action:"saswp_get_sub_business_ajax",business_type:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){if("t"==e.status){s(".saswp-local-business-name-select").parents("tr").remove();var t=a.parents(".saswp-post-specific-wrapper").attr("data-id"),i='<tr><th><label for="saswp_business_name_'+t+'">Sub Business Type</label></th>';i+='<td><select class="saswp-local-business-name-select" id="saswp_business_name_'+t+'" name="saswp_business_name_'+t+'">',s.each(e.result,function(s,e){i+='<option value="'+s+'">'+e+"</option>"}),i+="</select></td>",i+="</tr>",a.parents(".form-table tr:first").after(i)}else s(".saswp-local-business-name-select").parents("tr").remove()},"json")}),o(),s(".saswp-local-schema-time-picker").timepicker({timeFormat:"H:i:s"}),s(document).on("click",".saswp-add-custom-schema",function(e){e.preventDefault(),s(".saswp-add-custom-schema-field").removeClass("saswp_hide"),s(this).hide()}),s(document).on("click",".saswp-delete-custom-schema",function(e){e.preventDefault(),s("#saswp_custom_schema_field").val(""),s(".saswp-add-custom-schema-field").addClass("saswp_hide"),s(".saswp-add-custom-schema").show()}),s(".saswp-modify_schema_post_enable").on("click",function(e){var a=s(this);a.addClass("updating-message"),e.preventDefault(),s.get(ajaxurl,{action:"saswp_modify_schema_post_enable",post_id:saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){a.remove(),s(".saswp-add-custom-schema-div").remove(),s("#post_specific .inside").append(e),a.removeClass("updating-message"),s(".saswp-local-schema-time-picker").timepicker({timeFormat:"H:i:s"}),p(),c(),o()})}),p(),s(document).on("click",".saswp-add-more-item",function(e){e.preventDefault();var a=s(".saswp-review-item-list-table tr").length;console.log(a);s(".saswp-review-item-list-table").append('<tr class="saswp-review-item-tr"><td>Review Item Feature</td><td><input type="text" name="saswp-review-item-feature[]"></td><td>Rating</td><td><input step="0.1" min="0" max="5" type="number" name="saswp-review-item-star-rating[]"></td><td><a type="button" class="saswp-remove-review-item button">x</a></td></tr>')}),s(document).on("click",".saswp-remove-review-item",function(e){e.preventDefault(),s(this).parent().parent("tr").remove()}),s(document).on("focusout",".saswp-review-item-tr input[type=number]",function(e){e.preventDefault();var a=0,t=s(".saswp-review-item-tr input[type=number]").length;s(".saswp-review-item-tr input[type=number]").each(function(e,t){""==s(t).val()?a+=parseFloat(0):a+=parseFloat(s(t).val())});var i=a/t;s("#saswp-review-item-over-all").val(i)}),s("#saswp-review-location").change(function(){var e=s(this).val();s(".saswp-review-shortcode").addClass("saswp_hide"),3==e&&s(".saswp-review-shortcode").removeClass("saswp_hide")}).change(),s("#saswp-review-item-enable").change(function(){s(this).is(":checked")?s(".saswp-review-fields").show():s(".saswp-review-fields").hide()}).change(),s(document).on("click",".saswp-restore-post-schema",function(e){e.preventDefault();var a=s(this);if(a.addClass("updating-message"),s(".saswp-post-specific-schema-ids").val())var t=JSON.parse(s(".saswp-post-specific-schema-ids").val());s.post(ajaxurl,{action:"saswp_restore_schema",schema_ids:t,post_id:saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){"t"==s.status?setTimeout(function(){location.reload()},1e3):(alert(s.msg),setTimeout(function(){location.reload()},1e3)),a.removeClass("updating-message")},"json")}),s(document).on("click","div.saswp-tab ul.saswp-tab-nav a",function(e){e.preventDefault();var a=s(this).attr("data-id");s(".saswp-post-specific-wrapper").hide(),s("#"+a).show(),s("div.saswp-tab ul.saswp-tab-nav a").removeClass("selected"),s("div.saswp-tab ul.saswp-tab-nav li").removeClass("selected"),s(this).addClass("selected"),s(this).parent().addClass("selected"),c()}),s("#saswp-global-tabs a:first").addClass("saswp-global-selected"),s(".saswp-global-container").hide(),s(".saswp-global-container:first").show(),s("#saswp-global-tabs a").click(function(){var e=s(this).attr("data-id");s(this).hasClass("saswp-global-selected")||(s("#saswp-global-tabs a").removeClass("saswp-global-selected"),s(this).addClass("saswp-global-selected"),s(".saswp-global-container").hide(),s("#"+e).show())}),s("#saswp-tools-tabs a:first").addClass("saswp-global-selected"),s(".saswp-tools-container").hide(),s(".saswp-tools-container:first").show(),s("#saswp-tools-tabs a").click(function(){var e=s(this).attr("data-id");s(this).hasClass("saswp-global-selected")||(s("#saswp-tools-tabs a").removeClass("saswp-global-selected"),s(this).addClass("saswp-global-selected"),s(".saswp-tools-container").hide(),s("#"+e).show())}),s('a[href="'+saswp_localize_data.new_url_selector+'"]').attr("href",saswp_localize_data.new_url_href),s("#saswp_enable_custom_field").change(function(){s(this).is(":checked")?s(".saswp-custom-fields-div").show():s(".saswp-custom-fields-div").hide()}),s(document).on("change",".saswp-custom-fields-name",function(){s(this).parent().parent("tr").find("td:eq(1)").html("");var e="";e+='<select class="saswp-custom-fields-select2" name="saswp_custom_fields['+s(this).val()+']">',e+="</select>",s(this).parent().parent("tr").find("td:eq(1)").html(e),n()}),s(document).on("click",".saswp-skip-button",function(e){e.preventDefault(),s(this).parent().parent().hide(),s.post(ajaxurl,{action:"saswp_skip_wizard",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){},"json")}),s(document).on("click",".saswp-trip-itinerary",function(e){e.preventDefault();var a=s(this).attr("data-id"),t=s(".saswp-trip-itinerary-table-div").length,i=s(".saswp-trip-itinerary-table-div:nth-child("+t+")").attr("data-id");(i=++i)||(i=0);var o="";(o+='<div class="saswp-trip-itinerary-table-div" data-id="'+i+'"><a class="saswp-table-close">X</a><table class="form-table saswp-trip-itinerary-table"><tr><th>Itinerary Type</th><td><select id="saswp_trip_itinerary_type_'+i+"_"+a+'" name="trip_itinerary_'+a+"["+i+'][saswp_trip_itinerary_type]"><option value="City">City</option><option value="LandmarksOrHistoricalBuildings">LandmarksOrHistoricalBuildings</option><option value="AdministrativeArea">AdministrativeArea</option><option value="LakeBodyOfWater">LakeBodyOfWater</option></select></td></tr><tr><th>Itinerary Name</th><td><input style="width:100%" type="text" id="saswp_trip_itinerary_name_'+i+"_"+a+'" name="trip_itinerary_'+a+"["+i+'][saswp_trip_itinerary_name]"></td></tr><tr><th>Itinerary Description</th><td><textarea placeholder="Description" style="width: 100%" id="saswp_trip_itinerary_description_'+i+"_"+a+'" name="trip_itinerary_'+a+"["+i+'][saswp_trip_itinerary_description]" rows="5"></textarea></td></tr><tr><th>Itinerary URL</th><td><input style="width:100%" type="text" id="saswp_trip_itinerary_url_'+i+"_"+a+'" name="trip_itinerary_'+a+"["+i+'][saswp_trip_itinerary_url]"></td></tr></table></div>')&&s('.saswp-trip-itinerary-section[data-id="'+a+'"]').append(o)}),s(document).on("click",".saswp-tvseries-actor",function(e){e.preventDefault();var a=s(this).attr("data-id"),t=s(".saswp-tvseries-actor-table-div").length,i=s(".saswp-tvseries-actor-table-div:nth-child("+t+")").attr("data-id");(i=++i)||(i=0);var o="";(o+='<div class="saswp-tvseries-actor-table-div" data-id="'+i+'"><a class="saswp-table-close">X</a><table class="form-table saswp-tvseries-actor-table"><tr><th>Actor Name</th><td><input style="width:100%" type="text" id="saswp_tvseries_actor_name_'+i+"_"+a+'" name="tvseries_actor_'+a+"["+i+'][saswp_tvseries_actor_name]"></td></tr></table></div>')&&s('.saswp-tvseries-actor-section[data-id="'+a+'"]').append(o)}),s(document).on("click",".saswp-tvseries-season",function(e){e.preventDefault();var a=s(this).attr("data-id"),t=s(".saswp-tvseries-season-table-div").length,i=s(".saswp-tvseries-season-table-div:nth-child("+t+")").attr("data-id");(i=++i)||(i=0);var o="";(o+='<div class="saswp-tvseries-season-table-div" data-id="'+i+'"><a class="saswp-table-close">X</a><table class="form-table saswp-tvseries-season-table"><tr><th>Season</th><td><input style="width:100%" type="text" id="saswp_tvseries_season_name_'+i+"_"+a+'" name="tvseries_season_'+a+"["+i+'][saswp_tvseries_season_name]"></td></tr><tr><th>Season Published Date</th><td><input class="saswp-local-schema-datepicker-picker" style="width:100%" type="text" id="saswp_tvseries_season_published_date_'+i+"_"+a+'" name="tvseries_season_'+a+"["+i+'][saswp_tvseries_season_published_date]"></td></tr><tr><th>Number Of Episodes</th><td><input style="width:100%" type="text" id="saswp_tvseries_season_episodes_'+i+"_"+a+'" name="tvseries_season_'+a+"["+i+'][saswp_tvseries_season_episodes]"></td></tr></table></div>')&&(s('.saswp-tvseries-season-section[data-id="'+a+'"]').append(o),p())}),s(document).on("click",".saswp-mc-cause",function(e){e.preventDefault();var a=s(this).attr("data-id"),t=s(".saswp-mc-cause-table-div").length,i=s(".saswp-mc-cause-table-div:nth-child("+t+")").attr("data-id");(i=++i)||(i=0);var o="";(o+='<div class="saswp-mc-cause-table-div" data-id="'+i+'"><a class="saswp-table-close">X</a><table class="form-table saswp-mc-cause-table"><tr><th>Cause</th><td><input style="width:100%" type="text" id="saswp_mc_cause_name_'+i+"_"+a+'" name="mc_cause_'+a+"["+i+'][saswp_mc_cause_name]"></td></tr></table></div>')&&s('.saswp-mc-cause-section[data-id="'+a+'"]').append(o)}),s(document).on("click",".saswp-mc-symptom",function(e){e.preventDefault();var a=s(this).attr("data-id"),t=s(".saswp-mc-symptom-table-div").length,i=s(".saswp-mc-symptom-table-div:nth-child("+t+")").attr("data-id");(i=++i)||(i=0);var o="";(o+='<div class="saswp-mc-symptom-table-div" data-id="'+i+'"><a class="saswp-table-close">X</a><table class="form-table saswp-mc-symptom-table"><tr><th>Symptom Name</th><td><input style="width:100%" type="text" id="saswp_mc_symptom_name_'+i+"_"+a+'" name="mc_symptom_'+a+"["+i+'][saswp_mc_symptom_name]"></td></tr></table></div>')&&s('.saswp-mc-symptom-section[data-id="'+a+'"]').append(o)}),s(document).on("click",".saswp-mc-risk_factor",function(e){e.preventDefault();var a=s(this).attr("data-id"),t=s(".saswp-mc-risk_factor-table-div").length,i=s(".saswp-mc-risk_factor-table-div:nth-child("+t+")").attr("data-id");(i=++i)||(i=0);var o="";(o+='<div class="saswp-mc-risk_factor-table-div" data-id="'+i+'"><a class="saswp-table-close">X</a><table class="form-table saswp-mc-risk_factor-table"><tr><th>Risk Factor Name</th><td><input style="width:100%" type="text" id="saswp_mc_risk_factor_name_'+i+"_"+a+'" name="mc_risk_factor_'+a+"["+i+'][saswp_mc_risk_factor_name]"></td></tr></table></div>')&&s('.saswp-mc-risk_factor-section[data-id="'+a+'"]').append(o)}),s(document).on("click",".saswp-how-to-supply",function(e){e.preventDefault();var a=s(this).attr("data-id"),t=s(".saswp-how-to-supply-table-div").length,i=s(".saswp-how-to-supply-table-div:nth-child("+t+")").attr("data-id");(i=++i)||(i=0);var o=saswp_fields_html_generator(i,a,"howto_supply_","how-to-supply",[{label:"Supply Name",name:"saswp_howto_supply_name",type:"text"},{label:"Supply URL",name:"saswp_howto_supply_url",type:"text"},{label:"Supply Image",name:"saswp_howto_supply_image",type:"media"}]);o&&s('.saswp-how-to-supply-section[data-id="'+a+'"]').append(o)}),s(document).on("click",".saswp-how-to-tool",function(e){e.preventDefault();var a=s(this).attr("data-id"),t=s(".saswp-how-to-tool-table-div").length,i=s(".saswp-how-to-tool-table-div:nth-child("+t+")").attr("data-id");(i=++i)||(i=0);var o="";(o+='<div class="saswp-how-to-tool-table-div" data-id="'+i+'"><a class="saswp-table-close">X</a><table class="form-table saswp-how-to-tool-table"><tr><th>Tool Name</th><td><input style="width:100%" type="text" id="saswp_howto_tool_name_'+i+"_"+a+'" name="howto_tool_'+a+"["+i+'][saswp_howto_tool_name]"></td></tr><tr><th>Tool URL</th><td><input style="width:100%" type="text" id="saswp_howto_tool_url_'+i+"_"+a+'" name="howto_tool_'+a+"["+i+'][saswp_howto_tool_url]"></td></tr><tr><th>Tool Image</th><td><fieldset><input style="width:80%" type="text" id="saswp_howto_tool_image_'+i+"_"+a+'" name="saswp_howto_tool_image_'+i+"_"+a+'"><input type="hidden" data-id="saswp_howto_tool_image_'+i+"_"+a+'_id" name="howto_tool_'+a+"["+i+'][saswp_howto_tool_image_id]" id="saswp_howto_tool_image_'+i+"_"+a+'_id"><input data-id="media" style="width: 19%" class="button" id="saswp_howto_tool_image_'+i+"_"+a+'_button" name="saswp_howto_tool_image_'+i+"_"+a+'_button" type="button" value="Upload"><div class="saswp_image_div_saswp_howto_tool_image_'+i+"_"+a+'"></div></fieldset></td></tr></table></div>')&&s('.saswp-how-to-tool-section[data-id="'+a+'"]').append(o)}),s(document).on("click",".saswp-how-to-step",function(e){e.preventDefault();var a=s(this).attr("data-id"),t=s(".saswp-how-to-step-table-div").length,i=s(".saswp-how-to-step-table-div:nth-child("+t+")").attr("data-id");(i=++i)||(i=0);var o="";(o+='<div class="saswp-how-to-step-table-div" data-id="'+i+'"><a class="saswp-table-close">X</a><table class="form-table saswp-how-to-step-table"><tr><th>Step Name</th><td><input style="width:100%" type="text" id="saswp_howto_step_name_'+i+"_"+a+'" name="howto_step_'+a+"["+i+'][saswp_howto_step_name]" ></td></tr><tr><th>HowToDirection Text</th><td><input style="width:100%" type="text" id="saswp_howto_direction_text_'+i+"_"+a+'" name="howto_step_'+a+"["+i+'][saswp_howto_direction_text]"></td></tr><tr><th>HowToTip Text</th><td><input style="width:100%" type="text" id="saswp_howto_tip_text_'+i+"_"+a+'" name="howto_step_'+a+"["+i+'][saswp_howto_tip_text]"></td></tr><tr><th>Step Image</th><td><fieldset><input style="width:80%" type="text" id="saswp_howto_step_image_'+i+"_"+a+'" name="saswp_howto_step_image_'+a+"["+i+']"><input type="hidden" data-id="saswp_howto_step_image_'+i+"_"+a+'_id" name="howto_step_'+a+"["+i+'][saswp_howto_step_image_id]" id="saswp_howto_step_image_'+i+"_"+a+'_id"><input data-id="media" style="width: 19%" class="button" id="saswp_howto_step_image_'+i+"_"+a+'_button" name="saswp_howto_step_image_'+i+"_"+a+'_button" type="button" value="Upload"><div class="saswp_image_div_saswp_howto_step_image_'+i+"_"+a+'"></div></fieldset></td></tr></table></div>')&&s('.saswp-how-to-step-section[data-id="'+a+'"]').append(o)}),s(document).on("click",".saswp-table-close",function(){s(this).parent().remove()}),s(document).on("click",".saswp-add-custom-fields",function(){var e=s("select#schema_type option:selected").val(),a=s("#post_ID").val();""!=e&&s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_get_schema_type_fields",post_id:a,schema_type:e,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){if(0!=e.length){var a=0,t="",i="<tr>";i+="<td>",i+='<select class="saswp-custom-fields-name">',s.each(e,function(s,e){0==a&&(t=s),i+='<option value="'+s+'">'+e+"</option>",a++}),i+="</select>",i+="</td>",i+="<td>",i+='<select class="saswp-custom-fields-select2" name="saswp_custom_fields['+t+']">',i+="</select>",i+="</td>",i+="</tr>",s(".saswp-custom-fields-table").append(i),n()}},error:function(s){console.log(s)}})}),n(),c(),s('a[href="'+saswp_localize_data.collection_post_add_url+'"]').attr("href",saswp_localize_data.collection_post_add_new_url),s(document).on("click",".saswp_coonect_google_place",function(){var e=s("#saswp_google_place_id").val(),a=s("#saswp_language_list").val(),t=s("#saswp_googel_api").val();""!=e&&s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_connect_google_place",place_id:e,language:a,google_api:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){console.log(s.status)},error:function(s){console.log(s)}})}),"saswp"==saswp_localize_data.post_type&&"edit.php"==saswp_localize_data.page_now&&jQuery(jQuery(".wrap a")[0]).after("<a href='"+saswp_localize_data.saswp_settings_url+"' id='' class='page-title-action'>Settings</a>")});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output/output.php
CHANGED
@@ -2071,7 +2071,8 @@ function saswp_post_specific_schema_output() {
|
|
2071 |
|
2072 |
$supply_data = array();
|
2073 |
$supply_data['@type'] = 'HowToSupply';
|
2074 |
-
$supply_data['name']
|
|
|
2075 |
|
2076 |
if(isset($val['saswp_howto_supply_image_id'])){
|
2077 |
|
@@ -2098,6 +2099,7 @@ function saswp_post_specific_schema_output() {
|
|
2098 |
$supply_data = array();
|
2099 |
$supply_data['@type'] = 'HowToTool';
|
2100 |
$supply_data['name'] = $val['saswp_howto_tool_name'];
|
|
|
2101 |
|
2102 |
if(isset($val['saswp_howto_tool_image_id'])){
|
2103 |
|
@@ -3757,9 +3759,9 @@ function saswp_archive_output(){
|
|
3757 |
"logo" => array(
|
3758 |
"@type" => "ImageObject",
|
3759 |
"name" => esc_attr($site_name),
|
3760 |
-
"width" => esc_attr($logo['width']),
|
3761 |
-
"height" => esc_attr($logo['height']),
|
3762 |
-
"url" =>
|
3763 |
)
|
3764 |
);
|
3765 |
|
@@ -3897,12 +3899,12 @@ function saswp_about_page_output(){
|
|
3897 |
|
3898 |
if(!empty($feature_image)){
|
3899 |
|
3900 |
-
|
3901 |
|
3902 |
}
|
3903 |
if(!empty($publisher)){
|
3904 |
|
3905 |
-
|
3906 |
|
3907 |
}
|
3908 |
return apply_filters('saswp_modify_about_page_output', $input);
|
2071 |
|
2072 |
$supply_data = array();
|
2073 |
$supply_data['@type'] = 'HowToSupply';
|
2074 |
+
$supply_data['name'] = $val['saswp_howto_supply_name'];
|
2075 |
+
$supply_data['url'] = $val['saswp_howto_supply_url'];
|
2076 |
|
2077 |
if(isset($val['saswp_howto_supply_image_id'])){
|
2078 |
|
2099 |
$supply_data = array();
|
2100 |
$supply_data['@type'] = 'HowToTool';
|
2101 |
$supply_data['name'] = $val['saswp_howto_tool_name'];
|
2102 |
+
$supply_data['url'] = $val['saswp_howto_tool_url'];
|
2103 |
|
2104 |
if(isset($val['saswp_howto_tool_image_id'])){
|
2105 |
|
3759 |
"logo" => array(
|
3760 |
"@type" => "ImageObject",
|
3761 |
"name" => esc_attr($site_name),
|
3762 |
+
"width" => isset($logo['width']) ? esc_attr($logo['width']):'',
|
3763 |
+
"height" => isset($logo['height']) ? esc_attr($logo['height']):'',
|
3764 |
+
"url" => isset($logo['url']) ? esc_attr($logo['url']):''
|
3765 |
)
|
3766 |
);
|
3767 |
|
3899 |
|
3900 |
if(!empty($feature_image)){
|
3901 |
|
3902 |
+
$input = array_merge($input, $feature_image);
|
3903 |
|
3904 |
}
|
3905 |
if(!empty($publisher)){
|
3906 |
|
3907 |
+
$input = array_merge($input, $publisher);
|
3908 |
|
3909 |
}
|
3910 |
return apply_filters('saswp_modify_about_page_output', $input);
|
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.9
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -109,6 +109,12 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
|
|
109 |
|
110 |
== Changelog ==
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
= 1.8.9 (08 July 2019) =
|
113 |
|
114 |
* Added: Translation panel. User can add own text for List of labels which is being output in content #361
|
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.9.1
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
109 |
|
110 |
== Changelog ==
|
111 |
|
112 |
+
= 1.8.9.1 (09 July 2019) =
|
113 |
+
|
114 |
+
* Bug Fixed: Undefined variable: schema in /view/post_specific.php #376
|
115 |
+
* Bug Fixed: URL Field is Recommended in How to supply schema. #375
|
116 |
+
* Bug Fixed: The text inside tag 'script type=application/ld+json' contains 'html comments', which is disallowed. #374
|
117 |
+
|
118 |
= 1.8.9 (08 July 2019) =
|
119 |
|
120 |
* Added: Translation panel. User can add own text for List of labels which is being output in content #361
|
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.9
|
6 |
Text Domain: schema-and-structured-data-for-wp
|
7 |
Domain Path: /languages
|
8 |
Author: Magazine3
|
@@ -13,7 +13,7 @@ License: GPL2
|
|
13 |
// Exit if accessed directly.
|
14 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
15 |
|
16 |
-
define('SASWP_VERSION', '1.8.9');
|
17 |
define('SASWP_DIR_NAME_FILE', __FILE__ );
|
18 |
define('SASWP_DIR_NAME', dirname( __FILE__ ));
|
19 |
define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
|
2 |
/*
|
3 |
Plugin Name: Schema & Structured Data for WP
|
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.9.1
|
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.9.1');
|
17 |
define('SASWP_DIR_NAME_FILE', __FILE__ );
|
18 |
define('SASWP_DIR_NAME', dirname( __FILE__ ));
|
19 |
define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
|
view/post_specific.php
CHANGED
@@ -157,6 +157,11 @@ class saswp_post_specific {
|
|
157 |
'name' => 'saswp_howto_supply_name',
|
158 |
'type' => 'text',
|
159 |
),
|
|
|
|
|
|
|
|
|
|
|
160 |
array(
|
161 |
'label' => 'Supply Image',
|
162 |
'name' => 'saswp_howto_supply_image',
|
@@ -176,6 +181,11 @@ class saswp_post_specific {
|
|
176 |
'name' => 'saswp_howto_tool_name',
|
177 |
'type' => 'text',
|
178 |
),
|
|
|
|
|
|
|
|
|
|
|
179 |
array(
|
180 |
'label' => 'Tool Image',
|
181 |
'name' => 'saswp_howto_tool_image',
|
@@ -256,8 +266,7 @@ class saswp_post_specific {
|
|
256 |
);
|
257 |
|
258 |
break;
|
259 |
-
|
260 |
-
|
261 |
case 'tvseries_actor':
|
262 |
|
263 |
$meta_fields = array(
|
@@ -1234,7 +1243,7 @@ class saswp_post_specific {
|
|
1234 |
echo '<div class="saswp-add-custom-schema-field saswp_hide">';
|
1235 |
}
|
1236 |
|
1237 |
-
echo '<a class="button saswp-delete-custom-schema">Delete Custom Schema</a>';
|
1238 |
echo '<textarea style="margin-left:5px;" placeholder="{ Json Markup }" id="saswp_custom_schema_field" name="saswp_custom_schema_field" rows="5" cols="100">'
|
1239 |
. $custom_markup
|
1240 |
. '</textarea>';
|
@@ -1269,21 +1278,21 @@ class saswp_post_specific {
|
|
1269 |
}
|
1270 |
if($schema_type == 'MedicalCondition'){
|
1271 |
|
1272 |
-
$mc_data['mc_cause_'.$
|
1273 |
-
$mc_data['mc_symptom_'.$
|
1274 |
-
$mc_data['mc_risk_factor_'.$
|
1275 |
|
1276 |
}
|
1277 |
if($schema_type == 'TVSeries'){
|
1278 |
|
1279 |
-
$tvseries_data['tvseries_actor_'.$
|
1280 |
-
$tvseries_data['tvseries_season_'.$
|
1281 |
|
1282 |
}
|
1283 |
|
1284 |
if($schema_type == 'Trip'){
|
1285 |
|
1286 |
-
$trip_data['trip_itinerary_'.$
|
1287 |
|
1288 |
}
|
1289 |
|
@@ -1304,7 +1313,7 @@ class saswp_post_specific {
|
|
1304 |
//How to schema starts here
|
1305 |
if($schema_type == 'HowTo'){
|
1306 |
|
1307 |
-
$schema_id = $
|
1308 |
|
1309 |
$tabs_fields .= '<div class="saswp-table-create-onajax">';
|
1310 |
|
@@ -1410,7 +1419,7 @@ class saswp_post_specific {
|
|
1410 |
//Medical condition schema starts here
|
1411 |
if($schema_type == 'MedicalCondition'){
|
1412 |
|
1413 |
-
$schema_id = $
|
1414 |
|
1415 |
$tabs_fields .= '<div class="saswp-table-create-onajax">';
|
1416 |
|
@@ -1517,7 +1526,7 @@ class saswp_post_specific {
|
|
1517 |
//TVSeries schema starts herre
|
1518 |
if($schema_type == 'TVSeries'){
|
1519 |
|
1520 |
-
$schema_id = $
|
1521 |
|
1522 |
$tabs_fields .= '<div class="saswp-table-create-onajax">';
|
1523 |
|
@@ -1595,7 +1604,7 @@ class saswp_post_specific {
|
|
1595 |
//Trip schema starts herre
|
1596 |
if($schema_type == 'Trip'){
|
1597 |
|
1598 |
-
$schema_id = $
|
1599 |
|
1600 |
$tabs_fields .= '<div class="saswp-table-create-onajax">';
|
1601 |
|
157 |
'name' => 'saswp_howto_supply_name',
|
158 |
'type' => 'text',
|
159 |
),
|
160 |
+
array(
|
161 |
+
'label' => 'Supply URL',
|
162 |
+
'name' => 'saswp_howto_supply_url',
|
163 |
+
'type' => 'text',
|
164 |
+
),
|
165 |
array(
|
166 |
'label' => 'Supply Image',
|
167 |
'name' => 'saswp_howto_supply_image',
|
181 |
'name' => 'saswp_howto_tool_name',
|
182 |
'type' => 'text',
|
183 |
),
|
184 |
+
array(
|
185 |
+
'label' => 'Tool URL',
|
186 |
+
'name' => 'saswp_howto_tool_url',
|
187 |
+
'type' => 'text',
|
188 |
+
),
|
189 |
array(
|
190 |
'label' => 'Tool Image',
|
191 |
'name' => 'saswp_howto_tool_image',
|
266 |
);
|
267 |
|
268 |
break;
|
269 |
+
|
|
|
270 |
case 'tvseries_actor':
|
271 |
|
272 |
$meta_fields = array(
|
1243 |
echo '<div class="saswp-add-custom-schema-field saswp_hide">';
|
1244 |
}
|
1245 |
|
1246 |
+
echo '<a class="button saswp-delete-custom-schema">'.esc_html__( 'Delete Custom Schema', 'schema-and-structured-data-for-wp' ).'</a>';
|
1247 |
echo '<textarea style="margin-left:5px;" placeholder="{ Json Markup }" id="saswp_custom_schema_field" name="saswp_custom_schema_field" rows="5" cols="100">'
|
1248 |
. $custom_markup
|
1249 |
. '</textarea>';
|
1278 |
}
|
1279 |
if($schema_type == 'MedicalCondition'){
|
1280 |
|
1281 |
+
$mc_data['mc_cause_'.$all_schema[0]->ID] = esc_sql ( get_post_meta($post->ID, 'mc_cause_'.$all_schema[0]->ID, true) );
|
1282 |
+
$mc_data['mc_symptom_'.$all_schema[0]->ID] = esc_sql ( get_post_meta($post->ID, 'mc_symptom_'.$all_schema[0]->ID, true) );
|
1283 |
+
$mc_data['mc_risk_factor_'.$all_schema[0]->ID] = esc_sql ( get_post_meta($post->ID, 'mc_risk_factor_'.$all_schema[0]->ID, true) );
|
1284 |
|
1285 |
}
|
1286 |
if($schema_type == 'TVSeries'){
|
1287 |
|
1288 |
+
$tvseries_data['tvseries_actor_'.$all_schema[0]->ID] = esc_sql ( get_post_meta($post->ID, 'tvseries_actor_'.$all_schema[0]->ID, true) );
|
1289 |
+
$tvseries_data['tvseries_season_'.$all_schema[0]->ID] = esc_sql ( get_post_meta($post->ID, 'tvseries_season_'.$all_schema[0]->ID, true) );
|
1290 |
|
1291 |
}
|
1292 |
|
1293 |
if($schema_type == 'Trip'){
|
1294 |
|
1295 |
+
$trip_data['trip_itinerary_'.$all_schema[0]->ID] = esc_sql ( get_post_meta($post->ID, 'trip_itinerary_'.$all_schema[0]->ID, true) );
|
1296 |
|
1297 |
}
|
1298 |
|
1313 |
//How to schema starts here
|
1314 |
if($schema_type == 'HowTo'){
|
1315 |
|
1316 |
+
$schema_id = $all_schema[0]->ID;
|
1317 |
|
1318 |
$tabs_fields .= '<div class="saswp-table-create-onajax">';
|
1319 |
|
1419 |
//Medical condition schema starts here
|
1420 |
if($schema_type == 'MedicalCondition'){
|
1421 |
|
1422 |
+
$schema_id = $all_schema[0]->ID;
|
1423 |
|
1424 |
$tabs_fields .= '<div class="saswp-table-create-onajax">';
|
1425 |
|
1526 |
//TVSeries schema starts herre
|
1527 |
if($schema_type == 'TVSeries'){
|
1528 |
|
1529 |
+
$schema_id = $all_schema[0]->ID;
|
1530 |
|
1531 |
$tabs_fields .= '<div class="saswp-table-create-onajax">';
|
1532 |
|
1604 |
//Trip schema starts herre
|
1605 |
if($schema_type == 'Trip'){
|
1606 |
|
1607 |
+
$schema_id = $all_schema[0]->ID;
|
1608 |
|
1609 |
$tabs_fields .= '<div class="saswp-table-create-onajax">';
|
1610 |
|