Version Description
(24 October 2018) = * Schema Pro migrator * Import / export functionality, so it can be transferred from staging to live website * Added WP Recipe Maker and WP Ultimate Recipe plugins compatibility * Added compatibility with FlexMLS IDX plugin * Tested security issue and fixed * Breadcrumbs bug fixed * Debug errors * Minor Bugs Fixed
Download this release
Release Info
Developer | ampforwp |
Plugin | Schema & Structured Data for WP & AMP |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.2.1 to 1.0.3
- admin_section/add-schema/add_new.php +20 -15
- admin_section/common-function.php +483 -7
- admin_section/css/main-style.css +25 -1
- admin_section/fields-generator.php +19 -4
- admin_section/js/main-script.js +20 -14
- admin_section/newsletter.php +2 -2
- admin_section/plugin-installer/install.php +28 -19
- admin_section/settings.php +168 -14
- admin_section/structure_admin.php +46 -26
- output/flexmls.php +279 -0
- output/function.php +6 -10
- output/output.php +24 -16
- readme.txt +11 -5
- structured-data-for-wp.php +13 -13
- view/schema_type.php +113 -116
admin_section/add-schema/add_new.php
CHANGED
@@ -111,7 +111,7 @@ $saswp_add_data_type_config = array(
|
|
111 |
|
112 |
</div>
|
113 |
|
114 |
-
<?php echo sprintf( '<a class="return-to-dashboard" href="%s">%s</a>', esc_url( admin_url( 'edit.php?post_type=saswp' ) ),
|
115 |
|
116 |
</div>
|
117 |
|
@@ -142,7 +142,7 @@ $saswp_add_data_type_config = array(
|
|
142 |
<head>
|
143 |
<meta name="viewport" content="width=device-width"/>
|
144 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
145 |
-
<title><?php echo ucwords($current_step); ?></title>
|
146 |
<?php do_action( 'admin_print_styles' ); ?>
|
147 |
<?php do_action( 'admin_print_scripts' ); ?>
|
148 |
<?php do_action( 'admin_head' ); ?>
|
@@ -165,7 +165,7 @@ $saswp_add_data_type_config = array(
|
|
165 |
<circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
|
166 |
</svg>
|
167 |
|
168 |
-
<h1><?php echo $stepDetails['title']; ?></h1>
|
169 |
|
170 |
<p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
|
171 |
|
@@ -190,10 +190,10 @@ $saswp_add_data_type_config = array(
|
|
190 |
<footer class="merlin__content__footer">
|
191 |
<?php saswp_add_new_skip_button(); ?>
|
192 |
|
193 |
-
<a id="skip" href="<?php echo esc_url( saswp_add_new_step_next_link() ); ?>" class="merlin__button merlin__button--skip merlin__button--proceed"><?php echo
|
194 |
|
195 |
<a href="<?php echo esc_url( saswp_add_new_step_next_link() ); ?>" class="merlin__button merlin__button--next button-next" data-callback="save_logo">
|
196 |
-
<span class="merlin__button--loading__text"><?php echo
|
197 |
</a>
|
198 |
|
199 |
<?php wp_nonce_field( 'saswp_add_new_nonce' ); ?>
|
@@ -214,7 +214,7 @@ $saswp_add_data_type_config = array(
|
|
214 |
<circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
|
215 |
</svg>
|
216 |
|
217 |
-
<h1><?php echo $stepDetails['title']; ?></h1>
|
218 |
<p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
|
219 |
</div>
|
220 |
<form action="" method="post">
|
@@ -242,7 +242,7 @@ $saswp_add_data_type_config = array(
|
|
242 |
|
243 |
</li>
|
244 |
<li>
|
245 |
-
<input type="hidden" name="saswp_post_id" id="saswp_post_id" value="<?php echo $last_post_id; ?>">
|
246 |
</li>
|
247 |
</ul>
|
248 |
</div>
|
@@ -251,10 +251,10 @@ $saswp_add_data_type_config = array(
|
|
251 |
<footer class="merlin__content__footer">
|
252 |
<?php saswp_add_new_skip_button(); ?>
|
253 |
|
254 |
-
<a id="skip" href="<?php echo esc_url( saswp_add_new_step_next_link() ); ?>" class="merlin__button merlin__button--skip merlin__button--proceed"><?php echo
|
255 |
|
256 |
<a href="<?php echo esc_url( saswp_add_new_step_next_link() ); ?>" class="merlin__button merlin__button--next button-next" data-callback="save_logo">
|
257 |
-
<span class="merlin__button--loading__text"><?php echo
|
258 |
</a>
|
259 |
|
260 |
<?php wp_nonce_field( 'saswp_add_new_nonce' ); ?>
|
@@ -276,7 +276,7 @@ $saswp_add_data_type_config = array(
|
|
276 |
<circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
|
277 |
</svg>
|
278 |
|
279 |
-
<h1><?php echo $stepDetails['title']; ?></h1>
|
280 |
|
281 |
<p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
|
282 |
|
@@ -295,10 +295,10 @@ $saswp_add_data_type_config = array(
|
|
295 |
<footer class="merlin__content__footer">
|
296 |
<?php saswp_add_new_skip_button(); ?>
|
297 |
|
298 |
-
<a id="skip" href="<?php echo esc_url( saswp_add_new_step_next_link() ); ?>" class="merlin__button merlin__button--skip merlin__button--proceed"><?php echo
|
299 |
|
300 |
<a href="<?php echo esc_url( saswp_add_new_step_next_link() ); ?>" class="merlin__button merlin__button--next button-next" data-callback="save_logo">
|
301 |
-
<span class="merlin__button--loading__text"><?php echo
|
302 |
</a>
|
303 |
|
304 |
<?php wp_nonce_field( 'saswp_add_new_nonce' ); ?>
|
@@ -311,7 +311,12 @@ $saswp_add_data_type_config = array(
|
|
311 |
|
312 |
|
313 |
function saswp_add_new_save_steps_data(){
|
314 |
-
|
|
|
|
|
|
|
|
|
|
|
315 |
if(isset($_POST['schema_type'])){
|
316 |
$schema_type = $_POST['schema_type'];
|
317 |
$user_id = get_current_user_id();
|
@@ -373,7 +378,7 @@ $saswp_add_data_type_config = array(
|
|
373 |
|
374 |
function saswp_add_new_skip_button(){
|
375 |
?>
|
376 |
-
<a href="<?php echo esc_url( saswp_add_new_step_next_link() ); ?>" class="merlin__button merlin__button--skip"><?php echo
|
377 |
<?php
|
378 |
}
|
379 |
function saswp_add_new_finish_page() {
|
@@ -460,7 +465,7 @@ $saswp_add_data_type_config = array(
|
|
460 |
<head>
|
461 |
<meta name="viewport" content="width=device-width"/>
|
462 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
463 |
-
<title><?php echo ucwords($current_step); ?></title>
|
464 |
<?php do_action( 'admin_print_styles' ); ?>
|
465 |
<?php do_action( 'admin_print_scripts' ); ?>
|
466 |
<?php do_action( 'admin_head' ); ?>
|
111 |
|
112 |
</div>
|
113 |
|
114 |
+
<?php echo sprintf( '<a class="return-to-dashboard" href="%s">%s</a>', esc_url( admin_url( 'edit.php?post_type=saswp' ) ), esc_html__( 'Return to dashboard', 'schema-and-structured-data-for-wp' ) ); ?>
|
115 |
|
116 |
</div>
|
117 |
|
142 |
<head>
|
143 |
<meta name="viewport" content="width=device-width"/>
|
144 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
145 |
+
<title><?php echo esc_attr(ucwords($current_step)); ?></title>
|
146 |
<?php do_action( 'admin_print_styles' ); ?>
|
147 |
<?php do_action( 'admin_print_scripts' ); ?>
|
148 |
<?php do_action( 'admin_head' ); ?>
|
165 |
<circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
|
166 |
</svg>
|
167 |
|
168 |
+
<h1><?php echo esc_attr($stepDetails['title']); ?></h1>
|
169 |
|
170 |
<p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
|
171 |
|
190 |
<footer class="merlin__content__footer">
|
191 |
<?php saswp_add_new_skip_button(); ?>
|
192 |
|
193 |
+
<a id="skip" href="<?php echo esc_url( saswp_add_new_step_next_link() ); ?>" class="merlin__button merlin__button--skip merlin__button--proceed"><?php echo esc_html__( 'Skip', 'schema-and-structured-data-for-wp' ); ?></a>
|
194 |
|
195 |
<a href="<?php echo esc_url( saswp_add_new_step_next_link() ); ?>" class="merlin__button merlin__button--next button-next" data-callback="save_logo">
|
196 |
+
<span class="merlin__button--loading__text"><?php echo esc_html__( 'Next', 'schema-and-structured-data-for-wp' ); ?></span><?php echo saswp_add_new_loading_spinner(); ?>
|
197 |
</a>
|
198 |
|
199 |
<?php wp_nonce_field( 'saswp_add_new_nonce' ); ?>
|
214 |
<circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
|
215 |
</svg>
|
216 |
|
217 |
+
<h1><?php echo esc_attr($stepDetails['title']); ?></h1>
|
218 |
<p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
|
219 |
</div>
|
220 |
<form action="" method="post">
|
242 |
|
243 |
</li>
|
244 |
<li>
|
245 |
+
<input type="hidden" name="saswp_post_id" id="saswp_post_id" value="<?php echo esc_attr($last_post_id); ?>">
|
246 |
</li>
|
247 |
</ul>
|
248 |
</div>
|
251 |
<footer class="merlin__content__footer">
|
252 |
<?php saswp_add_new_skip_button(); ?>
|
253 |
|
254 |
+
<a id="skip" href="<?php echo esc_url( saswp_add_new_step_next_link() ); ?>" class="merlin__button merlin__button--skip merlin__button--proceed"><?php echo esc_html__( 'Skip', 'schema-and-structured-data-for-wp' ); ?></a>
|
255 |
|
256 |
<a href="<?php echo esc_url( saswp_add_new_step_next_link() ); ?>" class="merlin__button merlin__button--next button-next" data-callback="save_logo">
|
257 |
+
<span class="merlin__button--loading__text"><?php echo esc_html__( 'Next', 'schema-and-structured-data-for-wp' ); ?></span><?php echo saswp_add_new_loading_spinner(); ?>
|
258 |
</a>
|
259 |
|
260 |
<?php wp_nonce_field( 'saswp_add_new_nonce' ); ?>
|
276 |
<circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
|
277 |
</svg>
|
278 |
|
279 |
+
<h1><?php echo esc_attr($stepDetails['title']); ?></h1>
|
280 |
|
281 |
<p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
|
282 |
|
295 |
<footer class="merlin__content__footer">
|
296 |
<?php saswp_add_new_skip_button(); ?>
|
297 |
|
298 |
+
<a id="skip" href="<?php echo esc_url( saswp_add_new_step_next_link() ); ?>" class="merlin__button merlin__button--skip merlin__button--proceed"><?php echo esc_html__( 'Skip', 'schema-and-structured-data-for-wp' ); ?></a>
|
299 |
|
300 |
<a href="<?php echo esc_url( saswp_add_new_step_next_link() ); ?>" class="merlin__button merlin__button--next button-next" data-callback="save_logo">
|
301 |
+
<span class="merlin__button--loading__text"><?php echo esc_html__( 'Next', 'schema-and-structured-data-for-wp' ); ?></span><?php echo saswp_add_new_loading_spinner(); ?>
|
302 |
</a>
|
303 |
|
304 |
<?php wp_nonce_field( 'saswp_add_new_nonce' ); ?>
|
311 |
|
312 |
|
313 |
function saswp_add_new_save_steps_data(){
|
314 |
+
if ( ! isset( $_POST['wpnonce'] ) ){
|
315 |
+
return;
|
316 |
+
}
|
317 |
+
if ( !wp_verify_nonce( $_POST['wpnonce'], 'saswp_add_new_nonce' ) ){
|
318 |
+
return;
|
319 |
+
}
|
320 |
if(isset($_POST['schema_type'])){
|
321 |
$schema_type = $_POST['schema_type'];
|
322 |
$user_id = get_current_user_id();
|
378 |
|
379 |
function saswp_add_new_skip_button(){
|
380 |
?>
|
381 |
+
<a href="<?php echo esc_url( saswp_add_new_step_next_link() ); ?>" class="merlin__button merlin__button--skip"><?php echo esc_html__( 'Skip', 'schema-and-structured-data-for-wp' ); ?></a>
|
382 |
<?php
|
383 |
}
|
384 |
function saswp_add_new_finish_page() {
|
465 |
<head>
|
466 |
<meta name="viewport" content="width=device-width"/>
|
467 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
468 |
+
<title><?php echo esc_attr(ucwords($current_step)); ?></title>
|
469 |
<?php do_action( 'admin_print_styles' ); ?>
|
470 |
<?php do_action( 'admin_print_scripts' ); ?>
|
471 |
<?php do_action( 'admin_head' ); ?>
|
admin_section/common-function.php
CHANGED
@@ -1,5 +1,134 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
/**
|
4 |
* We are here fetching all schema and its settings from schema plugin
|
5 |
* note: Transaction is applied on this function, if any error occure all the data will be rollbacked
|
@@ -96,8 +225,7 @@
|
|
96 |
}
|
97 |
|
98 |
//Importing settings starts here
|
99 |
-
|
100 |
-
|
101 |
$schema_plugin_options = get_option('schema_wp_settings');
|
102 |
$custom_logo_id = get_theme_mod( 'custom_logo' );
|
103 |
$logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
|
@@ -118,8 +246,7 @@
|
|
118 |
'saswp-logo-height' => '60',
|
119 |
'sd_initial_wizard_status' =>1,
|
120 |
|
121 |
-
|
122 |
-
|
123 |
if(isset($schema_plugin_options['facebook'])){
|
124 |
$saswp_plugin_options['sd_facebook'] = $schema_plugin_options['facebook'];
|
125 |
$saswp_plugin_options['saswp-facebook-enable'] = 1;
|
@@ -194,7 +321,355 @@
|
|
194 |
//Importing settings ends here
|
195 |
|
196 |
if (is_wp_error($result) ){
|
197 |
-
echo $result->get_error_message();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
$wpdb->query('ROLLBACK');
|
199 |
}else{
|
200 |
$wpdb->query('COMMIT');
|
@@ -265,7 +740,8 @@ function saswp_expanded_allowed_tags() {
|
|
265 |
'id' => array(),
|
266 |
'name' => array(),
|
267 |
'value' => array(),
|
268 |
-
'type' => array(),
|
|
|
269 |
);
|
270 |
// options
|
271 |
$my_allowed['option'] = array(
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* We are here fetching all schema and its settings from backup files
|
4 |
+
* note: Transaction is applied on this function, if any error occure all the data will be rollbacked
|
5 |
+
* @global type $wpdb
|
6 |
+
* @return boolean
|
7 |
+
*/
|
8 |
+
add_action('admin_init', 'saswp_import_all_settings_and_schema',9);
|
9 |
+
function saswp_import_all_settings_and_schema(){
|
10 |
+
$url = get_option('saswp-file-upload_url');
|
11 |
+
global $wpdb;
|
12 |
+
if($url){
|
13 |
+
$json_data = file_get_contents($url);
|
14 |
+
$json_array = json_decode($json_data, true);
|
15 |
+
$all_schema_post = $json_array['posts'];
|
16 |
+
|
17 |
+
$sd_data = $json_array['sd_data'];
|
18 |
+
$schema_post = array();
|
19 |
+
if($all_schema_post){
|
20 |
+
// begin transaction
|
21 |
+
$wpdb->query('START TRANSACTION');
|
22 |
+
foreach($all_schema_post as $schema_post){
|
23 |
+
$post_id = wp_insert_post($schema_post['post']);
|
24 |
+
$result = $post_id;
|
25 |
+
$guid = get_option('siteurl') .'/?post_type=saswp&p='.$post_id;
|
26 |
+
$wpdb->get_results("UPDATE wp_posts SET guid ='".$guid."' WHERE ID ='".$post_id."'");
|
27 |
+
|
28 |
+
if ( isset( $schema_post['schema_type'] ) ){
|
29 |
+
update_post_meta( $post_id, 'schema_type', esc_attr( $schema_post['schema_type'] ) );
|
30 |
+
}
|
31 |
+
|
32 |
+
if ( isset( $schema_post['saswp_business_type'] ) ){
|
33 |
+
update_post_meta( $post_id, 'saswp_business_type', $schema_post['saswp_business_type'] );
|
34 |
+
}
|
35 |
+
|
36 |
+
if ( isset( $schema_post['saswp_business_name'] ) ){
|
37 |
+
update_post_meta( $post_id, 'saswp_business_name', $schema_post['saswp_business_name'] );
|
38 |
+
}
|
39 |
+
|
40 |
+
if ( isset( $schema_post['saswp_local_business_details'] ) ){
|
41 |
+
update_post_meta( $post_id, 'saswp_local_business_details', $schema_post['saswp_local_business_details'] );
|
42 |
+
}
|
43 |
+
if ( isset( $schema_post['data_group_array'] ) ){
|
44 |
+
update_post_meta( $post_id, 'data_group_array', $schema_post['data_group_array'] );
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
update_option('sd_data', $sd_data);
|
49 |
+
update_option('saswp-file-upload_url','');
|
50 |
+
}
|
51 |
+
if (is_wp_error($result) ){
|
52 |
+
echo esc_attr($result->get_error_message());
|
53 |
+
$wpdb->query('ROLLBACK');
|
54 |
+
}else{
|
55 |
+
$wpdb->query('COMMIT');
|
56 |
+
return true;
|
57 |
+
}
|
58 |
+
|
59 |
+
|
60 |
+
}
|
61 |
+
/**
|
62 |
+
* We are here exporting all schema types and its settings as a backup file
|
63 |
+
* @global type $wpdb
|
64 |
+
* @return boolean
|
65 |
+
*/
|
66 |
+
function saswp_export_all_settings_and_schema(){
|
67 |
+
$export_data = array();
|
68 |
+
$export_data_all = array();
|
69 |
+
$schema_post = array();
|
70 |
+
$user_id = get_current_user_id();
|
71 |
+
$all_schema_post = get_posts(
|
72 |
+
array(
|
73 |
+
'post_type' => 'saswp',
|
74 |
+
'posts_per_page' => -1,
|
75 |
+
'post_status' => 'any',
|
76 |
+
)
|
77 |
+
);
|
78 |
+
if($all_schema_post){
|
79 |
+
foreach($all_schema_post as $schema){
|
80 |
+
|
81 |
+
$schema_post = array(
|
82 |
+
'post_author' => $user_id,
|
83 |
+
'post_date' => $schema->post_date,
|
84 |
+
'post_date_gmt' => $schema->post_date_gmt,
|
85 |
+
'post_content' => $schema->post_content,
|
86 |
+
'post_title' => $schema->post_title,
|
87 |
+
'post_excerpt' => $schema->post_excerpt,
|
88 |
+
'post_status' => $schema->post_status,
|
89 |
+
'comment_status' => $schema->comment_status,
|
90 |
+
'ping_status' => $schema->ping_status,
|
91 |
+
'post_password' => $schema->post_password,
|
92 |
+
'post_name' => $schema->post_name,
|
93 |
+
'to_ping' => $schema->to_ping,
|
94 |
+
'pinged' => $schema->pinged,
|
95 |
+
'post_modified' => $schema->post_modified,
|
96 |
+
'post_modified_gmt' => $schema->post_modified_gmt,
|
97 |
+
'post_content_filtered' => $schema->post_content_filtered,
|
98 |
+
'post_parent' => $schema->post_parent,
|
99 |
+
'menu_order' => $schema->menu_order,
|
100 |
+
'post_type' => 'saswp',
|
101 |
+
'post_mime_type' => $schema->post_mime_type,
|
102 |
+
'comment_count' => $schema->comment_count,
|
103 |
+
'filter' => $schema->filter,
|
104 |
+
);
|
105 |
+
$export_data[$schema->ID]['post'] = $schema_post;
|
106 |
+
|
107 |
+
$post_meta = get_post_meta($schema->ID, $key='', true );
|
108 |
+
$schema_type = $post_meta['schema_type'][0];
|
109 |
+
$local_business_type = $post_meta['saswp_business_type'][0];
|
110 |
+
$local_business_sub_type = $post_meta['saswp_business_name'][0];
|
111 |
+
$data_group_array = get_post_meta($schema->ID, $key='data_group_array', true );
|
112 |
+
$local_business_details = get_post_meta($schema->ID, $key='saswp_local_business_details', true );
|
113 |
+
|
114 |
+
|
115 |
+
$export_data[$schema->ID]['schema_type'] = $schema_type;
|
116 |
+
$export_data[$schema->ID]['saswp_business_type'] = $local_business_type;
|
117 |
+
$export_data[$schema->ID]['saswp_business_name'] = $local_business_sub_type;
|
118 |
+
$export_data[$schema->ID]['data_group_array'] = $data_group_array;
|
119 |
+
$export_data[$schema->ID]['saswp_local_business_details'] = $local_business_details;
|
120 |
+
}
|
121 |
+
|
122 |
+
$get_sd_data = get_option('sd_data');
|
123 |
+
$export_data_all['posts'] =$export_data;
|
124 |
+
$export_data_all['sd_data'] =$get_sd_data;
|
125 |
+
header('Content-type: application/json');
|
126 |
+
header('Content-disposition: attachment; filename=structuredatabackup.json');
|
127 |
+
echo json_encode($export_data_all);
|
128 |
+
}
|
129 |
+
wp_die();
|
130 |
+
}
|
131 |
+
add_action( 'wp_ajax_saswp_export_all_settings_and_schema', 'saswp_export_all_settings_and_schema');
|
132 |
/**
|
133 |
* We are here fetching all schema and its settings from schema plugin
|
134 |
* note: Transaction is applied on this function, if any error occure all the data will be rollbacked
|
225 |
}
|
226 |
|
227 |
//Importing settings starts here
|
228 |
+
|
|
|
229 |
$schema_plugin_options = get_option('schema_wp_settings');
|
230 |
$custom_logo_id = get_theme_mod( 'custom_logo' );
|
231 |
$logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
|
246 |
'saswp-logo-height' => '60',
|
247 |
'sd_initial_wizard_status' =>1,
|
248 |
|
249 |
+
);
|
|
|
250 |
if(isset($schema_plugin_options['facebook'])){
|
251 |
$saswp_plugin_options['sd_facebook'] = $schema_plugin_options['facebook'];
|
252 |
$saswp_plugin_options['saswp-facebook-enable'] = 1;
|
321 |
//Importing settings ends here
|
322 |
|
323 |
if (is_wp_error($result) ){
|
324 |
+
echo esc_attr($result->get_error_message());
|
325 |
+
$wpdb->query('ROLLBACK');
|
326 |
+
}else{
|
327 |
+
$wpdb->query('COMMIT');
|
328 |
+
return true;
|
329 |
+
}
|
330 |
+
}
|
331 |
+
|
332 |
+
}
|
333 |
+
|
334 |
+
function saswp_import_schema_pro_plugin_data(){
|
335 |
+
|
336 |
+
$schema_post = array();
|
337 |
+
global $wpdb;
|
338 |
+
$user_id = get_current_user_id();
|
339 |
+
$all_schema_post = get_posts(
|
340 |
+
array(
|
341 |
+
'post_type' => 'aiosrs-schema',
|
342 |
+
'posts_per_page' => -1,
|
343 |
+
'post_status' => 'any',
|
344 |
+
)
|
345 |
+
);
|
346 |
+
if($all_schema_post){
|
347 |
+
// begin transaction
|
348 |
+
$wpdb->query('START TRANSACTION');
|
349 |
+
foreach($all_schema_post as $schema){
|
350 |
+
|
351 |
+
$schema_post = array(
|
352 |
+
'post_author' => $user_id,
|
353 |
+
'post_date' => $schema->post_date,
|
354 |
+
'post_date_gmt' => $schema->post_date_gmt,
|
355 |
+
'post_content' => $schema->post_content,
|
356 |
+
'post_title' => $schema->post_title. ' (Migrated from Schema_pro plugin)',
|
357 |
+
'post_excerpt' => $schema->post_excerpt,
|
358 |
+
'post_status' => $schema->post_status,
|
359 |
+
'comment_status' => $schema->comment_status,
|
360 |
+
'ping_status' => $schema->ping_status,
|
361 |
+
'post_password' => $schema->post_password,
|
362 |
+
'post_name' => $schema->post_name,
|
363 |
+
'to_ping' => $schema->to_ping,
|
364 |
+
'pinged' => $schema->pinged,
|
365 |
+
'post_modified' => $schema->post_modified,
|
366 |
+
'post_modified_gmt' => $schema->post_modified_gmt,
|
367 |
+
'post_content_filtered' => $schema->post_content_filtered,
|
368 |
+
'post_parent' => $schema->post_parent,
|
369 |
+
'menu_order' => $schema->menu_order,
|
370 |
+
'post_type' => 'saswp',
|
371 |
+
'post_mime_type' => $schema->post_mime_type,
|
372 |
+
'comment_count' => $schema->comment_count,
|
373 |
+
'filter' => $schema->filter,
|
374 |
+
);
|
375 |
+
$post_id = wp_insert_post($schema_post);
|
376 |
+
$result = $post_id;
|
377 |
+
$guid = get_option('siteurl') .'/?post_type=saswp&p='.$post_id;
|
378 |
+
$wpdb->get_results("UPDATE wp_posts SET guid ='".$guid."' WHERE ID ='".$post_id."'");
|
379 |
+
|
380 |
+
$schema_post_meta = get_post_meta($schema->ID, $key='', true );
|
381 |
+
|
382 |
+
$schema_post_types = get_post_meta($schema->ID, $key='bsf-aiosrs-schema-type', true );
|
383 |
+
$schema_post_meta_box = get_post_meta($schema->ID, $key='bsf-aiosrs-'.$schema_post_types, true );
|
384 |
+
$schema_enable_location = get_post_meta($schema->ID, $key='bsf-aiosrs-schema-location', true );
|
385 |
+
$schema_exclude_location = get_post_meta($schema->ID, $key='bsf-aiosrs-schema-exclusion', true );
|
386 |
+
|
387 |
+
$data_array = array();
|
388 |
+
if($schema_exclude_location){
|
389 |
+
|
390 |
+
$exclude_rule = $schema_exclude_location['rule'];
|
391 |
+
$fields = array_flip($exclude_rule);
|
392 |
+
unset($fields['specifics']);
|
393 |
+
$exclude_rule = array_flip($fields);
|
394 |
+
$exclude_specific = $schema_exclude_location['specific'];
|
395 |
+
|
396 |
+
|
397 |
+
foreach($exclude_rule as $rule){
|
398 |
+
|
399 |
+
if($rule =='basic-singulars'){
|
400 |
+
$data_array['data_array'][] =array(
|
401 |
+
'key_1' => 'post_type',
|
402 |
+
'key_2' => 'not_equal',
|
403 |
+
'key_3' => 'post',
|
404 |
+
);
|
405 |
+
}else{
|
406 |
+
$explode = explode("|", $rule);
|
407 |
+
$data_array['data_array'][] =array(
|
408 |
+
'key_1' => 'post_type',
|
409 |
+
'key_2' => 'not_equal',
|
410 |
+
'key_3' => $explode[0],
|
411 |
+
);
|
412 |
+
}
|
413 |
+
}
|
414 |
+
|
415 |
+
foreach ($exclude_specific as $rule){
|
416 |
+
|
417 |
+
$explode = explode("-", $rule);
|
418 |
+
$specific_post_name = $explode[0];
|
419 |
+
$specific_post_id = $explode[1];
|
420 |
+
|
421 |
+
if($specific_post_name =='post'){
|
422 |
+
|
423 |
+
$specific_post_type = get_post_type($specific_post_id);
|
424 |
+
$data_array['data_array'][] =array(
|
425 |
+
'key_1' => $specific_post_type,
|
426 |
+
'key_2' => 'not_equal',
|
427 |
+
'key_3' => $specific_post_id,
|
428 |
+
);
|
429 |
+
}
|
430 |
+
|
431 |
+
if($specific_post_name =='tax'){
|
432 |
+
$data_array['data_array'][] =array(
|
433 |
+
'key_1' => 'post_category',
|
434 |
+
'key_2' => 'not_equal',
|
435 |
+
'key_3' => $specific_post_id,
|
436 |
+
);
|
437 |
+
}
|
438 |
+
|
439 |
+
}
|
440 |
+
|
441 |
+
$temp_data_array = $data_array['data_array'];
|
442 |
+
$temp_two_array = $data_array['data_array'];
|
443 |
+
$j =0;
|
444 |
+
foreach($temp_two_array as $key => $val){
|
445 |
+
$index =0;
|
446 |
+
foreach($temp_data_array as $t=>$tval){
|
447 |
+
|
448 |
+
if(($val['key_1'] == $tval['key_1']) && ($val['key_2'] == $tval['key_2']) && ($val['key_3'] == $tval['key_3'])){
|
449 |
+
$index++;
|
450 |
+
if($index>1 ){
|
451 |
+
unset($temp_two_array[$t]);
|
452 |
+
}
|
453 |
+
}
|
454 |
+
|
455 |
+
}
|
456 |
+
}
|
457 |
+
$data_array['data_array'] = array_values($temp_two_array);
|
458 |
+
}
|
459 |
+
|
460 |
+
$data_group_array = array();
|
461 |
+
if($schema_enable_location){
|
462 |
+
$enable_rule = $schema_enable_location['rule'];
|
463 |
+
$fields = array_flip($enable_rule);
|
464 |
+
unset($fields['specifics']);
|
465 |
+
$enable_rule = array_flip($fields);
|
466 |
+
$enable_specific = $schema_enable_location['specific'];
|
467 |
+
|
468 |
+
$i=0;
|
469 |
+
foreach ($enable_rule as $rule){
|
470 |
+
|
471 |
+
if($rule =='basic-singulars'){
|
472 |
+
$data_group_array['group-'.$i] =array(
|
473 |
+
'data_array' => array(
|
474 |
+
array(
|
475 |
+
'key_1' => 'post_type',
|
476 |
+
'key_2' => 'equal',
|
477 |
+
'key_3' => 'post',
|
478 |
+
)
|
479 |
+
)
|
480 |
+
);
|
481 |
+
}else{
|
482 |
+
$explode = explode("|", $rule);
|
483 |
+
$data_group_array['group-'.$i] =array(
|
484 |
+
'data_array' => array(
|
485 |
+
array(
|
486 |
+
'key_1' => 'post_type',
|
487 |
+
'key_2' => 'equal',
|
488 |
+
'key_3' => $explode[0],
|
489 |
+
)
|
490 |
+
)
|
491 |
+
);
|
492 |
+
}
|
493 |
+
if(isset($data_array['data_array'])){
|
494 |
+
$data_group_array['group-'.$i]['data_array'] = array_merge($data_group_array['group-'.$i]['data_array'],$data_array['data_array']);
|
495 |
+
}
|
496 |
+
$i++;
|
497 |
+
|
498 |
+
}
|
499 |
+
|
500 |
+
foreach ($enable_specific as $rule){
|
501 |
+
|
502 |
+
$explode = explode("-", $rule);
|
503 |
+
$specific_post_name = $explode[0];
|
504 |
+
$specific_post_id = $explode[1];
|
505 |
+
|
506 |
+
if($specific_post_name =='post'){
|
507 |
+
|
508 |
+
$specific_post_type = get_post_type($specific_post_id);
|
509 |
+
$data_group_array['group-'.$i] =array(
|
510 |
+
'data_array' => array(
|
511 |
+
array(
|
512 |
+
'key_1' => $specific_post_type,
|
513 |
+
'key_2' => 'equal',
|
514 |
+
'key_3' => $specific_post_id,
|
515 |
+
)
|
516 |
+
)
|
517 |
+
);
|
518 |
+
}
|
519 |
+
|
520 |
+
if($specific_post_name =='tax'){
|
521 |
+
$data_group_array['group-'.$i] =array(
|
522 |
+
'data_array' => array(
|
523 |
+
array(
|
524 |
+
'key_1' => 'post_category',
|
525 |
+
'key_2' => 'equal',
|
526 |
+
'key_3' => $specific_post_id,
|
527 |
+
)
|
528 |
+
)
|
529 |
+
);
|
530 |
+
}
|
531 |
+
if(isset($data_array['data_array'])){
|
532 |
+
$data_group_array['group-'.$i]['data_array'] = array_merge($data_group_array['group-'.$i]['data_array'],$data_array['data_array']);
|
533 |
+
}
|
534 |
+
|
535 |
+
$i++;
|
536 |
+
|
537 |
+
}
|
538 |
+
}
|
539 |
+
$schema_type ='';
|
540 |
+
$local_name ='';
|
541 |
+
$local_image ='';
|
542 |
+
$local_phone ='';
|
543 |
+
$local_url ='';
|
544 |
+
$local_url ='';
|
545 |
+
if(isset($schema_post_types)){
|
546 |
+
$schema_type = ucfirst($schema_post_types);
|
547 |
+
|
548 |
+
}
|
549 |
+
if($schema_type =='Video-object'){
|
550 |
+
$schema_type = 'VideoObject';
|
551 |
+
}
|
552 |
+
$local_business_details = array();
|
553 |
+
if($schema_type =='Local-business'){
|
554 |
+
$schema_type = 'local_business';
|
555 |
+
|
556 |
+
if(isset($schema_post_meta_box['telephone'])){
|
557 |
+
$local_business_details['local_phone'] = $schema_post_meta_box['telephone'];
|
558 |
+
}
|
559 |
+
if(isset($schema_post_meta_box['image'])){
|
560 |
+
$local_business_details['local_business_logo']['url'] = $schema_post_meta_box['image'];
|
561 |
+
}
|
562 |
+
if(isset($schema_post_meta_box['price-range'])){
|
563 |
+
$local_business_details['local_price_range'] = $schema_post_meta_box['price-range'];
|
564 |
+
}
|
565 |
+
if(isset($schema_post_meta_box['location-postal'])){
|
566 |
+
$local_business_details['local_postal_code'] = $schema_post_meta_box['location-postal'];
|
567 |
+
}
|
568 |
+
if(isset($schema_post_meta_box['location-region'])){
|
569 |
+
$local_business_details['local_state'] = $schema_post_meta_box['location-region'];
|
570 |
+
}
|
571 |
+
if(isset($schema_post_meta_box['location-street'])){
|
572 |
+
$local_business_details['local_street_address'] = $schema_post_meta_box['location-street'];
|
573 |
+
}
|
574 |
+
if(isset($schema_post_meta_box['url'])){
|
575 |
+
$local_business_details['local_website'] = $schema_post_meta_box['url'];
|
576 |
+
}
|
577 |
+
}
|
578 |
+
$saswp_meta_key = array(
|
579 |
+
'schema_type' => $schema_type,
|
580 |
+
'data_group_array'=>$data_group_array,
|
581 |
+
'imported_from' => 'schema_pro',
|
582 |
+
'saswp_local_business_details' => $local_business_details
|
583 |
+
);
|
584 |
+
|
585 |
+
foreach ($saswp_meta_key as $key => $val){
|
586 |
+
update_post_meta($post_id, $key, $val);
|
587 |
+
}
|
588 |
+
}
|
589 |
+
//Importing settings starts here
|
590 |
+
|
591 |
+
$schema_pro_general_settings = get_option('wp-schema-pro-general-settings');
|
592 |
+
$schema_pro_social_profile = get_option('wp-schema-pro-social-profiles');
|
593 |
+
$schema_pro_global_schemas = get_option('wp-schema-pro-global-schemas');
|
594 |
+
$schema_pro_settings = get_option('aiosrs-pro-settings');
|
595 |
+
|
596 |
+
$logo = wp_get_attachment_image_src( $schema_pro_general_settings['site-logo-custom'] , 'full' );
|
597 |
+
|
598 |
+
$saswp_plugin_options = array(
|
599 |
+
'sd_logo' => array(
|
600 |
+
'url' =>$logo[0],
|
601 |
+
'id' =>$schema_pro_general_settings['site-logo-custom'],
|
602 |
+
'height' =>$logo[1],
|
603 |
+
'width' =>$logo[2],
|
604 |
+
'thumbnail' =>$logo[0]
|
605 |
+
),
|
606 |
+
'saswp_kb_contact_1'=> 0,
|
607 |
+
//AMP Block
|
608 |
+
'saswp-for-amp' => 1,
|
609 |
+
'saswp-for-wordpress'=>1,
|
610 |
+
'saswp-logo-width' => '60',
|
611 |
+
'saswp-logo-height' => '60',
|
612 |
+
'sd_initial_wizard_status' =>1,
|
613 |
+
|
614 |
+
);
|
615 |
+
if(isset($schema_pro_social_profile['facebook'])){
|
616 |
+
$saswp_plugin_options['sd_facebook'] = $schema_pro_social_profile['facebook'];
|
617 |
+
$saswp_plugin_options['saswp-facebook-enable'] = 1;
|
618 |
+
}
|
619 |
+
if(isset($schema_pro_social_profile['twitter'])){
|
620 |
+
$saswp_plugin_options['sd_twitter'] = $schema_pro_social_profile['twitter'];
|
621 |
+
$saswp_plugin_options['saswp-twitter-enable'] = 1;
|
622 |
+
}
|
623 |
+
if(isset($schema_pro_social_profile['google-plus'])){
|
624 |
+
$saswp_plugin_options['sd_google_plus'] = $schema_pro_social_profile['google-plus'];
|
625 |
+
$saswp_plugin_options['saswp-google-plus-enable'] = 1;
|
626 |
+
}
|
627 |
+
if(isset($schema_pro_social_profile['instagram'])){
|
628 |
+
$saswp_plugin_options['sd_instagram'] = $schema_pro_social_profile['instagram'];
|
629 |
+
$saswp_plugin_options['saswp-instagram-enable'] = 1;
|
630 |
+
}
|
631 |
+
if(isset($schema_pro_social_profile['youtube'])){
|
632 |
+
$saswp_plugin_options['sd_youtube'] = $schema_pro_social_profile['youtube'];
|
633 |
+
$saswp_plugin_options['saswp-youtube-enable'] = 1;
|
634 |
+
}
|
635 |
+
if(isset($schema_pro_social_profile['linkedin'])){
|
636 |
+
$saswp_plugin_options['sd_linkedin'] = $schema_pro_social_profile['linkedin'];
|
637 |
+
$saswp_plugin_options['saswp-linkedin-enable'] = 1;
|
638 |
+
}
|
639 |
+
if(isset($schema_pro_social_profile['pinterest'])){
|
640 |
+
$saswp_plugin_options['sd_pinterest'] = $schema_pro_social_profile['pinterest'];
|
641 |
+
$saswp_plugin_options['saswp-pinterest-enable'] = 1;
|
642 |
+
}
|
643 |
+
if(isset($schema_pro_social_profile['soundcloud'])){
|
644 |
+
$saswp_plugin_options['sd_soundcloud'] = $schema_pro_social_profile['soundcloud'];
|
645 |
+
$saswp_plugin_options['saswp-soundcloud-enable'] = 1;
|
646 |
+
}
|
647 |
+
if(isset($schema_pro_social_profile['tumblr'])){
|
648 |
+
$saswp_plugin_options['sd_tumblr'] = $schema_pro_social_profile['tumblr'];
|
649 |
+
$saswp_plugin_options['saswp-tumblr-enable'] = 1;
|
650 |
+
}
|
651 |
+
if(isset($schema_pro_general_settings['site-represent'])){
|
652 |
+
|
653 |
+
$saswp_plugin_options['saswp_kb_type'] = ucfirst($schema_pro_general_settings['site-represent']);
|
654 |
+
$saswp_plugin_options['sd_name'] = $schema_pro_general_settings['site-name'];
|
655 |
+
$saswp_plugin_options['sd-person-name'] = $schema_pro_general_settings['person-name'];
|
656 |
+
}
|
657 |
+
if(isset($schema_pro_global_schemas['about-page'])){
|
658 |
+
$saswp_plugin_options['sd_about_page'] = $schema_pro_global_schemas['about-page'];
|
659 |
+
}
|
660 |
+
if(isset($schema_pro_global_schemas['contact-page'])){
|
661 |
+
$saswp_plugin_options['sd_contact_page'] = $schema_pro_global_schemas['contact-page'];
|
662 |
+
}
|
663 |
+
if(isset($schema_pro_global_schemas['breadcrumb'])){
|
664 |
+
$saswp_plugin_options['saswp_breadcrumb_schema'] = $schema_pro_global_schemas['breadcrumb'];
|
665 |
+
}
|
666 |
+
$get_options = get_option('sd_data');
|
667 |
+
$merge_options = array_merge($get_options, $saswp_plugin_options);
|
668 |
+
update_option('sd_data', $merge_options);
|
669 |
+
|
670 |
+
|
671 |
+
if (is_wp_error($result) ){
|
672 |
+
echo esc_attr($result->get_error_message());
|
673 |
$wpdb->query('ROLLBACK');
|
674 |
}else{
|
675 |
$wpdb->query('COMMIT');
|
740 |
'id' => array(),
|
741 |
'name' => array(),
|
742 |
'value' => array(),
|
743 |
+
'type' => array(),
|
744 |
+
'disabled'=> array(),
|
745 |
);
|
746 |
// options
|
747 |
$my_allowed['option'] = array(
|
admin_section/css/main-style.css
CHANGED
@@ -121,6 +121,9 @@ display: none !important;
|
|
121 |
.saswp-tools-field-title strong{
|
122 |
padding-right: 130px;
|
123 |
}
|
|
|
|
|
|
|
124 |
.saswp-error{
|
125 |
color: #ff0000 !important;
|
126 |
}
|
@@ -306,4 +309,25 @@ padding-bottom: 10px;
|
|
306 |
float:left;
|
307 |
clear: both;
|
308 |
}
|
309 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
.saswp-tools-field-title strong{
|
122 |
padding-right: 130px;
|
123 |
}
|
124 |
+
.saswp-tools .saswp-tooltip{
|
125 |
+
width: 230px;
|
126 |
+
}
|
127 |
.saswp-error{
|
128 |
color: #ff0000 !important;
|
129 |
}
|
309 |
float:left;
|
310 |
clear: both;
|
311 |
}
|
312 |
+
.saswp-compativility-div .saswp-knowledge-field{
|
313 |
+
float: right;
|
314 |
+
width: 75%;
|
315 |
+
padding-bottom: 10px;
|
316 |
+
}
|
317 |
+
.saswp-compativility-div .saswp-knowledge-label{
|
318 |
+
float:left;
|
319 |
+
clear: both;
|
320 |
+
}
|
321 |
+
.saswp-compativility-div li {
|
322 |
+
display: inline-flex;
|
323 |
+
}
|
324 |
+
.saswp-seller-div .saswp-knowledge-label{
|
325 |
+
float: left;
|
326 |
+
width: 230px;
|
327 |
+
clear: both;
|
328 |
+
}
|
329 |
+
.saswp-seller-div .saswp-knowledge-field{
|
330 |
+
float: left;
|
331 |
+
width: 70%;
|
332 |
+
|
333 |
+
}
|
admin_section/fields-generator.php
CHANGED
@@ -27,6 +27,7 @@ class saswp_fields_generator {
|
|
27 |
$note = "";
|
28 |
$tooltip_element="";
|
29 |
$hidden = array();
|
|
|
30 |
if(array_key_exists('class', $meta_field)){
|
31 |
$class = $meta_field['class'];
|
32 |
}
|
@@ -36,6 +37,9 @@ class saswp_fields_generator {
|
|
36 |
if(array_key_exists('hidden', $meta_field)){
|
37 |
$hidden = $meta_field['hidden'];
|
38 |
}
|
|
|
|
|
|
|
39 |
if($tooltip_message){
|
40 |
$tooltip_element = '<span class="saswp-tooltiptext">'.$tooltip_message.'</span>';
|
41 |
}
|
@@ -60,6 +64,10 @@ class saswp_fields_generator {
|
|
60 |
);
|
61 |
break;
|
62 |
case 'checkbox':
|
|
|
|
|
|
|
|
|
63 |
$hiddenvalue ="";
|
64 |
if(array_key_exists('id', $hidden)){
|
65 |
$hiddenvalue = $settings[$hidden['id']];
|
@@ -72,14 +80,21 @@ class saswp_fields_generator {
|
|
72 |
esc_attr($hidden['name']),
|
73 |
esc_attr($hiddenvalue)
|
74 |
);
|
75 |
-
}
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
$input = sprintf(
|
78 |
-
'<input class="%s" id="%s" name="%s" type="checkbox" %s>',
|
79 |
esc_attr($class),
|
80 |
esc_attr($meta_field['id']),
|
81 |
esc_attr($meta_field['name']),
|
82 |
-
$hiddenvalue == 1 ? 'checked' : ''
|
|
|
83 |
);
|
84 |
|
85 |
$input .=$hiddenfield;
|
27 |
$note = "";
|
28 |
$tooltip_element="";
|
29 |
$hidden = array();
|
30 |
+
$attribute = array();
|
31 |
if(array_key_exists('class', $meta_field)){
|
32 |
$class = $meta_field['class'];
|
33 |
}
|
37 |
if(array_key_exists('hidden', $meta_field)){
|
38 |
$hidden = $meta_field['hidden'];
|
39 |
}
|
40 |
+
if(array_key_exists('attributes', $meta_field)){
|
41 |
+
$attribute = $meta_field['attributes'];
|
42 |
+
}
|
43 |
if($tooltip_message){
|
44 |
$tooltip_element = '<span class="saswp-tooltiptext">'.$tooltip_message.'</span>';
|
45 |
}
|
64 |
);
|
65 |
break;
|
66 |
case 'checkbox':
|
67 |
+
$attribute_str ='';
|
68 |
+
foreach ($attribute as $key => $attr ){
|
69 |
+
$attribute_str .=''.$key.'="'.$attr.'"';
|
70 |
+
}
|
71 |
$hiddenvalue ="";
|
72 |
if(array_key_exists('id', $hidden)){
|
73 |
$hiddenvalue = $settings[$hidden['id']];
|
80 |
esc_attr($hidden['name']),
|
81 |
esc_attr($hiddenvalue)
|
82 |
);
|
83 |
+
}
|
84 |
+
$message ='';
|
85 |
+
if (! is_plugin_active('flexmls-idx/flexmls_connect.php')) {
|
86 |
+
if($meta_field['id'] =='saswp_compativility_checkbox'){
|
87 |
+
$note = 'Plugin is not activated';
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
$input = sprintf(
|
92 |
+
'<input class="%s" id="%s" name="%s" type="checkbox" %s %s><p>'.$message.'</p>',
|
93 |
esc_attr($class),
|
94 |
esc_attr($meta_field['id']),
|
95 |
esc_attr($meta_field['name']),
|
96 |
+
$hiddenvalue == 1 ? 'checked' : '',
|
97 |
+
$attribute_str
|
98 |
);
|
99 |
|
100 |
$input .=$hiddenfield;
|
admin_section/js/main-script.js
CHANGED
@@ -15,12 +15,7 @@ jQuery(document).ready(function($){
|
|
15 |
var currentTab = getParameterByName('tab',href);
|
16 |
if(!currentTab){
|
17 |
currentTab = "general";
|
18 |
-
}
|
19 |
-
if(currentTab == 'support' || currentTab == 'tools'){
|
20 |
-
$(".saswp-settings-form #submit").hide();
|
21 |
-
}else{
|
22 |
-
$(".saswp-settings-form #submit").show();
|
23 |
-
}
|
24 |
$(this).siblings().removeClass("nav-tab-active");
|
25 |
$(this).addClass("nav-tab-active");
|
26 |
$(".form-wrap").find(".saswp-"+currentTab).siblings().hide();
|
@@ -213,7 +208,16 @@ jQuery(document).ready(function($){
|
|
213 |
}else{
|
214 |
$("#saswp_breadcrumb_schema").val(0);
|
215 |
}
|
216 |
-
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
default:
|
218 |
break;
|
219 |
}
|
@@ -250,7 +254,8 @@ jQuery(document).ready(function($){
|
|
250 |
button: {
|
251 |
text: "Select Icon"
|
252 |
},
|
253 |
-
multiple: false // Set this to true to allow multiple files to be selected
|
|
|
254 |
})
|
255 |
.on("select", function() {
|
256 |
var attachment = saswpMediaUploader.state().get('selection').first().toJSON();
|
@@ -274,7 +279,7 @@ jQuery(document).ready(function($){
|
|
274 |
type: "POST",
|
275 |
url:ajaxurl,
|
276 |
dataType: "json",
|
277 |
-
data:{action:"saswp_send_query_message", message:message},
|
278 |
success:function(response){
|
279 |
if(response['status'] =='t'){
|
280 |
$(".saswp-query-success").show();
|
@@ -296,17 +301,18 @@ jQuery(document).ready(function($){
|
|
296 |
|
297 |
$(".saswp-import-plugins").on("click", function(e){
|
298 |
e.preventDefault();
|
|
|
299 |
var plugin_name = $(this).attr('data-id');
|
300 |
$.get(ajaxurl,
|
301 |
-
{ action:"saswp_import_plugin_data", plugin_name:plugin_name},
|
302 |
function(response){
|
303 |
if(response['status'] =='t'){
|
304 |
-
$(".saswp-imported-message").text(response['message']);
|
305 |
-
$(".saswp-imported-message").removeClass('saswp-error');
|
306 |
setTimeout(function(){ location.reload(); }, 2000);
|
307 |
}else{
|
308 |
-
$(".saswp-imported-message").addClass('saswp-error');
|
309 |
-
$(".saswp-imported-message").text(response['message']);
|
310 |
}
|
311 |
},'json');
|
312 |
});
|
15 |
var currentTab = getParameterByName('tab',href);
|
16 |
if(!currentTab){
|
17 |
currentTab = "general";
|
18 |
+
}
|
|
|
|
|
|
|
|
|
|
|
19 |
$(this).siblings().removeClass("nav-tab-active");
|
20 |
$(this).addClass("nav-tab-active");
|
21 |
$(".form-wrap").find(".saswp-"+currentTab).siblings().hide();
|
208 |
}else{
|
209 |
$("#saswp_breadcrumb_schema").val(0);
|
210 |
}
|
211 |
+
break;
|
212 |
+
|
213 |
+
case 'saswp_compativility_checkbox':
|
214 |
+
|
215 |
+
if ($(this).is(':checked')) {
|
216 |
+
$("#saswp_compativility").val(1);
|
217 |
+
}else{
|
218 |
+
$("#saswp_compativility").val(0);
|
219 |
+
}
|
220 |
+
break;
|
221 |
default:
|
222 |
break;
|
223 |
}
|
254 |
button: {
|
255 |
text: "Select Icon"
|
256 |
},
|
257 |
+
multiple: false, // Set this to true to allow multiple files to be selected
|
258 |
+
library:{type : 'image'}
|
259 |
})
|
260 |
.on("select", function() {
|
261 |
var attachment = saswpMediaUploader.state().get('selection').first().toJSON();
|
279 |
type: "POST",
|
280 |
url:ajaxurl,
|
281 |
dataType: "json",
|
282 |
+
data:{action:"saswp_send_query_message", message:message, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
|
283 |
success:function(response){
|
284 |
if(response['status'] =='t'){
|
285 |
$(".saswp-query-success").show();
|
301 |
|
302 |
$(".saswp-import-plugins").on("click", function(e){
|
303 |
e.preventDefault();
|
304 |
+
var current_selection = $(this);
|
305 |
var plugin_name = $(this).attr('data-id');
|
306 |
$.get(ajaxurl,
|
307 |
+
{ action:"saswp_import_plugin_data", plugin_name:plugin_name, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
|
308 |
function(response){
|
309 |
if(response['status'] =='t'){
|
310 |
+
$(current_selection).parent().find(".saswp-imported-message").text(response['message']);
|
311 |
+
$(current_selection).parent().find(".saswp-imported-message").removeClass('saswp-error');
|
312 |
setTimeout(function(){ location.reload(); }, 2000);
|
313 |
}else{
|
314 |
+
$(current_selection).parent().find(".saswp-imported-message").addClass('saswp-error');
|
315 |
+
$(current_selection).parent().find(".saswp-imported-message").text(response['message']);
|
316 |
}
|
317 |
},'json');
|
318 |
});
|
admin_section/newsletter.php
CHANGED
@@ -81,7 +81,7 @@
|
|
81 |
var wp_pointers_tour_opts = <?php echo json_encode ($options); ?>, setup;
|
82 |
wp_pointers_tour_opts = $.extend (wp_pointers_tour_opts, {
|
83 |
buttons: function (event, t) {
|
84 |
-
button= jQuery ('<a id="pointer-close" class="button-secondary">' + '<?php echo $button1; ?>' + '</a>');
|
85 |
button_2= jQuery ('#pointer-close.button');
|
86 |
button.bind ('click.pointer', function () {
|
87 |
t.element.pointer ('close');
|
@@ -104,7 +104,7 @@
|
|
104 |
setup = function () {
|
105 |
$('<?php echo esc_attr($displayID); ?>').pointer(wp_pointers_tour_opts).pointer('open');
|
106 |
<?php if ($button2) { ?>
|
107 |
-
jQuery ('#pointer-close').after ('<a id="pointer-primary" class="button-primary">' + '<?php echo $button2; ?>' + '</a>');
|
108 |
jQuery ('#pointer-primary').click (function () {
|
109 |
<?php echo $function; ?>
|
110 |
});
|
81 |
var wp_pointers_tour_opts = <?php echo json_encode ($options); ?>, setup;
|
82 |
wp_pointers_tour_opts = $.extend (wp_pointers_tour_opts, {
|
83 |
buttons: function (event, t) {
|
84 |
+
button= jQuery ('<a id="pointer-close" class="button-secondary">' + '<?php echo esc_attr($button1); ?>' + '</a>');
|
85 |
button_2= jQuery ('#pointer-close.button');
|
86 |
button.bind ('click.pointer', function () {
|
87 |
t.element.pointer ('close');
|
104 |
setup = function () {
|
105 |
$('<?php echo esc_attr($displayID); ?>').pointer(wp_pointers_tour_opts).pointer('open');
|
106 |
<?php if ($button2) { ?>
|
107 |
+
jQuery ('#pointer-close').after ('<a id="pointer-primary" class="button-primary">' + '<?php echo esc_attr($button2); ?>' + '</a>');
|
108 |
jQuery ('#pointer-primary').click (function () {
|
109 |
<?php echo $function; ?>
|
110 |
});
|
admin_section/plugin-installer/install.php
CHANGED
@@ -150,7 +150,7 @@
|
|
150 |
<circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
|
151 |
</svg>
|
152 |
|
153 |
-
<h1><?php echo $stepDetails['title']; ?></h1>
|
154 |
|
155 |
<p><?php echo esc_html( 'This Installation Wizard helps you to setup the necessary options for schema & structured data. It is optional & should take only a few minutes.' ); ?></p>
|
156 |
|
@@ -178,7 +178,7 @@
|
|
178 |
<circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
|
179 |
</svg>
|
180 |
|
181 |
-
<h1><?php echo $stepDetails['title']; ?></h1>
|
182 |
|
183 |
<p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
|
184 |
|
@@ -198,10 +198,10 @@
|
|
198 |
<footer class="merlin__content__footer">
|
199 |
<?php saswp_skip_button(); ?>
|
200 |
|
201 |
-
<a id="skip" href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--skip merlin__button--proceed"><?php echo
|
202 |
|
203 |
<a href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--next button-next" data-callback="save_logo">
|
204 |
-
<span class="merlin__button--loading__text"><?php echo
|
205 |
</a>
|
206 |
|
207 |
<?php wp_nonce_field( 'saswp_install_nonce' ); ?>
|
@@ -222,7 +222,7 @@
|
|
222 |
<circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
|
223 |
</svg>
|
224 |
|
225 |
-
<h1><?php echo $stepDetails['title']; ?></h1>
|
226 |
|
227 |
<p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
|
228 |
|
@@ -241,10 +241,10 @@
|
|
241 |
<footer class="merlin__content__footer">
|
242 |
<?php saswp_skip_button(); ?>
|
243 |
|
244 |
-
<a id="skip" href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--skip merlin__button--proceed"><?php echo
|
245 |
|
246 |
<a href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--next button-next" data-callback="save_logo">
|
247 |
-
<span class="merlin__button--loading__text"><?php echo
|
248 |
</a>
|
249 |
|
250 |
|
@@ -266,7 +266,7 @@
|
|
266 |
<circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
|
267 |
</svg>
|
268 |
|
269 |
-
<h1><?php echo $stepDetails['title']; ?></h1>
|
270 |
|
271 |
<p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
|
272 |
</div>
|
@@ -284,10 +284,10 @@
|
|
284 |
<footer class="merlin__content__footer">
|
285 |
<?php saswp_skip_button(); ?>
|
286 |
|
287 |
-
<a id="skip" href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--skip merlin__button--proceed"><?php echo
|
288 |
|
289 |
<a href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--next button-next" data-callback="save_logo">
|
290 |
-
<span class="merlin__button--loading__text"><?php echo
|
291 |
</a>
|
292 |
|
293 |
|
@@ -309,7 +309,7 @@
|
|
309 |
<circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
|
310 |
</svg>
|
311 |
|
312 |
-
<h1><?php echo $stepDetails['title']; ?></h1>
|
313 |
|
314 |
<p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
|
315 |
|
@@ -328,10 +328,10 @@
|
|
328 |
<footer class="merlin__content__footer">
|
329 |
<?php saswp_skip_button(); ?>
|
330 |
|
331 |
-
<a id="skip" href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--skip merlin__button--proceed"><?php echo
|
332 |
|
333 |
<a href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--next button-next" data-callback="save_logo">
|
334 |
-
<span class="merlin__button--loading__text"><?php echo
|
335 |
</a>
|
336 |
|
337 |
<?php wp_nonce_field( 'saswp_install_nonce' ); ?>
|
@@ -347,8 +347,13 @@
|
|
347 |
|
348 |
|
349 |
|
350 |
-
function saswp_save_steps_data(){
|
351 |
-
|
|
|
|
|
|
|
|
|
|
|
352 |
if(isset($_POST['sd_data'])){
|
353 |
$pre_sd_data = get_option('sd_data');
|
354 |
$pre_sd_data['sd_initial_wizard_status'] =1;
|
@@ -407,7 +412,7 @@
|
|
407 |
|
408 |
function saswp_skip_button(){
|
409 |
?>
|
410 |
-
<a href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--skip"><?php echo
|
411 |
<?php
|
412 |
}
|
413 |
function saswp_finish_page() {
|
@@ -492,7 +497,7 @@
|
|
492 |
<head>
|
493 |
<meta name="viewport" content="width=device-width"/>
|
494 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
495 |
-
<title><?php echo ucwords($current_step); ?></title>
|
496 |
<?php do_action( 'admin_print_styles' ); ?>
|
497 |
<?php do_action( 'admin_print_scripts' ); ?>
|
498 |
<?php do_action( 'admin_head' ); ?>
|
@@ -625,11 +630,15 @@
|
|
625 |
function saswp_general_setting_fields_callback(){
|
626 |
global $sd_data;
|
627 |
$settings = $sd_data;
|
|
|
|
|
|
|
|
|
628 |
$returnHtml = '<li class="saswp_fields">
|
629 |
<label>'.esc_html__('Data Type', 'schema-and-structured-data-for-wp').'</label>
|
630 |
<select name="sd_data[saswp_kb_type]">
|
631 |
-
<option value="Organization" '.($
|
632 |
-
<option value="Person" '.($
|
633 |
</select>
|
634 |
</li>
|
635 |
<li class="saswp_fields">
|
150 |
<circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
|
151 |
</svg>
|
152 |
|
153 |
+
<h1><?php echo esc_attr($stepDetails['title']); ?></h1>
|
154 |
|
155 |
<p><?php echo esc_html( 'This Installation Wizard helps you to setup the necessary options for schema & structured data. It is optional & should take only a few minutes.' ); ?></p>
|
156 |
|
178 |
<circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
|
179 |
</svg>
|
180 |
|
181 |
+
<h1><?php echo esc_attr($stepDetails['title']); ?></h1>
|
182 |
|
183 |
<p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
|
184 |
|
198 |
<footer class="merlin__content__footer">
|
199 |
<?php saswp_skip_button(); ?>
|
200 |
|
201 |
+
<a id="skip" href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--skip merlin__button--proceed"><?php echo esc_html__( 'Skip', 'schema-and-structured-data-for-wp' ); ?></a>
|
202 |
|
203 |
<a href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--next button-next" data-callback="save_logo">
|
204 |
+
<span class="merlin__button--loading__text"><?php echo esc_html__( 'Next', 'schema-and-structured-data-for-wp' ); ?></span><?php echo saswp_loading_spinner(); ?>
|
205 |
</a>
|
206 |
|
207 |
<?php wp_nonce_field( 'saswp_install_nonce' ); ?>
|
222 |
<circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
|
223 |
</svg>
|
224 |
|
225 |
+
<h1><?php echo esc_attr($stepDetails['title']); ?></h1>
|
226 |
|
227 |
<p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
|
228 |
|
241 |
<footer class="merlin__content__footer">
|
242 |
<?php saswp_skip_button(); ?>
|
243 |
|
244 |
+
<a id="skip" href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--skip merlin__button--proceed"><?php echo esc_html__( 'Skip', 'schema-and-structured-data-for-wp' ); ?></a>
|
245 |
|
246 |
<a href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--next button-next" data-callback="save_logo">
|
247 |
+
<span class="merlin__button--loading__text"><?php echo esc_html__( 'Next', 'schema-and-structured-data-for-wp' ); ?></span><?php echo saswp_loading_spinner(); ?>
|
248 |
</a>
|
249 |
|
250 |
|
266 |
<circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
|
267 |
</svg>
|
268 |
|
269 |
+
<h1><?php echo esc_attr($stepDetails['title']); ?></h1>
|
270 |
|
271 |
<p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
|
272 |
</div>
|
284 |
<footer class="merlin__content__footer">
|
285 |
<?php saswp_skip_button(); ?>
|
286 |
|
287 |
+
<a id="skip" href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--skip merlin__button--proceed"><?php echo esc_html__( 'Skip', 'schema-and-structured-data-for-wp' ); ?></a>
|
288 |
|
289 |
<a href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--next button-next" data-callback="save_logo">
|
290 |
+
<span class="merlin__button--loading__text"><?php echo esc_html__( 'Next', 'schema-and-structured-data-for-wp' ); ?></span><?php echo saswp_loading_spinner(); ?>
|
291 |
</a>
|
292 |
|
293 |
|
309 |
<circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
|
310 |
</svg>
|
311 |
|
312 |
+
<h1><?php echo esc_attr($stepDetails['title']); ?></h1>
|
313 |
|
314 |
<p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
|
315 |
|
328 |
<footer class="merlin__content__footer">
|
329 |
<?php saswp_skip_button(); ?>
|
330 |
|
331 |
+
<a id="skip" href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--skip merlin__button--proceed"><?php echo esc_html__( 'Skip', 'schema-and-structured-data-for-wp' ); ?></a>
|
332 |
|
333 |
<a href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--next button-next" data-callback="save_logo">
|
334 |
+
<span class="merlin__button--loading__text"><?php echo esc_html__( 'Next', 'schema-and-structured-data-for-wp' ); ?></span><?php echo saswp_loading_spinner(); ?>
|
335 |
</a>
|
336 |
|
337 |
<?php wp_nonce_field( 'saswp_install_nonce' ); ?>
|
347 |
|
348 |
|
349 |
|
350 |
+
function saswp_save_steps_data(){
|
351 |
+
if ( ! isset( $_POST['wpnonce'] ) ){
|
352 |
+
return;
|
353 |
+
}
|
354 |
+
if ( !wp_verify_nonce( $_POST['wpnonce'], 'saswp_install_nonce' ) ){
|
355 |
+
return;
|
356 |
+
}
|
357 |
if(isset($_POST['sd_data'])){
|
358 |
$pre_sd_data = get_option('sd_data');
|
359 |
$pre_sd_data['sd_initial_wizard_status'] =1;
|
412 |
|
413 |
function saswp_skip_button(){
|
414 |
?>
|
415 |
+
<a href="<?php echo esc_url( saswp_step_next_link() ); ?>" class="merlin__button merlin__button--skip"><?php echo esc_html__( 'Skip', 'schema-and-structured-data-for-wp' ); ?></a>
|
416 |
<?php
|
417 |
}
|
418 |
function saswp_finish_page() {
|
497 |
<head>
|
498 |
<meta name="viewport" content="width=device-width"/>
|
499 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
500 |
+
<title><?php echo esc_attr(ucwords($current_step)); ?></title>
|
501 |
<?php do_action( 'admin_print_styles' ); ?>
|
502 |
<?php do_action( 'admin_print_scripts' ); ?>
|
503 |
<?php do_action( 'admin_head' ); ?>
|
630 |
function saswp_general_setting_fields_callback(){
|
631 |
global $sd_data;
|
632 |
$settings = $sd_data;
|
633 |
+
$saswp_kb_type ='';
|
634 |
+
if(isset($sd_data['saswp_kb_type'])){
|
635 |
+
$saswp_kb_type = $sd_data['saswp_kb_type'];
|
636 |
+
}
|
637 |
$returnHtml = '<li class="saswp_fields">
|
638 |
<label>'.esc_html__('Data Type', 'schema-and-structured-data-for-wp').'</label>
|
639 |
<select name="sd_data[saswp_kb_type]">
|
640 |
+
<option value="Organization" '.($saswp_kb_type=='Organization'? 'selected' : '').'>'.esc_html__('Organization', 'schema-and-structured-data-for-wp').'</option>
|
641 |
+
<option value="Person" '.($saswp_kb_type=='Person'? 'selected' : '').'>'.esc_html__('Person', 'schema-and-structured-data-for-wp').'</option>
|
642 |
</select>
|
643 |
</li>
|
644 |
<li class="saswp_fields">
|
admin_section/settings.php
CHANGED
@@ -25,7 +25,7 @@ function saswp_admin_interface_render(){
|
|
25 |
}
|
26 |
// Handing save settings
|
27 |
if ( isset( $_GET['settings-updated'] ) ) {
|
28 |
-
settings_errors();
|
29 |
}
|
30 |
$is_amp =false;
|
31 |
if ( is_plugin_active('accelerated-mobile-pages/accelerated-moblie-pages.php') || is_plugin_active('amp/amp.php') ) {
|
@@ -138,7 +138,7 @@ function saswp_admin_interface_render(){
|
|
138 |
add_action('admin_init', 'saswp_settings_init');
|
139 |
|
140 |
function saswp_settings_init(){
|
141 |
-
register_setting( 'sd_data_group', 'sd_data' );
|
142 |
add_settings_section('saswp_general_section', __return_false(), '__return_false', 'saswp_general_section');
|
143 |
|
144 |
add_settings_field(
|
@@ -202,6 +202,29 @@ function saswp_settings_init(){
|
|
202 |
|
203 |
|
204 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
function saswp_schema_page_callback(){
|
206 |
// Get Settings
|
207 |
$settings = saswp_defaultSettings();
|
@@ -679,28 +702,149 @@ function saswp_knowledge_page_callback(){
|
|
679 |
<?php
|
680 |
}
|
681 |
|
682 |
-
function
|
683 |
-
|
684 |
-
$cc_args = array(
|
685 |
'posts_per_page' => -1,
|
686 |
'post_type' => 'saswp',
|
687 |
'meta_key' => 'imported_from',
|
688 |
-
'meta_value' =>
|
689 |
);
|
690 |
-
$imported_from = new WP_Query( $cc_args );
|
691 |
-
|
692 |
-
|
693 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
694 |
echo '<h2>'.esc_html__('Migration','schema-and-structured-data-for-wp').'</h2>';
|
695 |
?>
|
696 |
<ul>
|
697 |
<li><div class="saswp-tools-field-title"><div class="saswp-tooltip"><span class="saswp-tooltiptext"><?php echo esc_html__('All the settings and data you can import from this plugin when you click start importing','schema-and-structured-data-for-wp') ?></span><strong><?php echo esc_html__('Schema Plugin','schema-and-structured-data-for-wp'); ?></strong></div><button data-id="schema" class="button saswp-import-plugins"><?php echo esc_html__('Start Importing','schema-and-structured-data-for-wp'); ?></button>
|
698 |
<p class="saswp-imported-message"></p>
|
699 |
-
<?php echo $
|
|
|
|
|
|
|
|
|
|
|
700 |
</div>
|
701 |
-
</li>
|
702 |
</ul>
|
703 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
704 |
}
|
705 |
|
706 |
function saswp_imported_callback(){
|
@@ -753,7 +897,17 @@ function saswp_enqueue_style_js( $hook ) {
|
|
753 |
// Everything needed for media upload
|
754 |
wp_enqueue_media();
|
755 |
// Main JS
|
756 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
757 |
//Main Css
|
758 |
wp_enqueue_style( 'saswp-main-css', SASWP_PLUGIN_URL . 'admin_section/css/main-style.css', false , SASWP_VERSION );
|
759 |
}
|
25 |
}
|
26 |
// Handing save settings
|
27 |
if ( isset( $_GET['settings-updated'] ) ) {
|
28 |
+
settings_errors();
|
29 |
}
|
30 |
$is_amp =false;
|
31 |
if ( is_plugin_active('accelerated-mobile-pages/accelerated-moblie-pages.php') || is_plugin_active('amp/amp.php') ) {
|
138 |
add_action('admin_init', 'saswp_settings_init');
|
139 |
|
140 |
function saswp_settings_init(){
|
141 |
+
register_setting( 'sd_data_group', 'sd_data', 'saswp_handle_file_upload' );
|
142 |
add_settings_section('saswp_general_section', __return_false(), '__return_false', 'saswp_general_section');
|
143 |
|
144 |
add_settings_field(
|
202 |
|
203 |
|
204 |
}
|
205 |
+
|
206 |
+
function saswp_custom_upload_mimes($mimes = array()) {
|
207 |
+
|
208 |
+
$mimes['json'] = "application/json";
|
209 |
+
|
210 |
+
return $mimes;
|
211 |
+
}
|
212 |
+
|
213 |
+
add_action('upload_mimes', 'saswp_custom_upload_mimes');
|
214 |
+
|
215 |
+
function saswp_handle_file_upload($option)
|
216 |
+
{
|
217 |
+
if(!empty($_FILES["saswp_import_backup"]["tmp_name"]))
|
218 |
+
{
|
219 |
+
$urls = wp_handle_upload($_FILES["saswp_import_backup"], array('test_form' => FALSE));
|
220 |
+
$url = $urls["url"];
|
221 |
+
update_option('saswp-file-upload_url',esc_url($url));
|
222 |
+
}
|
223 |
+
|
224 |
+
return $option;
|
225 |
+
}
|
226 |
+
|
227 |
+
|
228 |
function saswp_schema_page_callback(){
|
229 |
// Get Settings
|
230 |
$settings = saswp_defaultSettings();
|
702 |
<?php
|
703 |
}
|
704 |
|
705 |
+
function saswp_check_data_imported_from($plugin_post_type_name){
|
706 |
+
$cc_args = array(
|
|
|
707 |
'posts_per_page' => -1,
|
708 |
'post_type' => 'saswp',
|
709 |
'meta_key' => 'imported_from',
|
710 |
+
'meta_value' => $plugin_post_type_name,
|
711 |
);
|
712 |
+
$imported_from = new WP_Query( $cc_args );
|
713 |
+
return $imported_from;
|
714 |
+
}
|
715 |
+
function saswp_import_callback(){
|
716 |
+
$message = '<p>'.esc_html__('This plugin\'s data already has been imported. Do you want to import again?. click on button above button.','schema-and-structured-data-for-wp').'</p>';
|
717 |
+
$schema_message = '';
|
718 |
+
$schema_pro_message = '';
|
719 |
+
$schema_plugin = saswp_check_data_imported_from('schema');
|
720 |
+
$schema_pro_plugin = saswp_check_data_imported_from('schema_pro');
|
721 |
+
if($schema_plugin->post_count !=0){
|
722 |
+
$schema_message =$message;
|
723 |
+
}
|
724 |
+
if($schema_pro_plugin->post_count !=0){
|
725 |
+
$schema_pro_message =$message;
|
726 |
+
}
|
727 |
+
|
728 |
echo '<h2>'.esc_html__('Migration','schema-and-structured-data-for-wp').'</h2>';
|
729 |
?>
|
730 |
<ul>
|
731 |
<li><div class="saswp-tools-field-title"><div class="saswp-tooltip"><span class="saswp-tooltiptext"><?php echo esc_html__('All the settings and data you can import from this plugin when you click start importing','schema-and-structured-data-for-wp') ?></span><strong><?php echo esc_html__('Schema Plugin','schema-and-structured-data-for-wp'); ?></strong></div><button data-id="schema" class="button saswp-import-plugins"><?php echo esc_html__('Start Importing','schema-and-structured-data-for-wp'); ?></button>
|
732 |
<p class="saswp-imported-message"></p>
|
733 |
+
<?php echo $schema_message; ?>
|
734 |
+
</div>
|
735 |
+
</li>
|
736 |
+
<li><div class="saswp-tools-field-title"><div class="saswp-tooltip"><span class="saswp-tooltiptext"><?php echo esc_html__('All the settings and data you can import from this plugin when you click start importing','schema-and-structured-data-for-wp') ?></span><strong><?php echo esc_html__('Schema Pro','schema-and-structured-data-for-wp'); ?></strong></div><button data-id="schema_pro" class="button saswp-import-plugins"><?php echo esc_html__('Start Importing','schema-and-structured-data-for-wp'); ?></button>
|
737 |
+
<p class="saswp-imported-message"></p>
|
738 |
+
<?php echo $schema_pro_message; ?>
|
739 |
</div>
|
740 |
+
</li>
|
741 |
</ul>
|
742 |
+
<?php
|
743 |
+
echo '<h2>'.esc_html__('Import / Export','schema-and-structured-data-for-wp').'</h2>';
|
744 |
+
$url = admin_url('admin-ajax.php?action=saswp_export_all_settings_and_schema');
|
745 |
+
?>
|
746 |
+
<ul>
|
747 |
+
<li>
|
748 |
+
<div class="saswp-tools-field-title"><div class="saswp-tooltip"><strong><?php echo esc_html__('Export All Settings & Schema','schema-and-structured-data-for-wp'); ?></strong></div><a href="<?php echo esc_url($url); ?>"class="button saswp-export-data"><?php echo esc_html__('Export','schema-and-structured-data-for-wp'); ?></a>
|
749 |
+
</div>
|
750 |
+
</li>
|
751 |
+
<li>
|
752 |
+
<div class="saswp-tools-field-title"><div class="saswp-tooltip"><strong><?php echo esc_html__('Import All Settings & Schema','schema-and-structured-data-for-wp'); ?></strong></div><input type="file" name="saswp_import_backup" id="saswp_import_backup">
|
753 |
+
</div>
|
754 |
+
</li>
|
755 |
+
</ul>
|
756 |
+
<?php
|
757 |
+
|
758 |
+
$settings = saswp_defaultSettings();
|
759 |
+
|
760 |
+
if ( is_plugin_active('flexmls-idx/flexmls_connect.php')) {
|
761 |
+
$meta_fields_default = array(
|
762 |
+
array(
|
763 |
+
'label' => 'FlexMLS IDX Plugin',
|
764 |
+
'id' => 'saswp_compativility_checkbox',
|
765 |
+
'name' => 'saswp_compativility_checkbox',
|
766 |
+
'type' => 'checkbox',
|
767 |
+
'class' => 'checkbox saswp-checkbox',
|
768 |
+
'hidden' => array(
|
769 |
+
'id' => 'saswp_compativility',
|
770 |
+
'name' => 'sd_data[saswp_compativility]',
|
771 |
+
)
|
772 |
+
),
|
773 |
+
);
|
774 |
+
}else{
|
775 |
+
$settings['saswp_compativility'] =0;
|
776 |
+
$meta_fields_default = array(
|
777 |
+
array(
|
778 |
+
'label' => 'FlexMLS IDX',
|
779 |
+
'id' => 'saswp_compativility_checkbox',
|
780 |
+
'name' => 'saswp_compativility_checkbox',
|
781 |
+
'type' => 'checkbox',
|
782 |
+
'class' => 'checkbox saswp-checkbox',
|
783 |
+
'attributes' => array(
|
784 |
+
'disabled' => 'disabled'
|
785 |
+
),
|
786 |
+
'hidden' => array(
|
787 |
+
'id' => 'saswp_compativility',
|
788 |
+
'name' => 'sd_data[saswp_compativility]',
|
789 |
+
)
|
790 |
+
),
|
791 |
+
);
|
792 |
+
}
|
793 |
+
$meta_fields_text = array();
|
794 |
+
$meta_fields_text[] = array(
|
795 |
+
'label' => 'Name',
|
796 |
+
'id' => 'sd-seller-name',
|
797 |
+
'name' => 'sd_data[sd-seller-name]',
|
798 |
+
'class' => 'regular-text',
|
799 |
+
'type' => 'text',
|
800 |
+
);
|
801 |
+
$meta_fields_text[] = array(
|
802 |
+
'label' => 'Addres',
|
803 |
+
'id' => 'sd-seller-address',
|
804 |
+
'name' => 'sd_data[sd-seller-address]',
|
805 |
+
'class' => 'regular-text',
|
806 |
+
'type' => 'text',
|
807 |
+
);
|
808 |
+
$meta_fields_text[] = array(
|
809 |
+
'label' => 'Telephone',
|
810 |
+
'id' => 'sd-seller-telephone',
|
811 |
+
'name' => 'sd_data[sd-seller-telephone]',
|
812 |
+
'class' => 'regular-text',
|
813 |
+
'type' => 'text',
|
814 |
+
);
|
815 |
+
$meta_fields_text[] = array(
|
816 |
+
'label' => 'Price Range',
|
817 |
+
'id' => 'sd-seller-price-range',
|
818 |
+
'name' => 'sd_data[sd-seller-price-range]',
|
819 |
+
'class' => 'regular-text',
|
820 |
+
'type' => 'text',
|
821 |
+
);
|
822 |
+
$meta_fields_text[] = array(
|
823 |
+
'label' => 'URL',
|
824 |
+
'id' => 'sd-seller-url',
|
825 |
+
'name' => 'sd_data[sd-seller-url]',
|
826 |
+
'class' => 'regular-text',
|
827 |
+
'type' => 'text',
|
828 |
+
);
|
829 |
+
$meta_fields_text[] = array(
|
830 |
+
'label' => 'Image',
|
831 |
+
'id' => 'sd_seller_image',
|
832 |
+
'name' => 'sd_data[sd_seller_image][url]',
|
833 |
+
'class' => 'saswp-sd_seller_image',
|
834 |
+
'type' => 'media',
|
835 |
+
);
|
836 |
+
echo '<h2>'.esc_html__('Compatibility','schema-and-structured-data-for-wp').'</h2>';
|
837 |
+
$field_objs = new saswp_fields_generator();
|
838 |
+
echo '<div class="saswp-compativility-div">';
|
839 |
+
$field_objs->saswp_field_generator($meta_fields_default, $settings);
|
840 |
+
echo '</div>';
|
841 |
+
if ( is_plugin_active('flexmls-idx/flexmls_connect.php')) {
|
842 |
+
echo '<div class="saswp-seller-div">';
|
843 |
+
echo '<strong>'.esc_html__('Real estate agent info :','schema-and-structured-data-for-wp').'</strong>';
|
844 |
+
$field_objs->saswp_field_generator($meta_fields_text, $settings);
|
845 |
+
echo '</div>';
|
846 |
+
}
|
847 |
+
|
848 |
}
|
849 |
|
850 |
function saswp_imported_callback(){
|
897 |
// Everything needed for media upload
|
898 |
wp_enqueue_media();
|
899 |
// Main JS
|
900 |
+
|
901 |
+
wp_register_script( 'saswp-main-js', SASWP_PLUGIN_URL . 'admin_section/js/main-script.js', array('jquery'), SASWP_VERSION , true );
|
902 |
+
|
903 |
+
$data = array(
|
904 |
+
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
905 |
+
'saswp_security_nonce' => wp_create_nonce('saswp_ajax_check_nonce')
|
906 |
+
);
|
907 |
+
|
908 |
+
wp_localize_script( 'saswp-main-js', 'saswp_localize_data', $data );
|
909 |
+
|
910 |
+
wp_enqueue_script( 'saswp-main-js' );
|
911 |
//Main Css
|
912 |
wp_enqueue_style( 'saswp-main-css', SASWP_PLUGIN_URL . 'admin_section/css/main-style.css', false , SASWP_VERSION );
|
913 |
}
|
admin_section/structure_admin.php
CHANGED
@@ -581,7 +581,7 @@ function saswp_post_type_generator(){
|
|
581 |
return $post_types;
|
582 |
}
|
583 |
|
584 |
-
add_action('
|
585 |
|
586 |
// Breadcrumbs
|
587 |
function saswp_custom_breadcrumbs() {
|
@@ -596,20 +596,18 @@ function saswp_custom_breadcrumbs() {
|
|
596 |
$custom_taxonomy = 'product_cat';
|
597 |
|
598 |
// Get the query & post information
|
599 |
-
global $post;
|
600 |
-
|
601 |
// Do not display on the homepage
|
602 |
-
if ( !is_front_page() ) {
|
603 |
-
|
604 |
// Build the breadcrums
|
605 |
// Home page
|
606 |
$variables1_titles[] = $home_title;
|
607 |
$variables2_links[] = get_home_url();
|
608 |
|
609 |
-
|
610 |
if ( is_archive() && !is_tax() && !is_category() && !is_tag() && !is_author() ) {
|
611 |
$archive_title = post_type_archive_title($prefix, false);
|
612 |
-
|
613 |
|
614 |
|
615 |
} else if ( is_author() ) {
|
@@ -621,7 +619,7 @@ function saswp_custom_breadcrumbs() {
|
|
621 |
// author name
|
622 |
$variables1_titles[]= $userdata->display_name;
|
623 |
$variables2_links[]= $author_url;
|
624 |
-
|
625 |
} else if ( is_archive() && is_tax() && !is_category() && !is_tag() ) {
|
626 |
|
627 |
// If post is a custom post type
|
@@ -649,12 +647,11 @@ function saswp_custom_breadcrumbs() {
|
|
649 |
if($post_type != 'post') {
|
650 |
|
651 |
$post_type_object = get_post_type_object($post_type);
|
652 |
-
$post_type_archive = get_post_type_archive_link($post_type);
|
653 |
-
|
654 |
$variables1_titles[]= $post_type_object->labels->name;
|
655 |
$variables2_links[]= $post_type_archive;
|
656 |
}
|
657 |
-
|
658 |
// Get post category info
|
659 |
$category = get_the_category();
|
660 |
|
@@ -667,6 +664,7 @@ function saswp_custom_breadcrumbs() {
|
|
667 |
$variables2_links[]=get_category_link( $category_value );
|
668 |
|
669 |
}
|
|
|
670 |
// Get last category post is in
|
671 |
$last_category = end(($category));
|
672 |
$category_name = get_category($last_category);
|
@@ -680,13 +678,14 @@ function saswp_custom_breadcrumbs() {
|
|
680 |
$cat_display .= '<li class="item-cat">'.esc_html__( $parents, 'schema-and-structured-data-for-wp' ).'</li>';
|
681 |
$cat_display .= '<li class="separator"> ' . esc_html__( $separator, 'schema-and-structured-data-for-wp' ) . ' </li>';
|
682 |
}
|
|
|
683 |
}
|
684 |
|
685 |
// If it's a custom post type within a custom taxonomy
|
686 |
$taxonomy_exists = taxonomy_exists($custom_taxonomy);
|
687 |
if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {
|
688 |
|
689 |
-
$taxonomy_terms = get_the_terms( $post->ID, $custom_taxonomy );
|
690 |
$cat_id = $taxonomy_terms[0]->term_id;
|
691 |
$cat_link = get_term_link($taxonomy_terms[0]->term_id, $custom_taxonomy);
|
692 |
$cat_name = $taxonomy_terms[0]->name;
|
@@ -700,6 +699,7 @@ function saswp_custom_breadcrumbs() {
|
|
700 |
} else {
|
701 |
if($post_type == 'post') {
|
702 |
$variables1_titles[]= get_the_title();
|
|
|
703 |
}
|
704 |
}
|
705 |
|
@@ -717,7 +717,7 @@ function saswp_custom_breadcrumbs() {
|
|
717 |
}
|
718 |
}
|
719 |
} else if ( is_page() ) {
|
720 |
-
|
721 |
// Standard page
|
722 |
if( $post->post_parent ){
|
723 |
|
@@ -743,7 +743,7 @@ function saswp_custom_breadcrumbs() {
|
|
743 |
$variables1_titles[]=get_the_title();
|
744 |
$variables2_links[]=get_permalink();
|
745 |
}
|
746 |
-
|
747 |
} else if ( is_tag() ) {
|
748 |
// Tag page
|
749 |
// Get tag information
|
@@ -761,7 +761,8 @@ function saswp_custom_breadcrumbs() {
|
|
761 |
$variables2_links[] = $term_link;
|
762 |
}
|
763 |
$sd_data['titles']= $variables1_titles;
|
764 |
-
$sd_data['links']= $variables2_links;
|
|
|
765 |
}
|
766 |
|
767 |
}
|
@@ -774,7 +775,7 @@ function saswp_custom_column_set( $column, $post_id ) {
|
|
774 |
case 'saswp_schema_type' :
|
775 |
|
776 |
$schema_type = get_post_meta( $post_id, $key='schema_type', true);
|
777 |
-
echo $schema_type;
|
778 |
|
779 |
break;
|
780 |
case 'saswp_target_location' :
|
@@ -792,10 +793,10 @@ function saswp_custom_column_set( $column, $post_id ) {
|
|
792 |
}
|
793 |
}
|
794 |
if($enabled){
|
795 |
-
echo '<div><strong>'.esc_html__( 'Enable on: ', 'schema-and-structured-data-for-wp' ).'</strong> '
|
796 |
}
|
797 |
if($exclude){
|
798 |
-
echo '<div><strong>'.esc_html__( 'Exclude from: ', 'schema-and-structured-data-for-wp' ).'</strong>'
|
799 |
}
|
800 |
}
|
801 |
|
@@ -828,19 +829,25 @@ add_filter( 'manage_saswp_posts_columns', 'saswp_custom_columns' );
|
|
828 |
* This is a ajax handler function for sending email from user admin panel to us.
|
829 |
* @return type json string
|
830 |
*/
|
831 |
-
function saswp_send_query_message(){
|
832 |
-
|
833 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
834 |
$user = wp_get_current_user();
|
835 |
$user_data = $user->data;
|
836 |
$user_email = $user_data->user_email;
|
837 |
//php mailer variables
|
838 |
-
$
|
839 |
$subject = "Customer Query";
|
840 |
-
$headers = 'From: '. $user_email . "\r\n" .
|
841 |
-
'Reply-To: ' . $user_email . "\r\n";
|
842 |
// Load WP components, no themes.
|
843 |
-
$sent = wp_mail($
|
844 |
if($sent){
|
845 |
echo json_encode(array('status'=>'t'));
|
846 |
}else{
|
@@ -857,7 +864,14 @@ add_action('wp_ajax_saswp_send_query_message', 'saswp_send_query_message');
|
|
857 |
* @return type json string
|
858 |
*/
|
859 |
function saswp_import_plugin_data(){
|
860 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
861 |
$result = '';
|
862 |
switch ($plugin_name) {
|
863 |
case 'schema':
|
@@ -865,6 +879,12 @@ function saswp_import_plugin_data(){
|
|
865 |
$result = saswp_import_schema_plugin_data();
|
866 |
}
|
867 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
868 |
|
869 |
default:
|
870 |
break;
|
581 |
return $post_types;
|
582 |
}
|
583 |
|
584 |
+
add_action('wp','saswp_custom_breadcrumbs',99);
|
585 |
|
586 |
// Breadcrumbs
|
587 |
function saswp_custom_breadcrumbs() {
|
596 |
$custom_taxonomy = 'product_cat';
|
597 |
|
598 |
// Get the query & post information
|
599 |
+
global $post;
|
|
|
600 |
// Do not display on the homepage
|
601 |
+
if ( !is_front_page() ) {
|
|
|
602 |
// Build the breadcrums
|
603 |
// Home page
|
604 |
$variables1_titles[] = $home_title;
|
605 |
$variables2_links[] = get_home_url();
|
606 |
|
607 |
+
|
608 |
if ( is_archive() && !is_tax() && !is_category() && !is_tag() && !is_author() ) {
|
609 |
$archive_title = post_type_archive_title($prefix, false);
|
610 |
+
$variables1_titles[] = $archive_title;
|
611 |
|
612 |
|
613 |
} else if ( is_author() ) {
|
619 |
// author name
|
620 |
$variables1_titles[]= $userdata->display_name;
|
621 |
$variables2_links[]= $author_url;
|
622 |
+
|
623 |
} else if ( is_archive() && is_tax() && !is_category() && !is_tag() ) {
|
624 |
|
625 |
// If post is a custom post type
|
647 |
if($post_type != 'post') {
|
648 |
|
649 |
$post_type_object = get_post_type_object($post_type);
|
650 |
+
$post_type_archive = get_post_type_archive_link($post_type);
|
|
|
651 |
$variables1_titles[]= $post_type_object->labels->name;
|
652 |
$variables2_links[]= $post_type_archive;
|
653 |
}
|
654 |
+
|
655 |
// Get post category info
|
656 |
$category = get_the_category();
|
657 |
|
664 |
$variables2_links[]=get_category_link( $category_value );
|
665 |
|
666 |
}
|
667 |
+
|
668 |
// Get last category post is in
|
669 |
$last_category = end(($category));
|
670 |
$category_name = get_category($last_category);
|
678 |
$cat_display .= '<li class="item-cat">'.esc_html__( $parents, 'schema-and-structured-data-for-wp' ).'</li>';
|
679 |
$cat_display .= '<li class="separator"> ' . esc_html__( $separator, 'schema-and-structured-data-for-wp' ) . ' </li>';
|
680 |
}
|
681 |
+
|
682 |
}
|
683 |
|
684 |
// If it's a custom post type within a custom taxonomy
|
685 |
$taxonomy_exists = taxonomy_exists($custom_taxonomy);
|
686 |
if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {
|
687 |
|
688 |
+
$taxonomy_terms = get_the_terms( $post->ID, $custom_taxonomy );
|
689 |
$cat_id = $taxonomy_terms[0]->term_id;
|
690 |
$cat_link = get_term_link($taxonomy_terms[0]->term_id, $custom_taxonomy);
|
691 |
$cat_name = $taxonomy_terms[0]->name;
|
699 |
} else {
|
700 |
if($post_type == 'post') {
|
701 |
$variables1_titles[]= get_the_title();
|
702 |
+
$variables2_links[] = get_permalink();
|
703 |
}
|
704 |
}
|
705 |
|
717 |
}
|
718 |
}
|
719 |
} else if ( is_page() ) {
|
720 |
+
|
721 |
// Standard page
|
722 |
if( $post->post_parent ){
|
723 |
|
743 |
$variables1_titles[]=get_the_title();
|
744 |
$variables2_links[]=get_permalink();
|
745 |
}
|
746 |
+
|
747 |
} else if ( is_tag() ) {
|
748 |
// Tag page
|
749 |
// Get tag information
|
761 |
$variables2_links[] = $term_link;
|
762 |
}
|
763 |
$sd_data['titles']= $variables1_titles;
|
764 |
+
$sd_data['links']= $variables2_links;
|
765 |
+
|
766 |
}
|
767 |
|
768 |
}
|
775 |
case 'saswp_schema_type' :
|
776 |
|
777 |
$schema_type = get_post_meta( $post_id, $key='schema_type', true);
|
778 |
+
echo esc_attr($schema_type);
|
779 |
|
780 |
break;
|
781 |
case 'saswp_target_location' :
|
793 |
}
|
794 |
}
|
795 |
if($enabled){
|
796 |
+
echo '<div><strong>'.esc_html__( 'Enable on: ', 'schema-and-structured-data-for-wp' ).'</strong> '.esc_attr($enabled).'</div>';
|
797 |
}
|
798 |
if($exclude){
|
799 |
+
echo '<div><strong>'.esc_html__( 'Exclude from: ', 'schema-and-structured-data-for-wp' ).'</strong>'.esc_attr($exclude).'</div>';
|
800 |
}
|
801 |
}
|
802 |
|
829 |
* This is a ajax handler function for sending email from user admin panel to us.
|
830 |
* @return type json string
|
831 |
*/
|
832 |
+
function saswp_send_query_message(){
|
833 |
+
|
834 |
+
if ( ! isset( $_POST['saswp_security_nonce'] ) ){
|
835 |
+
return;
|
836 |
+
}
|
837 |
+
if ( !wp_verify_nonce( $_POST['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
|
838 |
+
return;
|
839 |
+
}
|
840 |
+
$message = sanitize_text_field($_POST['message']);
|
841 |
$user = wp_get_current_user();
|
842 |
$user_data = $user->data;
|
843 |
$user_email = $user_data->user_email;
|
844 |
//php mailer variables
|
845 |
+
$sendto = 'team@magazine3.com';
|
846 |
$subject = "Customer Query";
|
847 |
+
$headers = 'From: '. esc_attr($user_email) . "\r\n" .
|
848 |
+
'Reply-To: ' . esc_attr($user_email) . "\r\n";
|
849 |
// Load WP components, no themes.
|
850 |
+
$sent = wp_mail($sendto, $subject, strip_tags($message), $headers);
|
851 |
if($sent){
|
852 |
echo json_encode(array('status'=>'t'));
|
853 |
}else{
|
864 |
* @return type json string
|
865 |
*/
|
866 |
function saswp_import_plugin_data(){
|
867 |
+
|
868 |
+
if ( ! isset( $_GET['saswp_security_nonce'] ) ){
|
869 |
+
return;
|
870 |
+
}
|
871 |
+
if ( !wp_verify_nonce( $_GET['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
|
872 |
+
return;
|
873 |
+
}
|
874 |
+
$plugin_name = sanitize_text_field($_GET['plugin_name']);
|
875 |
$result = '';
|
876 |
switch ($plugin_name) {
|
877 |
case 'schema':
|
879 |
$result = saswp_import_schema_plugin_data();
|
880 |
}
|
881 |
break;
|
882 |
+
|
883 |
+
case 'schema_pro':
|
884 |
+
if ( is_plugin_active('wp-schema-pro/wp-schema-pro.php')) {
|
885 |
+
$result = saswp_import_schema_pro_plugin_data();
|
886 |
+
}
|
887 |
+
break;
|
888 |
|
889 |
default:
|
890 |
break;
|
output/flexmls.php
ADDED
@@ -0,0 +1,279 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class saswp_flexmls_list extends flexmlsConnectPageCore{
|
3 |
+
|
4 |
+
public $shorcode = array();
|
5 |
+
protected $search_criteria;
|
6 |
+
function __construct() {
|
7 |
+
global $fmc_api;
|
8 |
+
parent::__construct($fmc_api);
|
9 |
+
|
10 |
+
add_filter('the_content', array($this,'saswp_content'),9);
|
11 |
+
add_action('wp_footer', array($this, 'saswp_get_flexidx_listing'));
|
12 |
+
add_action('wp_footer', array($this, 'saswp_get_flexidx_listing'));
|
13 |
+
add_action('amp_post_template_footer',array($this, 'saswp_get_flexidx_listing'));
|
14 |
+
}
|
15 |
+
public function saswp_get_flexidx_listing(){
|
16 |
+
global $fmc_api;
|
17 |
+
|
18 |
+
$settings = array();
|
19 |
+
|
20 |
+
foreach ($this->shorcode[1] as $shortcodeAttr){
|
21 |
+
|
22 |
+
if (preg_match_all('/(\b\w+)="(.*?(?="\s\w+=|$))/', $shortcodeAttr, $matches)) {
|
23 |
+
|
24 |
+
$settings = array_combine ( $matches[1], $matches[2] );
|
25 |
+
|
26 |
+
}
|
27 |
+
|
28 |
+
$title = isset($settings['title']) ? ($settings['title']) : '';
|
29 |
+
$source = isset($settings['source']) ? trim($settings['source']) : '';
|
30 |
+
$display = isset($settings['display']) ? trim($settings['display']) : '';
|
31 |
+
$days = isset($settings['days']) ? trim($settings['days']) : '';
|
32 |
+
$property_type = isset($settings['property_type']) ? trim($settings['property_type']): '';
|
33 |
+
$property_sub_type = isset($settings['property_sub_type']) ? trim($settings['property_sub_type']): '';
|
34 |
+
$link = isset($settings['link']) ? trim($settings['link']) : '';
|
35 |
+
$sort = isset($settings['sort']) ? trim($settings['sort']) : '';
|
36 |
+
$agent = isset($settings['agent']) ? trim($settings['agent']) : '';
|
37 |
+
$status = isset($settings['status']) ? trim($settings['status'], '"') : '';
|
38 |
+
$locations = '';
|
39 |
+
|
40 |
+
if ( isset($settings['location']) ) {
|
41 |
+
$locations = html_entity_decode( flexmlsConnect::clean_comma_list( stripslashes( $settings['location'] ) ) );
|
42 |
+
}
|
43 |
+
if ($link == "default") {
|
44 |
+
$link = flexmlsConnect::get_default_idx_link();
|
45 |
+
}
|
46 |
+
$source = (empty($source)) ? "my" : $source;
|
47 |
+
$pure_conditions = array();
|
48 |
+
|
49 |
+
if (isset($settings['days'])){
|
50 |
+
$days = $settings['days'];
|
51 |
+
}
|
52 |
+
elseif ($display == "open_houses"){
|
53 |
+
//For backward compatibility. Set # of days for open house default to 10
|
54 |
+
$days = 10;
|
55 |
+
}
|
56 |
+
else{
|
57 |
+
$days = 1;
|
58 |
+
if (date("l") == "Monday")
|
59 |
+
$days = 3;
|
60 |
+
}
|
61 |
+
|
62 |
+
$flexmls_temp_date = date_default_timezone_get();
|
63 |
+
date_default_timezone_set('America/Chicago');
|
64 |
+
$specific_time = date("Y-m-d\TH:i:s.u",strtotime("-".$days." days"));
|
65 |
+
date_default_timezone_set($flexmls_temp_date);
|
66 |
+
|
67 |
+
if ($display == "new") {
|
68 |
+
$pure_conditions["OriginalOnMarketTimestamp"] = $specific_time;
|
69 |
+
}
|
70 |
+
elseif ($display == "open_houses") {
|
71 |
+
$pure_conditions['OpenHouses'] = $days;
|
72 |
+
}
|
73 |
+
elseif ($display == "price_changes") {
|
74 |
+
$pure_conditions["PriceChangeTimestamp"] = $specific_time;
|
75 |
+
}
|
76 |
+
elseif ($display == "recent_sales") {
|
77 |
+
$pure_conditions["StatusChangeTimestamp"] = $specific_time;
|
78 |
+
}
|
79 |
+
|
80 |
+
if ($sort == "recently_changed") {
|
81 |
+
$pure_conditions['OrderBy'] = "-ModificationTimestamp"; // special tag caught later
|
82 |
+
}
|
83 |
+
elseif ($sort == "price_low_high") {
|
84 |
+
$pure_conditions['OrderBy'] = "+ListPrice";
|
85 |
+
}
|
86 |
+
elseif ($sort == "price_high_low") {
|
87 |
+
$pure_conditions['OrderBy'] = "-ListPrice";
|
88 |
+
}
|
89 |
+
elseif ($sort == "open_house"){
|
90 |
+
$pure_conditions['OrderBy'] = "+OpenHouses";
|
91 |
+
}
|
92 |
+
elseif ($sort == "sqft_low_high") {
|
93 |
+
$pure_conditions['OrderBy'] = "+BuildingAreaTotal";
|
94 |
+
}
|
95 |
+
elseif ($sort == "sqft_high_low") {
|
96 |
+
$pure_conditions['OrderBy'] = "-BuildingAreaTotal";
|
97 |
+
}
|
98 |
+
elseif ($sort == "year_built_high_low") {
|
99 |
+
$pure_conditions['OrderBy'] = "-YearBuilt";
|
100 |
+
}
|
101 |
+
elseif ($sort == "year_built_low_high") {
|
102 |
+
$pure_conditions['OrderBy'] = "+YearBuilt";
|
103 |
+
}
|
104 |
+
|
105 |
+
$apply_property_type = ($source == 'location') ? true : false;
|
106 |
+
if ($source == 'agent') {
|
107 |
+
$pure_conditions['ListAgentId'] = $agent;
|
108 |
+
}
|
109 |
+
// parse location search settings
|
110 |
+
$locations = flexmlsConnect::parse_location_search_string($locations);
|
111 |
+
if($locations){
|
112 |
+
foreach ($locations as $loc) {
|
113 |
+
if(array_key_exists($loc['f'], $pure_conditions)) {
|
114 |
+
$pure_conditions[$loc['f']] .= ',' . $loc['v'];
|
115 |
+
} else {
|
116 |
+
$pure_conditions[$loc['f']] = $loc['v'];
|
117 |
+
}
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
if ($apply_property_type and !empty($property_type)) {
|
122 |
+
$pure_conditions['PropertyType'] = $property_type;
|
123 |
+
$pure_conditions['PropertySubType'] = $property_sub_type;
|
124 |
+
}
|
125 |
+
|
126 |
+
if ($link) {
|
127 |
+
$link_details = $fmc_api->GetIDXLinkFromTinyId($link);
|
128 |
+
|
129 |
+
if ($link_details['LinkType'] == "SavedSearch") {
|
130 |
+
$pure_conditions['SavedSearch'] = $link_details['SearchId'];
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
+
if ($source == "my") {
|
135 |
+
// make a simple request to /my/listings with no _filter's
|
136 |
+
$pure_conditions['My'] = 'listings';
|
137 |
+
}
|
138 |
+
elseif ($source == "office") {
|
139 |
+
$pure_conditions['My'] = 'office';
|
140 |
+
}
|
141 |
+
elseif ($source == "company") {
|
142 |
+
$pure_conditions['My'] = 'company';
|
143 |
+
}
|
144 |
+
|
145 |
+
if ($status) {
|
146 |
+
$pure_conditions["StandardStatus"] = $status;
|
147 |
+
}
|
148 |
+
|
149 |
+
$custom_page = new flexmlsConnectPageSearchResults($fmc_api);
|
150 |
+
$custom_page->title = $title;
|
151 |
+
$custom_page->input_source = 'shortcode';
|
152 |
+
$custom_page->input_data = $pure_conditions;
|
153 |
+
list($params, $cleaned_raw_criteria, $context) = $custom_page->parse_search_parameters_into_api_request();
|
154 |
+
unset($params['_select']);
|
155 |
+
$this->search_criteria = $cleaned_raw_criteria;
|
156 |
+
|
157 |
+
require_once( ABSPATH . '/wp-content/plugins/flexmls-idx/lib/flexmlsAPI/Core.php' );
|
158 |
+
$flexcoreApi = new flexmlsAPI_Core();
|
159 |
+
|
160 |
+
if ($context == "listings") {
|
161 |
+
$results = $flexcoreApi->GetMyListings($params);
|
162 |
+
|
163 |
+
}
|
164 |
+
elseif ($context == "office") {
|
165 |
+
$results = $flexcoreApi->GetOfficeListings($params);
|
166 |
+
}
|
167 |
+
elseif ($context == "company") {
|
168 |
+
$results = $flexcoreApi->GetCompanyListings($params);
|
169 |
+
}
|
170 |
+
else {
|
171 |
+
$cache_time = (strpos($params['_filter'],'ListingCart')!==false) ? 0 : '10m';
|
172 |
+
$results = $flexcoreApi->GetListings($params, $cache_time);
|
173 |
+
}
|
174 |
+
$count = count($results);
|
175 |
+
echo "\n";
|
176 |
+
echo '<!-- Schema & Structured Data For WP v'.esc_attr(SASWP_VERSION) .' IDX - -->';
|
177 |
+
echo "\n";
|
178 |
+
echo '<script type="application/ld+json">';
|
179 |
+
echo "\n";
|
180 |
+
echo "[";
|
181 |
+
foreach ($results as $result){
|
182 |
+
if($count > 1){
|
183 |
+
echo json_encode($this->saswp_generate_schema_markup($result)).',';
|
184 |
+
}else{
|
185 |
+
echo json_encode($this->saswp_generate_schema_markup($result));
|
186 |
+
}
|
187 |
+
$count --;
|
188 |
+
}
|
189 |
+
echo ']';
|
190 |
+
echo "\n";
|
191 |
+
echo '</script>';
|
192 |
+
}
|
193 |
+
|
194 |
+
}
|
195 |
+
public function saswp_content($content){
|
196 |
+
preg_match_all("/[[]idx_listing_summary(.*?)[]]/", $content,$matches);
|
197 |
+
|
198 |
+
$this->shorcode = $matches;
|
199 |
+
return $content;
|
200 |
+
}
|
201 |
+
public function saswp_generate_schema_markup($result){
|
202 |
+
global $sd_data;
|
203 |
+
$sellername ='';
|
204 |
+
$sellerurl ='';
|
205 |
+
$sellerimage ='';
|
206 |
+
$selleraddress ='';
|
207 |
+
$sellertelephone ='';
|
208 |
+
$sellerpricerange ='';
|
209 |
+
|
210 |
+
if(isset($sd_data['saswp_compativility']) && $sd_data['saswp_compativility']==1){
|
211 |
+
|
212 |
+
if(isset($sd_data['sd-seller-name'])){
|
213 |
+
$sellername =$sd_data['sd-seller-name'];
|
214 |
+
}
|
215 |
+
if(isset($sd_data['sd-seller-url'])){
|
216 |
+
$sellerurl =$sd_data['sd-seller-url'];
|
217 |
+
}
|
218 |
+
if(isset($sd_data['sd_seller_image']['thumbnail'])){
|
219 |
+
$sellerimage = $sd_data['sd_seller_image']['thumbnail'];
|
220 |
+
}
|
221 |
+
if(isset($sd_data['sd-seller-address'])){
|
222 |
+
$selleraddress =$sd_data['sd-seller-address'];
|
223 |
+
}
|
224 |
+
if(isset($sd_data['sd-seller-telephone'])){
|
225 |
+
$sellertelephone =$sd_data['sd-seller-telephone'];
|
226 |
+
}
|
227 |
+
if(isset($sd_data['sd-seller-price-range'])){
|
228 |
+
$sellerpricerange =$sd_data['sd-seller-price-range'];
|
229 |
+
}
|
230 |
+
|
231 |
+
$link_to_details_criteria = $this->search_criteria;
|
232 |
+
$link_to_details = flexmlsConnect::make_nice_address_url($result['StandardFields'], $link_to_details_criteria, 'fmc_tag');
|
233 |
+
$photos = array();
|
234 |
+
if($result['StandardFields']['Photos']){
|
235 |
+
foreach ($result['StandardFields']['Photos'] as $photo){
|
236 |
+
$photos[] = array(
|
237 |
+
'url' => $photo['UriThumb']
|
238 |
+
);
|
239 |
+
}
|
240 |
+
}
|
241 |
+
$input = array();
|
242 |
+
$input = array(
|
243 |
+
"@context" => "http://schema.org",
|
244 |
+
"@type" => ["Product", "Apartment"],
|
245 |
+
"name" => $result['StandardFields']['UnparsedFirstLineAddress'],
|
246 |
+
"url" => $link_to_details,
|
247 |
+
"offers" => array(
|
248 |
+
"priceCurrency" => "USD",
|
249 |
+
"price" => $result['StandardFields']['ListPrice'],
|
250 |
+
"availability" => 'InStock',
|
251 |
+
"seller" => array(
|
252 |
+
array(
|
253 |
+
"@type" => "RealEstateAgent",
|
254 |
+
"name" => $sellername,
|
255 |
+
"url" => $sellerurl,
|
256 |
+
"image" => $sellerimage,
|
257 |
+
"address" => $selleraddress,
|
258 |
+
"priceRange" => $sellerpricerange,
|
259 |
+
"telephone" => $sellertelephone,
|
260 |
+
)
|
261 |
+
),
|
262 |
+
),
|
263 |
+
'address' => $result['StandardFields']['StreetNumber'].' '. $result['StandardFields']['StreetName'].' '.$result['StandardFields']['StreetSuffix'] .' '.$result['StandardFields']['City'].' '. $result['StandardFields']['PostalCode'],
|
264 |
+
'geo' => array(
|
265 |
+
"@type" => "GeoCoordinates",
|
266 |
+
"address" => $result['StandardFields']['UnparsedFirstLineAddress'],
|
267 |
+
"addressCountry" => $result['StandardFields']['UnparsedFirstLineAddress'],
|
268 |
+
),
|
269 |
+
|
270 |
+
'photos' => $photos,
|
271 |
+
);
|
272 |
+
|
273 |
+
return $input;
|
274 |
+
}
|
275 |
+
}
|
276 |
+
}
|
277 |
+
if (class_exists('saswp_flexmls_list')) {
|
278 |
+
new saswp_flexmls_list;
|
279 |
+
};
|
output/function.php
CHANGED
@@ -1,14 +1,12 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
function saswp_remove_amp_default_structure_data($metadata){
|
4 |
return '';
|
5 |
}
|
6 |
-
|
7 |
add_filter( 'amp_init', 'saswp_structured_data' );
|
8 |
function saswp_structured_data()
|
9 |
{
|
10 |
add_action( 'amp_post_template_head' , 'saswp_data_generator' );
|
11 |
-
remove_action( 'amp_post_template_head', 'amp_post_template_add_schemaorg_metadata',
|
12 |
}
|
13 |
add_action('wp_head', 'saswp_data_generator');
|
14 |
function saswp_data_generator() {
|
@@ -20,13 +18,11 @@ function saswp_data_generator() {
|
|
20 |
$archive_output = saswp_archive_output();
|
21 |
$kb_website_output = saswp_kb_website_output();
|
22 |
$schema_breadcrumb_output = saswp_schema_breadcrumb_output($sd_data);
|
23 |
-
$schema_output = saswp_schema_output();
|
24 |
-
|
25 |
-
|
26 |
-
add_filter( 'amp_post_template_metadata', 'saswp_remove_amp_default_structure_data');
|
27 |
}
|
28 |
-
|
29 |
-
|
30 |
$kb_schema_output = saswp_kb_schema_output();
|
31 |
|
32 |
if( ( 1 == $sd_data['saswp-for-wordpress'] && saswp_non_amp() ) || ( 1 == $sd_data['saswp-for-amp'] && !saswp_non_amp() ) ) {
|
@@ -89,7 +85,7 @@ function saswp_data_generator() {
|
|
89 |
$stroutput = '['. $output. ']';
|
90 |
$filter_string = str_replace(',]', ']',$stroutput);
|
91 |
|
92 |
-
echo '<!-- Schema & Structured Data For WP v'.SASWP_VERSION.' - -->';
|
93 |
echo "\n";
|
94 |
echo '<script type="application/ld+json">';
|
95 |
echo "\n";
|
1 |
<?php
|
|
|
2 |
function saswp_remove_amp_default_structure_data($metadata){
|
3 |
return '';
|
4 |
}
|
|
|
5 |
add_filter( 'amp_init', 'saswp_structured_data' );
|
6 |
function saswp_structured_data()
|
7 |
{
|
8 |
add_action( 'amp_post_template_head' , 'saswp_data_generator' );
|
9 |
+
remove_action( 'amp_post_template_head', 'amp_post_template_add_schemaorg_metadata',99,1);
|
10 |
}
|
11 |
add_action('wp_head', 'saswp_data_generator');
|
12 |
function saswp_data_generator() {
|
18 |
$archive_output = saswp_archive_output();
|
19 |
$kb_website_output = saswp_kb_website_output();
|
20 |
$schema_breadcrumb_output = saswp_schema_breadcrumb_output($sd_data);
|
21 |
+
$schema_output = saswp_schema_output();
|
22 |
+
if($schema_output || $schema_breadcrumb_output || $kb_website_output || $archive_output || $author_output || $about_page_output || $contact_page_output){
|
23 |
+
add_filter( 'amp_post_template_metadata', 'saswp_remove_amp_default_structure_data');
|
|
|
24 |
}
|
25 |
+
|
|
|
26 |
$kb_schema_output = saswp_kb_schema_output();
|
27 |
|
28 |
if( ( 1 == $sd_data['saswp-for-wordpress'] && saswp_non_amp() ) || ( 1 == $sd_data['saswp-for-amp'] && !saswp_non_amp() ) ) {
|
85 |
$stroutput = '['. $output. ']';
|
86 |
$filter_string = str_replace(',]', ']',$stroutput);
|
87 |
|
88 |
+
echo '<!-- Schema & Structured Data For WP v'.esc_attr(SASWP_VERSION).' - -->';
|
89 |
echo "\n";
|
90 |
echo '<script type="application/ld+json">';
|
91 |
echo "\n";
|
output/output.php
CHANGED
@@ -25,7 +25,6 @@ function saswp_kb_schema_output() {
|
|
25 |
$sd_google_plus[] = $sd_data['sd_google_plus'];
|
26 |
$sd_social_profile[] = $sd_google_plus;
|
27 |
}
|
28 |
-
|
29 |
$sd_instagram = array();
|
30 |
if(isset($sd_data['sd_instagram']) && !empty($sd_data['sd_instagram'])){
|
31 |
$sd_instagram[] = $sd_data['sd_instagram'];
|
@@ -167,8 +166,7 @@ function sd_is_blog() {
|
|
167 |
function saswp_schema_output() {
|
168 |
global $sd_data;
|
169 |
|
170 |
-
$Conditionals = saswp_get_all_schema_posts();
|
171 |
-
|
172 |
|
173 |
if(!$Conditionals){
|
174 |
return ;
|
@@ -316,7 +314,7 @@ function saswp_schema_output() {
|
|
316 |
'@context' => 'http://schema.org',
|
317 |
'@type' => $schema_type ,
|
318 |
'url' => get_permalink(),
|
319 |
-
'
|
320 |
'datePublished' => $date,
|
321 |
'dateModified' => $modified_date,
|
322 |
'description' => get_the_excerpt(),
|
@@ -592,12 +590,14 @@ function saswp_list_items_generator(){
|
|
592 |
}
|
593 |
if(isset($sd_data['links'])){
|
594 |
$bc_links = $sd_data['links'];
|
595 |
-
}
|
|
|
596 |
$j=1;
|
597 |
$i = 0;
|
598 |
-
|
599 |
if(is_single()){
|
600 |
-
|
|
|
601 |
for($i=0;$i<sizeof($bc_titles);$i++){
|
602 |
$breadcrumbslist[] = array(
|
603 |
'@type' => 'ListItem',
|
@@ -606,7 +606,7 @@ function saswp_list_items_generator(){
|
|
606 |
'@id' => $bc_links[$i],
|
607 |
'name' => $bc_titles[$i],
|
608 |
),
|
609 |
-
|
610 |
$j++;
|
611 |
}}
|
612 |
$breadcrumbslist[] = array(
|
@@ -618,6 +618,7 @@ function saswp_list_items_generator(){
|
|
618 |
|
619 |
),
|
620 |
);
|
|
|
621 |
}
|
622 |
if(is_page()){
|
623 |
|
@@ -649,24 +650,31 @@ function saswp_list_items_generator(){
|
|
649 |
}
|
650 |
}
|
651 |
|
652 |
-
return $breadcrumbslist;
|
653 |
}
|
654 |
|
655 |
function saswp_schema_breadcrumb_output($sd_data){
|
656 |
global $sd_data;
|
|
|
657 |
if( (!saswp_non_amp() && $sd_data['saswp-for-amp']!=1) || (saswp_non_amp() && $sd_data['saswp-for-wordpress']!=1) ) {
|
658 |
return ;
|
659 |
}
|
|
|
660 |
if(isset($sd_data['saswp_breadcrumb_schema']) && $sd_data['saswp_breadcrumb_schema'] == 1){
|
661 |
-
|
662 |
-
|
|
|
|
|
|
|
663 |
'@context' => 'http://schema.org',
|
664 |
'@type' => 'BreadcrumbList' ,
|
665 |
-
'itemListElement'
|
666 |
-
);
|
667 |
-
|
668 |
-
|
669 |
-
|
|
|
|
|
670 |
}
|
671 |
}
|
672 |
|
25 |
$sd_google_plus[] = $sd_data['sd_google_plus'];
|
26 |
$sd_social_profile[] = $sd_google_plus;
|
27 |
}
|
|
|
28 |
$sd_instagram = array();
|
29 |
if(isset($sd_data['sd_instagram']) && !empty($sd_data['sd_instagram'])){
|
30 |
$sd_instagram[] = $sd_data['sd_instagram'];
|
166 |
function saswp_schema_output() {
|
167 |
global $sd_data;
|
168 |
|
169 |
+
$Conditionals = saswp_get_all_schema_posts();
|
|
|
170 |
|
171 |
if(!$Conditionals){
|
172 |
return ;
|
314 |
'@context' => 'http://schema.org',
|
315 |
'@type' => $schema_type ,
|
316 |
'url' => get_permalink(),
|
317 |
+
'name' => get_the_title(),
|
318 |
'datePublished' => $date,
|
319 |
'dateModified' => $modified_date,
|
320 |
'description' => get_the_excerpt(),
|
590 |
}
|
591 |
if(isset($sd_data['links'])){
|
592 |
$bc_links = $sd_data['links'];
|
593 |
+
}
|
594 |
+
|
595 |
$j=1;
|
596 |
$i = 0;
|
597 |
+
$breadcrumbslist = array();
|
598 |
if(is_single()){
|
599 |
+
|
600 |
+
if(isset($bc_titles)){
|
601 |
for($i=0;$i<sizeof($bc_titles);$i++){
|
602 |
$breadcrumbslist[] = array(
|
603 |
'@type' => 'ListItem',
|
606 |
'@id' => $bc_links[$i],
|
607 |
'name' => $bc_titles[$i],
|
608 |
),
|
609 |
+
);
|
610 |
$j++;
|
611 |
}}
|
612 |
$breadcrumbslist[] = array(
|
618 |
|
619 |
),
|
620 |
);
|
621 |
+
|
622 |
}
|
623 |
if(is_page()){
|
624 |
|
650 |
}
|
651 |
}
|
652 |
|
653 |
+
return $breadcrumbslist;
|
654 |
}
|
655 |
|
656 |
function saswp_schema_breadcrumb_output($sd_data){
|
657 |
global $sd_data;
|
658 |
+
|
659 |
if( (!saswp_non_amp() && $sd_data['saswp-for-amp']!=1) || (saswp_non_amp() && $sd_data['saswp-for-wordpress']!=1) ) {
|
660 |
return ;
|
661 |
}
|
662 |
+
|
663 |
if(isset($sd_data['saswp_breadcrumb_schema']) && $sd_data['saswp_breadcrumb_schema'] == 1){
|
664 |
+
|
665 |
+
if(is_single() || is_page() ||is_archive()){
|
666 |
+
$bread_crumb_list = saswp_list_items_generator();
|
667 |
+
if(!empty($bread_crumb_list)){
|
668 |
+
$input = array(
|
669 |
'@context' => 'http://schema.org',
|
670 |
'@type' => 'BreadcrumbList' ,
|
671 |
+
'itemListElement' =>$bread_crumb_list,
|
672 |
+
);
|
673 |
+
return json_encode($input);
|
674 |
+
}
|
675 |
+
|
676 |
+
}
|
677 |
+
|
678 |
}
|
679 |
}
|
680 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: mohammed_kaludi, ahmedkaludi, ampforwp
|
|
3 |
Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 4.9.8
|
6 |
-
Stable tag: 1.0.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -65,11 +65,17 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
|
|
65 |
|
66 |
== Changelog ==
|
67 |
|
68 |
-
= 1.0.
|
69 |
-
*
|
70 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
-
= 1.0.2 (28
|
73 |
* First Time Installation Setup Wizard
|
74 |
* Added a Support form to provide faster support
|
75 |
* Full Local Business Schema Markup Support
|
3 |
Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 4.9.8
|
6 |
+
Stable tag: 1.0.3
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
65 |
|
66 |
== Changelog ==
|
67 |
|
68 |
+
= 1.0.3 (24 October 2018) =
|
69 |
+
* Schema Pro migrator
|
70 |
+
* Import / export functionality, so it can be transferred from staging to live website
|
71 |
+
* Added WP Recipe Maker and WP Ultimate Recipe plugins compatibility
|
72 |
+
* Added compatibility with FlexMLS® IDX plugin
|
73 |
+
* Tested security issue and fixed
|
74 |
+
* Breadcrumbs bug fixed
|
75 |
+
* Debug errors
|
76 |
+
* Minor Bugs Fixed
|
77 |
|
78 |
+
= 1.0.2 (28 August 2018) =
|
79 |
* First Time Installation Setup Wizard
|
80 |
* Added a Support form to provide faster support
|
81 |
* Full Local Business Schema Markup Support
|
structured-data-for-wp.php
CHANGED
@@ -2,36 +2,37 @@
|
|
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.0.
|
6 |
Text Domain: schema-and-structured-data-for-wp
|
7 |
Author: Mohammed Kaludi, Ahmed Kaludi
|
8 |
Author URI: http://structured-data-for-wp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/25
|
10 |
License: GPL2
|
11 |
*/
|
12 |
-
|
13 |
// Exit if accessed directly.
|
14 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
15 |
|
16 |
-
define('SASWP_VERSION', '1.0.
|
17 |
define('SASWP_DIR_NAME_FILE', __FILE__ );
|
18 |
define('SASWP_DIR_NAME', dirname( __FILE__ ));
|
19 |
define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
|
20 |
-
|
21 |
-
if ( ! defined( 'SASWP_VERSION' ) ) {
|
22 |
-
define( 'SASWP_VERSION', '1.0.2.1' );
|
23 |
-
}
|
24 |
// the name of the settings page for the license input to be displayed
|
25 |
if(! defined('SASWP_ITEM_FOLDER_NAME')){
|
26 |
$folderName = basename(__DIR__);
|
27 |
define( 'SASWP_ITEM_FOLDER_NAME', $folderName );
|
28 |
}
|
29 |
define('SASWP_PLUGIN_URL', plugin_dir_url( __FILE__ ));
|
30 |
-
|
31 |
// including the output file
|
32 |
require_once SASWP_DIR_NAME .'/output/function.php';
|
33 |
require_once SASWP_DIR_NAME .'/output/output.php';
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
// Non amp checker
|
36 |
if ( ! function_exists('saswp_non_amp') ){
|
37 |
function saswp_non_amp(){
|
@@ -75,8 +76,8 @@ function saswp_admin_notice(){
|
|
75 |
</div>
|
76 |
|
77 |
<div class="updated notice is-dismissible message notice notice-alt saswp-feedback-notice saswp_hide">
|
78 |
-
<p><span class="dashicons dashicons-
|
79 |
-
<a target="_blank" href="https://wordpress.org/plugins/schema-and-structured-data-for-wp"> <?php echo esc_html__('please write us a review', 'schema-and-structured-data-for-wp') ?></a> <a class="saswp-feedback-no-thanks button button-primary"><?php echo esc_html__('No Thanks', 'schema-and-structured-data-for-wp') ?></a>
|
80 |
</p>
|
81 |
</div>
|
82 |
<?php
|
@@ -104,11 +105,10 @@ function saswp_admin_notice(){
|
|
104 |
});
|
105 |
</script>
|
106 |
<?php
|
107 |
-
}
|
108 |
-
|
109 |
//Feedback notice
|
110 |
$activation_date = get_option("saswp_activation_date");
|
111 |
-
$next_days = strtotime("+
|
112 |
$next_days = date('Y-m-d', $next_days);
|
113 |
$current_date = date("Y-m-d");
|
114 |
|
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.0.3
|
6 |
Text Domain: schema-and-structured-data-for-wp
|
7 |
Author: Mohammed Kaludi, Ahmed Kaludi
|
8 |
Author URI: http://structured-data-for-wp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/25
|
10 |
License: GPL2
|
11 |
*/
|
|
|
12 |
// Exit if accessed directly.
|
13 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
14 |
|
15 |
+
define('SASWP_VERSION', '1.0.3');
|
16 |
define('SASWP_DIR_NAME_FILE', __FILE__ );
|
17 |
define('SASWP_DIR_NAME', dirname( __FILE__ ));
|
18 |
define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
|
|
|
|
|
|
|
|
|
19 |
// the name of the settings page for the license input to be displayed
|
20 |
if(! defined('SASWP_ITEM_FOLDER_NAME')){
|
21 |
$folderName = basename(__DIR__);
|
22 |
define( 'SASWP_ITEM_FOLDER_NAME', $folderName );
|
23 |
}
|
24 |
define('SASWP_PLUGIN_URL', plugin_dir_url( __FILE__ ));
|
|
|
25 |
// including the output file
|
26 |
require_once SASWP_DIR_NAME .'/output/function.php';
|
27 |
require_once SASWP_DIR_NAME .'/output/output.php';
|
28 |
|
29 |
+
if ( ! function_exists( 'is_plugin_active' ) )
|
30 |
+
require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
|
31 |
+
|
32 |
+
if ( is_plugin_active('flexmls-idx/flexmls_connect.php') && class_exists('flexmlsConnectPageCore')) {
|
33 |
+
require_once SASWP_DIR_NAME .'/output/flexmls.php';
|
34 |
+
}
|
35 |
+
|
36 |
// Non amp checker
|
37 |
if ( ! function_exists('saswp_non_amp') ){
|
38 |
function saswp_non_amp(){
|
76 |
</div>
|
77 |
|
78 |
<div class="updated notice is-dismissible message notice notice-alt saswp-feedback-notice saswp_hide">
|
79 |
+
<p><span class="dashicons dashicons-thumbs-up"></span> <?php echo esc_html__('You have been using the Schema & structured data for wp plugin for some time now, do you like it?, If so,', 'schema-and-structured-data-for-wp') ?>
|
80 |
+
<a target="_blank" href="https://wordpress.org/plugins/schema-and-structured-data-for-wp/#reviews"> <?php echo esc_html__('please write us a review', 'schema-and-structured-data-for-wp') ?></a> <a class="saswp-feedback-no-thanks button button-primary"><?php echo esc_html__('No Thanks', 'schema-and-structured-data-for-wp') ?></a>
|
81 |
</p>
|
82 |
</div>
|
83 |
<?php
|
105 |
});
|
106 |
</script>
|
107 |
<?php
|
108 |
+
}
|
|
|
109 |
//Feedback notice
|
110 |
$activation_date = get_option("saswp_activation_date");
|
111 |
+
$next_days = strtotime("+7 day", strtotime($activation_date));
|
112 |
$next_days = date('Y-m-d', $next_days);
|
113 |
$current_date = date("Y-m-d");
|
114 |
|
view/schema_type.php
CHANGED
@@ -68,99 +68,99 @@
|
|
68 |
'local_business' => 'Local Business'
|
69 |
);
|
70 |
$all_business_type = array(
|
71 |
-
'animalshelter' => '
|
72 |
-
'automotivebusiness' => '
|
73 |
'childcare' => 'ChildCare',
|
74 |
'dentist' => 'Dentist',
|
75 |
-
'drycleaningorlaundry' => '
|
76 |
-
'emergencyservice' => '
|
77 |
-
'employmentagency' => '
|
78 |
-
'entertainmentbusiness' => '
|
79 |
-
'financialservice' => '
|
80 |
-
'foodestablishment' => '
|
81 |
-
'governmentoffice' => '
|
82 |
-
'healthandbeautybusiness' => '
|
83 |
-
'homeandconstructionbusiness' => '
|
84 |
-
'internetcafe' => '
|
85 |
-
'legalservice' => '
|
86 |
'library' => 'Library',
|
87 |
-
'lodgingbusiness' => '
|
88 |
-
'professionalservice' => '
|
89 |
-
'radiostation' => '
|
90 |
-
'realestateagent' => '
|
91 |
-
'recyclingcenter' => '
|
92 |
-
'selfstorage' => '
|
93 |
-
'shoppingcenter' => '
|
94 |
-
'sportsactivitylocation' => '
|
95 |
'store' => 'Store',
|
96 |
-
'televisionstation' => '
|
97 |
-
'touristinformationcenter' => '
|
98 |
-
'travelagency' => '
|
99 |
);
|
100 |
|
101 |
$all_automotive_array = array(
|
102 |
-
'autobodyshop' => '
|
103 |
-
'autodealer' => '
|
104 |
-
'autopartsstore' => '
|
105 |
-
'autorental' => '
|
106 |
-
'autorepair' => '
|
107 |
-
'autowash' => '
|
108 |
-
'gasstation' => '
|
109 |
-
'motorcycledealer' => '
|
110 |
-
'motorcyclerepair' => '
|
111 |
);
|
112 |
|
113 |
$all_emergency_array = array(
|
114 |
-
'firestation' => '
|
115 |
'hospital' => 'Hospital',
|
116 |
-
'policestation' => '
|
117 |
);
|
118 |
$all_entertainment_array = array(
|
119 |
-
'adultentertainment' => '
|
120 |
-
'amusementpark' => '
|
121 |
-
'artgallery' => '
|
122 |
'casino' => 'Casino',
|
123 |
-
'comedyclub' => '
|
124 |
-
'movietheater' => '
|
125 |
-
'nightclub' => '
|
126 |
|
127 |
);
|
128 |
$all_financial_array = array(
|
129 |
-
'accountingservice' => '
|
130 |
-
'automatedteller' => '
|
131 |
-
'bankorcredit_union' => '
|
132 |
-
'insuranceagency' => '
|
133 |
|
134 |
);
|
135 |
|
136 |
$all_food_establishment_array = array(
|
137 |
'bakery' => 'Bakery',
|
138 |
-
'barorpub' => '
|
139 |
'brewery' => 'Brewery',
|
140 |
-
'cafeorcoffee_shop' => '
|
141 |
-
'fastfoodrestaurant' => '
|
142 |
-
'icecreamshop' => '
|
143 |
'restaurant' => 'Restaurant',
|
144 |
'winery' => 'Winery',
|
145 |
|
146 |
);
|
147 |
$all_health_and_beauty_array = array(
|
148 |
-
'beautysalon' => '
|
149 |
'dayspa' => 'DaySpa',
|
150 |
-
'hairsalon' => '
|
151 |
-
'healthclub' => '
|
152 |
-
'nailsalon' => '
|
153 |
-
'tattooparlor' => '
|
154 |
);
|
155 |
|
156 |
$all_home_and_construction_array = array(
|
157 |
'electrician' => 'Electrician',
|
158 |
-
'generalcontractor' => '
|
159 |
-
'hvacbusiness' => '
|
160 |
'locksmith' => 'Locksmith',
|
161 |
-
'movingcompany' => '
|
162 |
'plumber' => 'Plumber',
|
163 |
-
'roofingcontractor' => '
|
164 |
);
|
165 |
|
166 |
$all_legal_service_array = array(
|
@@ -169,7 +169,7 @@
|
|
169 |
);
|
170 |
|
171 |
$all_lodging_array = array(
|
172 |
-
'bedandbreakfast' => '
|
173 |
'campground' => 'Campground',
|
174 |
'hostel' => 'Hostel',
|
175 |
'hotel' => 'Hotel',
|
@@ -178,47 +178,47 @@
|
|
178 |
);
|
179 |
|
180 |
$all_sports_activity_location = array(
|
181 |
-
'bowlingalley' => '
|
182 |
-
'exercisegym' => '
|
183 |
-
'golfcourse' => '
|
184 |
-
'healthclub' => '
|
185 |
-
'publicswimming_pool' => '
|
186 |
-
'skiresort' => '
|
187 |
-
'sportsclub' => '
|
188 |
-
'stadiumorarena' => '
|
189 |
-
'tenniscomplex' => '
|
190 |
);
|
191 |
$all_store = array(
|
192 |
-
'autopartsstore'=>'
|
193 |
-
'bikestore'=>'
|
194 |
-
'bookstore'=>'
|
195 |
-
'clothingstore'=>'
|
196 |
-
'computerstore'=>'
|
197 |
-
'conveniencestore'=>'
|
198 |
-
'departmentstore'=>'
|
199 |
-
'electronicsstore'=>'
|
200 |
'florist'=>'Florist',
|
201 |
-
'furniturestore'=>'
|
202 |
-
'gardenstore'=>'
|
203 |
-
'grocerystore'=>'
|
204 |
-
'hardwarestore'=>'
|
205 |
-
'hobbyshop'=>'
|
206 |
-
'homegoodsstore'=>'
|
207 |
-
'jewelrystore'=>'
|
208 |
-
'liquorstore'=>'
|
209 |
-
'mensclothingstore'=>'
|
210 |
-
'mobilephonestore'=>'
|
211 |
-
'movierentalstore'=>'
|
212 |
-
'musicstore'=>'
|
213 |
-
'officeequipmentstore'=>'
|
214 |
-
'outletstore'=>'
|
215 |
-
'pawnshop'=>'
|
216 |
-
'petstore'=>'
|
217 |
-
'shoestore'=>'
|
218 |
-
'sportinggoodsstore'=>'
|
219 |
-
'tireshop'=>'
|
220 |
-
'toystore'=>'
|
221 |
-
'wholesalestore'=>'
|
222 |
);
|
223 |
?>
|
224 |
<div class="misc-pub-section">
|
@@ -453,39 +453,39 @@
|
|
453 |
</tr>
|
454 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
455 |
<td><?php echo esc_html__('Business Name', 'schema-and-structured-data-for-wp' ); ?></td>
|
456 |
-
<td><input value="<?php if(isset($business_details['local_business_name'])) { echo $business_details['local_business_name']; } ?>" type="text" name="local_business_name" placeholder="<?php echo esc_html__('Business Name', 'schema-and-structured-data-for-wp' ); ?>"></td>
|
457 |
</tr>
|
458 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
459 |
<td><?php echo esc_html__('Street Address', 'schema-and-structured-data-for-wp' ); ?></td>
|
460 |
-
<td><input value="<?php if(isset($business_details['local_street_address'])) { echo $business_details['local_street_address']; } ?>" type="text" name="local_street_address" placeholder="<?php echo esc_html__('Street Address', 'schema-and-structured-data-for-wp' ); ?>"></td>
|
461 |
</tr>
|
462 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
463 |
<td><?php echo esc_html__('City', 'schema-and-structured-data-for-wp' ); ?></td>
|
464 |
-
<td><input value="<?php if(isset($business_details['local_city'])){ echo $business_details['local_city'];} ?>" type="text" name="local_city" placeholder="<?php echo esc_html__('City', 'schema-and-structured-data-for-wp' ); ?>"></td>
|
465 |
</tr>
|
466 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
467 |
<td><?php echo esc_html__('State', 'schema-and-structured-data-for-wp' ); ?></td>
|
468 |
-
<td><input value="<?php if(isset($business_details['local_state'])){echo $business_details['local_state'];} ?>" type="text" name="local_state" placeholder="<?php echo esc_html__('State', 'schema-and-structured-data-for-wp' ); ?>"></td>
|
469 |
</tr>
|
470 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
471 |
<td><?php echo esc_html__('Postal Code', 'schema-and-structured-data-for-wp' ); ?></td>
|
472 |
-
<td><input value="<?php if(isset($business_details['local_postal_code'])) {echo $business_details['local_postal_code']; } ?>" type="text" name="local_postal_code" placeholder="<?php echo esc_html__('Postal Code', 'schema-and-structured-data-for-wp' ); ?>"></td>
|
473 |
</tr>
|
474 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
475 |
<td><?php echo esc_html__('Phone', 'schema-and-structured-data-for-wp' ); ?></td>
|
476 |
-
<td><input value="<?php if(isset($business_details['local_phone'])){echo $business_details['local_phone']; } ?>" type="text" name="local_phone" placeholder="<?php echo esc_html__('Phone', 'schema-and-structured-data-for-wp' ); ?>"></td>
|
477 |
</tr>
|
478 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
479 |
<td><?php echo esc_html__('Website', 'schema-and-structured-data-for-wp' ); ?></td>
|
480 |
-
<td><input value="<?php if(isset($business_details['local_website'])){echo $business_details['local_website']; }else{ echo site_url();} ?>" type="text" name="local_website" placeholder="<?php echo esc_html__('Website', 'schema-and-structured-data-for-wp' ); ?>"></td>
|
481 |
</tr>
|
482 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
483 |
<td><?php echo esc_html__('Image', 'schema-and-structured-data-for-wp' ); ?></td>
|
484 |
<td style="display: flex; width: 97%">
|
485 |
-
<input value="<?php if(isset($business_details['local_business_logo'])) { echo $business_details['local_business_logo']['url'];} else { echo $logo[0]; } ?>" id="local_business_logo" type="text" name="local_business_logo[url]" placeholder="<?php echo esc_html__('Logo', 'schema-and-structured-data-for-wp' ); ?>" readonly="readonly" style="background: #FFF;">
|
486 |
-
<input value="<?php if(isset($business_details['local_business_logo'])) { echo $business_details['local_business_logo']['id'];} else { echo $custom_logo_id; }?>" data-id="local_business_logo_id" type="hidden" name="local_business_logo[id]">
|
487 |
-
<input value="<?php if(isset($business_details['local_business_logo'])) { echo $business_details['local_business_logo']['width'];} else { echo $logo[1]; } ?>" data-id="local_business_logo_width" type="hidden" name="local_business_logo[width]">
|
488 |
-
<input value="<?php if(isset($business_details['local_business_logo'])) { echo $business_details['local_business_logo']['height'];} else { echo $logo[2]; } ?>" data-id="local_business_logo_height" type="hidden" name="local_business_logo[height]">
|
489 |
<input data-id="media" class="button" id="local_business_logo_button" type="button" value="Upload"></td>
|
490 |
</tr>
|
491 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
@@ -509,15 +509,15 @@
|
|
509 |
</tr>
|
510 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
511 |
<td><?php echo esc_html__('Opens', 'schema-and-structured-data-for-wp' ); ?></td>
|
512 |
-
<td><input id="saswp-dayofweek-opens-time" value="<?php if(isset($business_details['local_opens_time'])){echo $business_details['local_opens_time']; } ?>" type="text" name="local_opens_time" ></td>
|
513 |
</tr>
|
514 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
515 |
<td><?php echo esc_html__('Closes', 'schema-and-structured-data-for-wp' ); ?></td>
|
516 |
-
<td><input id="saswp-dayofweek-closes-time" value="<?php if(isset($business_details['local_closes_time'])){echo $business_details['local_closes_time']; } ?>" type="text" name="local_closes_time" ></td>
|
517 |
</tr>
|
518 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
519 |
<td><?php echo esc_html__('Price Range', 'schema-and-structured-data-for-wp' ); ?></td>
|
520 |
-
<td><input value="<?php if(isset($business_details['local_price_range'])){echo $business_details['local_price_range']; } ?>" type="text" name="local_price_range" placeholder="<?php echo esc_html__('$10-$50 or $$$ ', 'schema-and-structured-data-for-wp' ); ?>" ></td>
|
521 |
</tr>
|
522 |
</table>
|
523 |
|
@@ -525,7 +525,8 @@
|
|
525 |
<?php
|
526 |
}
|
527 |
|
528 |
-
function saswp_schema_type_add_meta_box_save( $post_id ) {
|
|
|
529 |
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
|
530 |
if ( ! isset( $_POST['saswp_schema_type_nonce'] ) || ! wp_verify_nonce( $_POST['saswp_schema_type_nonce'], 'saswp_schema_type_nonce' ) ) return;
|
531 |
if ( ! current_user_can( 'edit_post', $post_id ) ) return;
|
@@ -536,14 +537,10 @@
|
|
536 |
|
537 |
if ( isset( $_POST['saswp_business_type'] ) ){
|
538 |
update_post_meta( $post_id, 'saswp_business_type', esc_attr( $_POST['saswp_business_type'] ) );
|
539 |
-
}else{
|
540 |
-
update_post_meta( $post_id, 'saswp_business_type','');
|
541 |
}
|
542 |
|
543 |
if ( isset( $_POST['saswp_business_name'] ) ){
|
544 |
update_post_meta( $post_id, 'saswp_business_name', esc_attr( $_POST['saswp_business_name'] ) );
|
545 |
-
}else{
|
546 |
-
update_post_meta( $post_id, 'saswp_business_name', '' );
|
547 |
}
|
548 |
|
549 |
$local_business_details = array();
|
68 |
'local_business' => 'Local Business'
|
69 |
);
|
70 |
$all_business_type = array(
|
71 |
+
'animalshelter' => 'Animal Shelter',
|
72 |
+
'automotivebusiness' => 'Automotive Business',
|
73 |
'childcare' => 'ChildCare',
|
74 |
'dentist' => 'Dentist',
|
75 |
+
'drycleaningorlaundry' => 'Dry Cleaning Or Laundry',
|
76 |
+
'emergencyservice' => 'Emergency Service',
|
77 |
+
'employmentagency' => 'Employment Agency',
|
78 |
+
'entertainmentbusiness' => 'Entertainment Business',
|
79 |
+
'financialservice' => 'Financial Service',
|
80 |
+
'foodestablishment' => 'Food Establishment',
|
81 |
+
'governmentoffice' => 'Government Office',
|
82 |
+
'healthandbeautybusiness' => 'Health And Beauty Business',
|
83 |
+
'homeandconstructionbusiness' => 'Home And Construction Business',
|
84 |
+
'internetcafe' => 'Internet Cafe',
|
85 |
+
'legalservice' => 'Legal Service',
|
86 |
'library' => 'Library',
|
87 |
+
'lodgingbusiness' => 'Lodging Business',
|
88 |
+
'professionalservice' => 'Professional Service',
|
89 |
+
'radiostation' => 'Radio Station',
|
90 |
+
'realestateagent' => 'Real Estate Agent',
|
91 |
+
'recyclingcenter' => 'Recycling Center',
|
92 |
+
'selfstorage' => 'Self Storage',
|
93 |
+
'shoppingcenter' => 'Shopping Center',
|
94 |
+
'sportsactivitylocation' => 'Sports Activity Location',
|
95 |
'store' => 'Store',
|
96 |
+
'televisionstation' => 'Television Station',
|
97 |
+
'touristinformationcenter' => 'Tourist Information Center',
|
98 |
+
'travelagency' => 'Travel Agency',
|
99 |
);
|
100 |
|
101 |
$all_automotive_array = array(
|
102 |
+
'autobodyshop' => 'Auto Body Shop',
|
103 |
+
'autodealer' => 'Auto Dealer',
|
104 |
+
'autopartsstore' => 'Auto Parts Store',
|
105 |
+
'autorental' => 'Auto Rental',
|
106 |
+
'autorepair' => 'Auto Repair',
|
107 |
+
'autowash' => 'Auto Wash',
|
108 |
+
'gasstation' => 'Gas Station',
|
109 |
+
'motorcycledealer' => 'Motorcycle Dealer',
|
110 |
+
'motorcyclerepair' => 'Motorcycle Repair'
|
111 |
);
|
112 |
|
113 |
$all_emergency_array = array(
|
114 |
+
'firestation' => 'Fire Station',
|
115 |
'hospital' => 'Hospital',
|
116 |
+
'policestation' => 'Police Station',
|
117 |
);
|
118 |
$all_entertainment_array = array(
|
119 |
+
'adultentertainment' => 'Adult Entertainment',
|
120 |
+
'amusementpark' => 'Amusement Park',
|
121 |
+
'artgallery' => 'Art Gallery',
|
122 |
'casino' => 'Casino',
|
123 |
+
'comedyclub' => 'Comedy Club',
|
124 |
+
'movietheater' => 'Movie Theater',
|
125 |
+
'nightclub' => 'Night Club',
|
126 |
|
127 |
);
|
128 |
$all_financial_array = array(
|
129 |
+
'accountingservice' => 'Accounting Service',
|
130 |
+
'automatedteller' => 'Automated Teller',
|
131 |
+
'bankorcredit_union' => 'Bank Or Credit Union',
|
132 |
+
'insuranceagency' => 'Insurance Agency',
|
133 |
|
134 |
);
|
135 |
|
136 |
$all_food_establishment_array = array(
|
137 |
'bakery' => 'Bakery',
|
138 |
+
'barorpub' => 'Bar Or Pub',
|
139 |
'brewery' => 'Brewery',
|
140 |
+
'cafeorcoffee_shop' => 'Cafe Or Coffee Shop',
|
141 |
+
'fastfoodrestaurant' => 'Fast Food Restaurant',
|
142 |
+
'icecreamshop' => 'Ice Cream Shop',
|
143 |
'restaurant' => 'Restaurant',
|
144 |
'winery' => 'Winery',
|
145 |
|
146 |
);
|
147 |
$all_health_and_beauty_array = array(
|
148 |
+
'beautysalon' => 'Beauty Salon',
|
149 |
'dayspa' => 'DaySpa',
|
150 |
+
'hairsalon' => 'Hair Salon',
|
151 |
+
'healthclub' => 'Health Club',
|
152 |
+
'nailsalon' => 'Nail Salon',
|
153 |
+
'tattooparlor' => 'Tattoo Parlor',
|
154 |
);
|
155 |
|
156 |
$all_home_and_construction_array = array(
|
157 |
'electrician' => 'Electrician',
|
158 |
+
'generalcontractor' => 'General Contractor',
|
159 |
+
'hvacbusiness' => 'HVAC Business',
|
160 |
'locksmith' => 'Locksmith',
|
161 |
+
'movingcompany' => 'Moving Company',
|
162 |
'plumber' => 'Plumber',
|
163 |
+
'roofingcontractor' => 'Roofing Contractor',
|
164 |
);
|
165 |
|
166 |
$all_legal_service_array = array(
|
169 |
);
|
170 |
|
171 |
$all_lodging_array = array(
|
172 |
+
'bedandbreakfast' => 'Bed And Breakfast',
|
173 |
'campground' => 'Campground',
|
174 |
'hostel' => 'Hostel',
|
175 |
'hotel' => 'Hotel',
|
178 |
);
|
179 |
|
180 |
$all_sports_activity_location = array(
|
181 |
+
'bowlingalley' => 'Bowling Alley',
|
182 |
+
'exercisegym' => 'Exercise Gym',
|
183 |
+
'golfcourse' => 'Golf Course',
|
184 |
+
'healthclub' => 'Health Club',
|
185 |
+
'publicswimming_pool' => 'Public Swimming Pool',
|
186 |
+
'skiresort' => 'Ski Resort',
|
187 |
+
'sportsclub' => 'Sports Club',
|
188 |
+
'stadiumorarena' => 'Stadium Or Arena',
|
189 |
+
'tenniscomplex' => 'Tennis Complex'
|
190 |
);
|
191 |
$all_store = array(
|
192 |
+
'autopartsstore'=>'Auto Parts Store',
|
193 |
+
'bikestore'=>'Bike Store',
|
194 |
+
'bookstore'=>'Book Store',
|
195 |
+
'clothingstore'=>'Clothing Store',
|
196 |
+
'computerstore'=>'Computer Store',
|
197 |
+
'conveniencestore'=>'Convenience Store',
|
198 |
+
'departmentstore'=>'Department Store',
|
199 |
+
'electronicsstore'=>'Electronics Store',
|
200 |
'florist'=>'Florist',
|
201 |
+
'furniturestore'=>'Furniture Store',
|
202 |
+
'gardenstore'=>'Garden Store',
|
203 |
+
'grocerystore'=>'Grocery Store',
|
204 |
+
'hardwarestore'=>'Hardware Store',
|
205 |
+
'hobbyshop'=>'Hobby Shop',
|
206 |
+
'homegoodsstore'=>'HomeGoods Store',
|
207 |
+
'jewelrystore'=>'Jewelry Store',
|
208 |
+
'liquorstore'=>'Liquor Store',
|
209 |
+
'mensclothingstore'=>'Mens Clothing Store',
|
210 |
+
'mobilephonestore'=>'Mobile Phone Store',
|
211 |
+
'movierentalstore'=>'Movie Rental Store',
|
212 |
+
'musicstore'=>'Music Store',
|
213 |
+
'officeequipmentstore'=>'Office Equipment Store',
|
214 |
+
'outletstore'=>'Outlet Store',
|
215 |
+
'pawnshop'=>'Pawn Shop',
|
216 |
+
'petstore'=>'Pet Store',
|
217 |
+
'shoestore'=>'Shoe Store',
|
218 |
+
'sportinggoodsstore'=>'Sporting Goods Store',
|
219 |
+
'tireshop'=>'Tire Shop',
|
220 |
+
'toystore'=>'Toy Store',
|
221 |
+
'wholesalestore'=>'Wholesale Store'
|
222 |
);
|
223 |
?>
|
224 |
<div class="misc-pub-section">
|
453 |
</tr>
|
454 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
455 |
<td><?php echo esc_html__('Business Name', 'schema-and-structured-data-for-wp' ); ?></td>
|
456 |
+
<td><input value="<?php if(isset($business_details['local_business_name'])) { echo esc_attr($business_details['local_business_name']); } ?>" type="text" name="local_business_name" placeholder="<?php echo esc_html__('Business Name', 'schema-and-structured-data-for-wp' ); ?>"></td>
|
457 |
</tr>
|
458 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
459 |
<td><?php echo esc_html__('Street Address', 'schema-and-structured-data-for-wp' ); ?></td>
|
460 |
+
<td><input value="<?php if(isset($business_details['local_street_address'])) { echo esc_attr($business_details['local_street_address']); } ?>" type="text" name="local_street_address" placeholder="<?php echo esc_html__('Street Address', 'schema-and-structured-data-for-wp' ); ?>"></td>
|
461 |
</tr>
|
462 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
463 |
<td><?php echo esc_html__('City', 'schema-and-structured-data-for-wp' ); ?></td>
|
464 |
+
<td><input value="<?php if(isset($business_details['local_city'])){ echo esc_attr($business_details['local_city']);} ?>" type="text" name="local_city" placeholder="<?php echo esc_html__('City', 'schema-and-structured-data-for-wp' ); ?>"></td>
|
465 |
</tr>
|
466 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
467 |
<td><?php echo esc_html__('State', 'schema-and-structured-data-for-wp' ); ?></td>
|
468 |
+
<td><input value="<?php if(isset($business_details['local_state'])){echo esc_attr($business_details['local_state']);} ?>" type="text" name="local_state" placeholder="<?php echo esc_html__('State', 'schema-and-structured-data-for-wp' ); ?>"></td>
|
469 |
</tr>
|
470 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
471 |
<td><?php echo esc_html__('Postal Code', 'schema-and-structured-data-for-wp' ); ?></td>
|
472 |
+
<td><input value="<?php if(isset($business_details['local_postal_code'])) {echo esc_attr($business_details['local_postal_code']); } ?>" type="text" name="local_postal_code" placeholder="<?php echo esc_html__('Postal Code', 'schema-and-structured-data-for-wp' ); ?>"></td>
|
473 |
</tr>
|
474 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
475 |
<td><?php echo esc_html__('Phone', 'schema-and-structured-data-for-wp' ); ?></td>
|
476 |
+
<td><input value="<?php if(isset($business_details['local_phone'])){echo esc_attr($business_details['local_phone']); } ?>" type="text" name="local_phone" placeholder="<?php echo esc_html__('Phone', 'schema-and-structured-data-for-wp' ); ?>"></td>
|
477 |
</tr>
|
478 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
479 |
<td><?php echo esc_html__('Website', 'schema-and-structured-data-for-wp' ); ?></td>
|
480 |
+
<td><input value="<?php if(isset($business_details['local_website'])){echo esc_attr($business_details['local_website']); }else{ echo site_url();} ?>" type="text" name="local_website" placeholder="<?php echo esc_html__('Website', 'schema-and-structured-data-for-wp' ); ?>"></td>
|
481 |
</tr>
|
482 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
483 |
<td><?php echo esc_html__('Image', 'schema-and-structured-data-for-wp' ); ?></td>
|
484 |
<td style="display: flex; width: 97%">
|
485 |
+
<input value="<?php if(isset($business_details['local_business_logo'])) { echo esc_url($business_details['local_business_logo']['url']);} else { echo esc_url($logo[0]); } ?>" id="local_business_logo" type="text" name="local_business_logo[url]" placeholder="<?php echo esc_html__('Logo', 'schema-and-structured-data-for-wp' ); ?>" readonly="readonly" style="background: #FFF;">
|
486 |
+
<input value="<?php if(isset($business_details['local_business_logo'])) { echo esc_attr($business_details['local_business_logo']['id']);} else { echo esc_attr($custom_logo_id); }?>" data-id="local_business_logo_id" type="hidden" name="local_business_logo[id]">
|
487 |
+
<input value="<?php if(isset($business_details['local_business_logo'])) { echo esc_attr($business_details['local_business_logo']['width']);} else { echo esc_attr($logo[1]); } ?>" data-id="local_business_logo_width" type="hidden" name="local_business_logo[width]">
|
488 |
+
<input value="<?php if(isset($business_details['local_business_logo'])) { echo esc_attr($business_details['local_business_logo']['height']);} else { echo esc_attr($logo[2]); } ?>" data-id="local_business_logo_height" type="hidden" name="local_business_logo[height]">
|
489 |
<input data-id="media" class="button" id="local_business_logo_button" type="button" value="Upload"></td>
|
490 |
</tr>
|
491 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
509 |
</tr>
|
510 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
511 |
<td><?php echo esc_html__('Opens', 'schema-and-structured-data-for-wp' ); ?></td>
|
512 |
+
<td><input id="saswp-dayofweek-opens-time" value="<?php if(isset($business_details['local_opens_time'])){echo esc_attr($business_details['local_opens_time']); } ?>" type="text" name="local_opens_time" ></td>
|
513 |
</tr>
|
514 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
515 |
<td><?php echo esc_html__('Closes', 'schema-and-structured-data-for-wp' ); ?></td>
|
516 |
+
<td><input id="saswp-dayofweek-closes-time" value="<?php if(isset($business_details['local_closes_time'])){echo esc_attr($business_details['local_closes_time']); } ?>" type="text" name="local_closes_time" ></td>
|
517 |
</tr>
|
518 |
<tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
|
519 |
<td><?php echo esc_html__('Price Range', 'schema-and-structured-data-for-wp' ); ?></td>
|
520 |
+
<td><input value="<?php if(isset($business_details['local_price_range'])){echo esc_attr($business_details['local_price_range']); } ?>" type="text" name="local_price_range" placeholder="<?php echo esc_html__('$10-$50 or $$$ ', 'schema-and-structured-data-for-wp' ); ?>" ></td>
|
521 |
</tr>
|
522 |
</table>
|
523 |
|
525 |
<?php
|
526 |
}
|
527 |
|
528 |
+
function saswp_schema_type_add_meta_box_save( $post_id ) {
|
529 |
+
|
530 |
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
|
531 |
if ( ! isset( $_POST['saswp_schema_type_nonce'] ) || ! wp_verify_nonce( $_POST['saswp_schema_type_nonce'], 'saswp_schema_type_nonce' ) ) return;
|
532 |
if ( ! current_user_can( 'edit_post', $post_id ) ) return;
|
537 |
|
538 |
if ( isset( $_POST['saswp_business_type'] ) ){
|
539 |
update_post_meta( $post_id, 'saswp_business_type', esc_attr( $_POST['saswp_business_type'] ) );
|
|
|
|
|
540 |
}
|
541 |
|
542 |
if ( isset( $_POST['saswp_business_name'] ) ){
|
543 |
update_post_meta( $post_id, 'saswp_business_name', esc_attr( $_POST['saswp_business_name'] ) );
|
|
|
|
|
544 |
}
|
545 |
|
546 |
$local_business_details = array();
|