Version Description
(2016-01-03) =
- Added : Schema.org type "LocalBusiness".
- Fixed : Organization Definition minor bug fixed.
Download this release
Release Info
Developer | miiitaka |
Plugin | Markup (JSON-LD) structured in schema.org |
Version | 2.3.0 |
Comparing to | |
See all releases |
Code changes from version 2.2.1 to 2.3.0
- css/style.css +10 -6
- includes/wp-structuring-admin-db.php +11 -10
- includes/wp-structuring-admin-post.php +11 -0
- includes/wp-structuring-admin-type-article.php +3 -3
- includes/wp-structuring-admin-type-blog-posting.php +4 -4
- includes/wp-structuring-admin-type-local-business.php +408 -0
- includes/wp-structuring-admin-type-news-article.php +4 -4
- includes/wp-structuring-admin-type-organization.php +7 -8
- includes/wp-structuring-display.php +80 -2
- readme.txt +7 -1
- wp-structuring-markup.php +4 -4
css/style.css
CHANGED
@@ -30,21 +30,25 @@
|
|
30 |
}
|
31 |
.schema-admin-table caption {
|
32 |
border-left: solid 4px #00a0d2;
|
33 |
-
margin: 0 0
|
34 |
padding: 3px 0 3px 7px;
|
35 |
text-align: left;
|
36 |
}
|
37 |
.schema-admin-table th {
|
38 |
-
|
|
|
39 |
text-align: right;
|
40 |
-
vertical-align:
|
41 |
-
width:
|
|
|
|
|
|
|
42 |
}
|
43 |
-
.schema-admin-table td label{
|
44 |
margin: 0 10px 0 0;
|
45 |
}
|
46 |
.schema-admin-table small {
|
47 |
-
margin: 0 0 0
|
48 |
}
|
49 |
.schema-admin-table input[type="checkbox"] {
|
50 |
margin: 0 5px 0 0;
|
30 |
}
|
31 |
.schema-admin-table caption {
|
32 |
border-left: solid 4px #00a0d2;
|
33 |
+
margin: 0 0 5px 0;
|
34 |
padding: 3px 0 3px 7px;
|
35 |
text-align: left;
|
36 |
}
|
37 |
.schema-admin-table th {
|
38 |
+
height: 2em;
|
39 |
+
padding: 0 5px 0 0;
|
40 |
text-align: right;
|
41 |
+
vertical-align: middle;
|
42 |
+
width: 150px;
|
43 |
+
}
|
44 |
+
.schema-admin-table td {
|
45 |
+
vertical-align: middle;
|
46 |
}
|
47 |
+
.schema-admin-table td label {
|
48 |
margin: 0 10px 0 0;
|
49 |
}
|
50 |
.schema-admin-table small {
|
51 |
+
margin: 0 0 0 5px;
|
52 |
}
|
53 |
.schema-admin-table input[type="checkbox"] {
|
54 |
margin: 0 5px 0 0;
|
includes/wp-structuring-admin-db.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Schema.org Admin DB Connection
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
* @since 1.0.0
|
7 |
-
* @version 2.
|
8 |
*/
|
9 |
class Structuring_Markup_Admin_Db {
|
10 |
|
@@ -12,19 +12,20 @@ class Structuring_Markup_Admin_Db {
|
|
12 |
* Variable definition.
|
13 |
*
|
14 |
* @since 1.0.0
|
15 |
-
* @version 2.
|
16 |
*/
|
17 |
private $table_name;
|
18 |
|
19 |
/** Schema.org Type defined. */
|
20 |
public $type_array = array(
|
21 |
-
"article"
|
22 |
-
"blog_posting"
|
23 |
-
"breadcrumb"
|
24 |
-
"event"
|
25 |
-
"
|
26 |
-
"
|
27 |
-
"
|
|
|
28 |
);
|
29 |
|
30 |
/**
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Schema.org Admin DB Connection.
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
* @since 1.0.0
|
7 |
+
* @version 2.3.0
|
8 |
*/
|
9 |
class Structuring_Markup_Admin_Db {
|
10 |
|
12 |
* Variable definition.
|
13 |
*
|
14 |
* @since 1.0.0
|
15 |
+
* @version 2.3.0
|
16 |
*/
|
17 |
private $table_name;
|
18 |
|
19 |
/** Schema.org Type defined. */
|
20 |
public $type_array = array(
|
21 |
+
"article" => "Article",
|
22 |
+
"blog_posting" => "Blog Posting",
|
23 |
+
"breadcrumb" => "Breadcrumb",
|
24 |
+
"event" => "Event",
|
25 |
+
"local_business" => "Local Business",
|
26 |
+
"news_article" => "News Article",
|
27 |
+
"organization" => "Organization",
|
28 |
+
"website" => "Web Site"
|
29 |
);
|
30 |
|
31 |
/**
|
includes/wp-structuring-admin-post.php
CHANGED
@@ -148,6 +148,17 @@ class Structuring_Markup_Admin_Post {
|
|
148 |
require_once ( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-event.php' );
|
149 |
new Structuring_Markup_Type_Event();
|
150 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
case 'news_article':
|
152 |
$html = $this->output_checkbox_render( $options['output'], "post", "Post", esc_html__( 'Post Page', $this->text_domain ) );
|
153 |
$html .= '</td></tr></table><hr>';
|
148 |
require_once ( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-event.php' );
|
149 |
new Structuring_Markup_Type_Event();
|
150 |
break;
|
151 |
+
case 'local_business':
|
152 |
+
$html = $this->output_checkbox_render( $options['output'], "all", "All", esc_html__( 'All Page', $this->text_domain ) );
|
153 |
+
$html .= $this->output_checkbox_render( $options['output'], "home", "Top", esc_html__( 'Top Page', $this->text_domain ) );
|
154 |
+
$html .= $this->output_checkbox_render( $options['output'], "post", "Post", esc_html__( 'Post Page', $this->text_domain ) );
|
155 |
+
$html .= $this->output_checkbox_render( $options['output'], "page", "Fixed", esc_html__( 'Fixed Page', $this->text_domain ) );
|
156 |
+
$html .= '</td></tr></table><hr>';
|
157 |
+
echo $html;
|
158 |
+
|
159 |
+
require_once ( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-local-business.php' );
|
160 |
+
new Structuring_Markup_Type_LocalBusiness( $options['option'] );
|
161 |
+
break;
|
162 |
case 'news_article':
|
163 |
$html = $this->output_checkbox_render( $options['output'], "post", "Post", esc_html__( 'Post Page', $this->text_domain ) );
|
164 |
$html .= '</td></tr></table><hr>';
|
includes/wp-structuring-admin-type-article.php
CHANGED
@@ -44,14 +44,14 @@ class Structuring_Markup_Type_Article {
|
|
44 |
echo $html;
|
45 |
|
46 |
$html = '<table class="schema-admin-table">';
|
47 |
-
$html .= '<caption>mainEntityOfPage( recommended )</caption>';
|
48 |
$html .= '<tr><th>@type :</th><td><small>"WebPage"</small></td></tr>';
|
49 |
$html .= '<tr><th>@id :</th><td><small>Default : get_permalink( ID )</small></td></tr>';
|
50 |
$html .= '</table>';
|
51 |
echo $html;
|
52 |
|
53 |
$html = '<table class="schema-admin-table">';
|
54 |
-
$html .= '<caption>image( required )</caption>';
|
55 |
$html .= '<tr><th>@type :</th><td><small>"ImageObject"</small></td></tr>';
|
56 |
$html .= '<tr><th>url :</th><td><small>Default : thumbnail</small></td></tr>';
|
57 |
$html .= '<tr><th>height :</th><td><small>Auto : The height of the image, in pixels.</small></td></tr>';
|
@@ -70,7 +70,7 @@ class Structuring_Markup_Type_Article {
|
|
70 |
echo $html;
|
71 |
|
72 |
$html = '<table class="schema-admin-table">';
|
73 |
-
$html .= '<caption>logo( required )</caption>';
|
74 |
$html .= '<tr><th>@type :</th><td><small>"ImageObject"</small></td></tr>';
|
75 |
$html .= '<tr><th><label for="logo">url :</label></th><td>';
|
76 |
$html .= '<input type="text" name="option[' . "logo" . ']" id="logo" class="regular-text" required value="' . esc_attr( $option['logo'] ) . '">';
|
44 |
echo $html;
|
45 |
|
46 |
$html = '<table class="schema-admin-table">';
|
47 |
+
$html .= '<caption>mainEntityOfPage ( recommended )</caption>';
|
48 |
$html .= '<tr><th>@type :</th><td><small>"WebPage"</small></td></tr>';
|
49 |
$html .= '<tr><th>@id :</th><td><small>Default : get_permalink( ID )</small></td></tr>';
|
50 |
$html .= '</table>';
|
51 |
echo $html;
|
52 |
|
53 |
$html = '<table class="schema-admin-table">';
|
54 |
+
$html .= '<caption>image ( required )</caption>';
|
55 |
$html .= '<tr><th>@type :</th><td><small>"ImageObject"</small></td></tr>';
|
56 |
$html .= '<tr><th>url :</th><td><small>Default : thumbnail</small></td></tr>';
|
57 |
$html .= '<tr><th>height :</th><td><small>Auto : The height of the image, in pixels.</small></td></tr>';
|
70 |
echo $html;
|
71 |
|
72 |
$html = '<table class="schema-admin-table">';
|
73 |
+
$html .= '<caption>logo ( required )</caption>';
|
74 |
$html .= '<tr><th>@type :</th><td><small>"ImageObject"</small></td></tr>';
|
75 |
$html .= '<tr><th><label for="logo">url :</label></th><td>';
|
76 |
$html .= '<input type="text" name="option[' . "logo" . ']" id="logo" class="regular-text" required value="' . esc_attr( $option['logo'] ) . '">';
|
includes/wp-structuring-admin-type-blog-posting.php
CHANGED
@@ -44,14 +44,14 @@ class Structuring_Markup_Type_Blog_Posting {
|
|
44 |
echo $html;
|
45 |
|
46 |
$html = '<table class="schema-admin-table">';
|
47 |
-
$html .= '<caption>mainEntityOfPage( recommended )</caption>';
|
48 |
$html .= '<tr><th>@type :</th><td><small>"WebPage"</small></td></tr>';
|
49 |
$html .= '<tr><th>@id :</th><td><small>Default : get_permalink( ID )</small></td></tr>';
|
50 |
$html .= '</table>';
|
51 |
echo $html;
|
52 |
|
53 |
$html = '<table class="schema-admin-table">';
|
54 |
-
$html .= '<caption>image( required )</caption>';
|
55 |
$html .= '<tr><th>@type :</th><td><small>"ImageObject"</small></td></tr>';
|
56 |
$html .= '<tr><th>url :</th><td><small>Default : thumbnail</small></td></tr>';
|
57 |
$html .= '<tr><th>height :</th><td><small>Auto : The height of the image, in pixels.</small></td></tr>';
|
@@ -60,7 +60,7 @@ class Structuring_Markup_Type_Blog_Posting {
|
|
60 |
echo $html;
|
61 |
|
62 |
$html = '<table class="schema-admin-table">';
|
63 |
-
$html .= '<caption>publisher( required )</caption>';
|
64 |
$html .= '<tr><th>@type :</th><td><small>"Organization"</small></td></tr>';
|
65 |
$html .= '<tr><th><label for="name">Organization Name :</label></th><td>';
|
66 |
$html .= '<input type="text" name="option[' . "name" . ']" id="name" class="regular-text" required value="' . esc_attr( $option['name'] ) . '">';
|
@@ -70,7 +70,7 @@ class Structuring_Markup_Type_Blog_Posting {
|
|
70 |
echo $html;
|
71 |
|
72 |
$html = '<table class="schema-admin-table">';
|
73 |
-
$html .= '<caption>logo( required )</caption>';
|
74 |
$html .= '<tr><th>@type :</th><td><small>"ImageObject"</small></td></tr>';
|
75 |
$html .= '<tr><th><label for="logo">url :</label></th><td>';
|
76 |
$html .= '<input type="text" name="option[' . "logo" . ']" id="logo" class="regular-text" required value="' . esc_attr( $option['logo'] ) . '">';
|
44 |
echo $html;
|
45 |
|
46 |
$html = '<table class="schema-admin-table">';
|
47 |
+
$html .= '<caption>mainEntityOfPage ( recommended )</caption>';
|
48 |
$html .= '<tr><th>@type :</th><td><small>"WebPage"</small></td></tr>';
|
49 |
$html .= '<tr><th>@id :</th><td><small>Default : get_permalink( ID )</small></td></tr>';
|
50 |
$html .= '</table>';
|
51 |
echo $html;
|
52 |
|
53 |
$html = '<table class="schema-admin-table">';
|
54 |
+
$html .= '<caption>image ( required )</caption>';
|
55 |
$html .= '<tr><th>@type :</th><td><small>"ImageObject"</small></td></tr>';
|
56 |
$html .= '<tr><th>url :</th><td><small>Default : thumbnail</small></td></tr>';
|
57 |
$html .= '<tr><th>height :</th><td><small>Auto : The height of the image, in pixels.</small></td></tr>';
|
60 |
echo $html;
|
61 |
|
62 |
$html = '<table class="schema-admin-table">';
|
63 |
+
$html .= '<caption>publisher ( required )</caption>';
|
64 |
$html .= '<tr><th>@type :</th><td><small>"Organization"</small></td></tr>';
|
65 |
$html .= '<tr><th><label for="name">Organization Name :</label></th><td>';
|
66 |
$html .= '<input type="text" name="option[' . "name" . ']" id="name" class="regular-text" required value="' . esc_attr( $option['name'] ) . '">';
|
70 |
echo $html;
|
71 |
|
72 |
$html = '<table class="schema-admin-table">';
|
73 |
+
$html .= '<caption>logo ( required )</caption>';
|
74 |
$html .= '<tr><th>@type :</th><td><small>"ImageObject"</small></td></tr>';
|
75 |
$html .= '<tr><th><label for="logo">url :</label></th><td>';
|
76 |
$html .= '<input type="text" name="option[' . "logo" . ']" id="logo" class="regular-text" required value="' . esc_attr( $option['logo'] ) . '">';
|
includes/wp-structuring-admin-type-local-business.php
ADDED
@@ -0,0 +1,408 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Schema.org Type Organization
|
4 |
+
*
|
5 |
+
* @author Kazuya Takami
|
6 |
+
* @since 2.3.0
|
7 |
+
* @see wp-structuring-admin-db.php
|
8 |
+
* @link http://schema.org/LocalBusiness
|
9 |
+
* @link https://developers.google.com/structured-data/local-businesses/
|
10 |
+
*/
|
11 |
+
class Structuring_Markup_Type_LocalBusiness {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Variable definition.
|
15 |
+
*
|
16 |
+
* @since 2.3.0
|
17 |
+
*/
|
18 |
+
/** LoacalBusiness Type defined. */
|
19 |
+
private $business_type_array = array(
|
20 |
+
array( "type" => "LocalBusiness", "display" => "LocalBusiness" ),
|
21 |
+
|
22 |
+
array( "type" => "AnimalShelter", "display" => "- AnimalShelter" ),
|
23 |
+
|
24 |
+
array( "type" => "AutomotiveBusiness", "display" => "- AutomotiveBusiness" ),
|
25 |
+
array( "type" => "AutoBodyShop", "display" => "-- AutoBodyShop" ),
|
26 |
+
array( "type" => "AutoDealer", "display" => "-- AutoDealer" ),
|
27 |
+
array( "type" => "AutoPartsStore", "display" => "-- AutoPartsStore" ),
|
28 |
+
array( "type" => "AutoRental", "display" => "-- AutoRental" ),
|
29 |
+
array( "type" => "AutoRepair", "display" => "-- AutoRepair" ),
|
30 |
+
array( "type" => "AutoWash", "display" => "-- AutoWash" ),
|
31 |
+
array( "type" => "GasStation", "display" => "-- GasStation" ),
|
32 |
+
array( "type" => "MotorcycleDealer", "display" => "-- MotorcycleDealer" ),
|
33 |
+
array( "type" => "MotorcycleRepair", "display" => "-- MotorcycleRepair" ),
|
34 |
+
|
35 |
+
array( "type" => "ChildCare", "display" => "- ChildCare" ),
|
36 |
+
|
37 |
+
array( "type" => "DryCleaningOrLaundry", "display" => "- DryCleaningOrLaundry" ),
|
38 |
+
|
39 |
+
array( "type" => "EmergencyService", "display" => "- EmergencyService" ),
|
40 |
+
array( "type" => "FireStation", "display" => "-- FireStation" ),
|
41 |
+
array( "type" => "Hospital", "display" => "-- Hospital" ),
|
42 |
+
array( "type" => "PoliceStation", "display" => "-- PoliceStation" ),
|
43 |
+
|
44 |
+
array( "type" => "EmploymentAgency", "display" => "- EmploymentAgency" ),
|
45 |
+
|
46 |
+
array( "type" => "EntertainmentBusiness", "display" => "- EntertainmentBusiness" ),
|
47 |
+
array( "type" => "AdultEntertainment", "display" => "-- AdultEntertainment" ),
|
48 |
+
array( "type" => "AmusementPark", "display" => "-- AmusementPark" ),
|
49 |
+
array( "type" => "ArtGallery", "display" => "-- ArtGallery" ),
|
50 |
+
array( "type" => "Casino", "display" => "-- Casino" ),
|
51 |
+
array( "type" => "ComedyClub", "display" => "-- ComedyClub" ),
|
52 |
+
array( "type" => "MovieTheater", "display" => "-- MovieTheater" ),
|
53 |
+
array( "type" => "NightClub", "display" => "-- NightClub" ),
|
54 |
+
|
55 |
+
array( "type" => "FinancialService", "display" => "- FinancialService" ),
|
56 |
+
array( "type" => "AccountingService", "display" => "-- AccountingService" ),
|
57 |
+
array( "type" => "AutomatedTeller", "display" => "-- AutomatedTeller" ),
|
58 |
+
array( "type" => "BankOrCreditUnion", "display" => "-- BankOrCreditUnion" ),
|
59 |
+
array( "type" => "InsuranceAgency", "display" => "-- InsuranceAgency" ),
|
60 |
+
|
61 |
+
array( "type" => "FoodEstablishment", "display" => "- FoodEstablishment" ),
|
62 |
+
array( "type" => "Bakery", "display" => "-- Bakery" ),
|
63 |
+
array( "type" => "BarOrPub", "display" => "-- BarOrPub" ),
|
64 |
+
array( "type" => "Brewery", "display" => "-- Brewery" ),
|
65 |
+
array( "type" => "CafeOrCoffeeShop", "display" => "-- CafeOrCoffeeShop" ),
|
66 |
+
array( "type" => "FastFoodRestaurant", "display" => "-- FastFoodRestaurant" ),
|
67 |
+
array( "type" => "IceCreamShop", "display" => "-- IceCreamShop" ),
|
68 |
+
array( "type" => "Restaurant", "display" => "-- Restaurant" ),
|
69 |
+
array( "type" => "Winery", "display" => "-- Winery" ),
|
70 |
+
|
71 |
+
array( "type" => "GovernmentOffice", "display" => "- GovernmentOffice" ),
|
72 |
+
array( "type" => "PostOffice", "display" => "-- PostOffice" ),
|
73 |
+
|
74 |
+
array( "type" => "HealthAndBeautyBusiness", "display" => "- HealthAndBeautyBusiness" ),
|
75 |
+
array( "type" => "BeautySalon", "display" => "-- BeautySalon" ),
|
76 |
+
array( "type" => "DaySpa", "display" => "-- DaySpa" ),
|
77 |
+
array( "type" => "HairSalon", "display" => "-- HairSalon" ),
|
78 |
+
array( "type" => "HealthClub", "display" => "-- HealthClub" ),
|
79 |
+
array( "type" => "NailSalon", "display" => "-- NailSalon" ),
|
80 |
+
array( "type" => "TattooParlor", "display" => "-- TattooParlor" ),
|
81 |
+
|
82 |
+
array( "type" => "HomeAndConstructionBusiness", "display" => "- HomeAndConstructionBusiness" ),
|
83 |
+
array( "type" => "Electrician", "display" => "-- Electrician" ),
|
84 |
+
array( "type" => "GeneralContractor", "display" => "-- GeneralContractor" ),
|
85 |
+
array( "type" => "HVACBusiness", "display" => "-- HVACBusiness" ),
|
86 |
+
array( "type" => "HousePainter", "display" => "-- HousePainter" ),
|
87 |
+
array( "type" => "Locksmith", "display" => "-- Locksmith" ),
|
88 |
+
array( "type" => "MovingCompany", "display" => "-- MovingCompany" ),
|
89 |
+
array( "type" => "Plumber", "display" => "-- Plumber" ),
|
90 |
+
array( "type" => "RoofingContractor", "display" => "-- RoofingContractor" ),
|
91 |
+
|
92 |
+
array( "type" => "InternetCafe", "display" => "- InternetCafe" ),
|
93 |
+
|
94 |
+
array( "type" => "LegalService", "display" => "- LegalService" ),
|
95 |
+
array( "type" => "Attorney", "display" => "-- Attorney" ),
|
96 |
+
array( "type" => "Notary", "display" => "-- Notary" ),
|
97 |
+
|
98 |
+
array( "type" => "Library", "display" => "- Library" ),
|
99 |
+
|
100 |
+
array( "type" => "LodgingBusiness", "display" => "- LodgingBusiness" ),
|
101 |
+
array( "type" => "BedAndBreakfast", "display" => "-- BedAndBreakfast" ),
|
102 |
+
array( "type" => "Hostel", "display" => "-- Hostel" ),
|
103 |
+
array( "type" => "Hotel", "display" => "-- Hotel" ),
|
104 |
+
array( "type" => "Motel", "display" => "-- Motel" ),
|
105 |
+
|
106 |
+
array( "type" => "MedicalOrganization", "display" => "- MedicalOrganization" ),
|
107 |
+
array( "type" => "Dentist", "display" => "-- Dentist" ),
|
108 |
+
array( "type" => "DiagnosticLab", "display" => "-- DiagnosticLab" ),
|
109 |
+
array( "type" => "Hospital", "display" => "-- Hospital" ),
|
110 |
+
array( "type" => "MedicalClinic", "display" => "-- MedicalClinic" ),
|
111 |
+
array( "type" => "Optician", "display" => "-- Optician" ),
|
112 |
+
array( "type" => "Pharmacy", "display" => "-- Pharmacy" ),
|
113 |
+
array( "type" => "Physician", "display" => "-- Physician" ),
|
114 |
+
array( "type" => "VeterinaryCare", "display" => "-- VeterinaryCare" ),
|
115 |
+
|
116 |
+
array( "type" => "ProfessionalService", "display" => "- ProfessionalService" ),
|
117 |
+
|
118 |
+
array( "type" => "RadioStation", "display" => "- RadioStation" ),
|
119 |
+
|
120 |
+
array( "type" => "RealEstateAgent", "display" => "- RealEstateAgent" ),
|
121 |
+
|
122 |
+
array( "type" => "RecyclingCenter", "display" => "- RecyclingCenter" ),
|
123 |
+
|
124 |
+
array( "type" => "SelfStorage", "display" => "- SelfStorage" ),
|
125 |
+
|
126 |
+
array( "type" => "ShoppingCenter", "display" => "- ShoppingCenter" ),
|
127 |
+
|
128 |
+
array( "type" => "SportsActivityLocation", "display" => "- SportsActivityLocation" ),
|
129 |
+
array( "type" => "BowlingAlley", "display" => "-- BowlingAlley" ),
|
130 |
+
array( "type" => "ExerciseGym", "display" => "-- ExerciseGym" ),
|
131 |
+
array( "type" => "GolfCourse", "display" => "-- GolfCourse" ),
|
132 |
+
array( "type" => "HealthClub", "display" => "-- HealthClub" ),
|
133 |
+
array( "type" => "PublicSwimmingPool", "display" => "-- PublicSwimmingPool" ),
|
134 |
+
array( "type" => "SkiResort", "display" => "-- SkiResort" ),
|
135 |
+
array( "type" => "SportsClub", "display" => "-- SportsClub" ),
|
136 |
+
array( "type" => "StadiumOrArena", "display" => "-- StadiumOrArena" ),
|
137 |
+
array( "type" => "TennisComplex", "display" => "-- TennisComplex" ),
|
138 |
+
|
139 |
+
array( "type" => "Store", "display" => "- Store" ),
|
140 |
+
array( "type" => "AutoPartsStore", "display" => "-- AutoPartsStore" ),
|
141 |
+
array( "type" => "BikeStore", "display" => "-- BikeStore" ),
|
142 |
+
array( "type" => "BookStore", "display" => "-- BookStore" ),
|
143 |
+
array( "type" => "ClothingStore", "display" => "-- ClothingStore" ),
|
144 |
+
array( "type" => "ComputerStore", "display" => "-- ComputerStore" ),
|
145 |
+
array( "type" => "ConvenienceStore", "display" => "-- ConvenienceStore" ),
|
146 |
+
array( "type" => "DepartmentStore", "display" => "-- DepartmentStore" ),
|
147 |
+
array( "type" => "ElectronicsStore", "display" => "-- ElectronicsStore" ),
|
148 |
+
array( "type" => "Florist", "display" => "-- Florist" ),
|
149 |
+
array( "type" => "FurnitureStore", "display" => "-- FurnitureStore" ),
|
150 |
+
array( "type" => "GardenStore", "display" => "-- GardenStore" ),
|
151 |
+
array( "type" => "GroceryStore", "display" => "-- GroceryStore" ),
|
152 |
+
array( "type" => "HardwareStore", "display" => "-- HardwareStore" ),
|
153 |
+
array( "type" => "HobbyShop", "display" => "-- HobbyShop" ),
|
154 |
+
array( "type" => "HomeGoodsStore", "display" => "-- HomeGoodsStore" ),
|
155 |
+
array( "type" => "JewelryStore", "display" => "-- JewelryStore" ),
|
156 |
+
array( "type" => "LiquorStore", "display" => "-- LiquorStore" ),
|
157 |
+
array( "type" => "MensClothingStore", "display" => "-- MensClothingStore" ),
|
158 |
+
array( "type" => "MobilePhoneStore", "display" => "-- MobilePhoneStore" ),
|
159 |
+
array( "type" => "MovieRentalStore", "display" => "-- MovieRentalStore" ),
|
160 |
+
array( "type" => "MusicStore", "display" => "-- MusicStore" ),
|
161 |
+
array( "type" => "OfficeEquipmentStore", "display" => "-- OfficeEquipmentStore" ),
|
162 |
+
array( "type" => "OutletStore", "display" => "-- OutletStore" ),
|
163 |
+
array( "type" => "PawnShop", "display" => "-- PawnShop" ),
|
164 |
+
array( "type" => "PetStore", "display" => "-- PetStore" ),
|
165 |
+
array( "type" => "ShoeStore", "display" => "-- ShoeStore" ),
|
166 |
+
array( "type" => "SportingGoodsStore", "display" => "-- SportingGoodsStore" ),
|
167 |
+
array( "type" => "TireShop", "display" => "-- TireShop" ),
|
168 |
+
array( "type" => "ToyStore", "display" => "-- ToyStore" ),
|
169 |
+
array( "type" => "WholesaleStore", "display" => "-- WholesaleStore" ),
|
170 |
+
|
171 |
+
array( "type" => "TelevisionStation", "display" => "- TelevisionStation" ),
|
172 |
+
|
173 |
+
array( "type" => "TouristInformationCenter", "display" => "- TouristInformationCenter" ),
|
174 |
+
|
175 |
+
array( "type" => "TravelAgency", "display" => "- TravelAgency" )
|
176 |
+
);
|
177 |
+
|
178 |
+
/** weekType defined. */
|
179 |
+
private $week_array = array(
|
180 |
+
array("type" => "mon", "display" => "Monday"),
|
181 |
+
array("type" => "tue", "display" => "Tuesday"),
|
182 |
+
array("type" => "wed", "display" => "Wednesday"),
|
183 |
+
array("type" => "thu", "display" => "Thursday"),
|
184 |
+
array("type" => "fri", "display" => "Friday"),
|
185 |
+
array("type" => "sat", "display" => "Saturday"),
|
186 |
+
array("type" => "sun", "display" => "Sunday")
|
187 |
+
);
|
188 |
+
|
189 |
+
/**
|
190 |
+
* Constructor Define.
|
191 |
+
*
|
192 |
+
* @since 2.3.0
|
193 |
+
* @param array $option
|
194 |
+
*/
|
195 |
+
public function __construct ( array $option ) {
|
196 |
+
/** Default Value Set */
|
197 |
+
if ( empty( $option ) ) {
|
198 |
+
$option = $this->get_default_options( $option );
|
199 |
+
}
|
200 |
+
$this->page_render( $option );
|
201 |
+
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* Form Layout Render
|
205 |
+
*
|
206 |
+
* @since 2.3.0
|
207 |
+
* @param array $option
|
208 |
+
*/
|
209 |
+
private function page_render ( array $option ) {
|
210 |
+
/** Local Business Type */
|
211 |
+
$html = '<table class="schema-admin-table">';
|
212 |
+
$html .= '<caption>Local Business ( required )</caption>';
|
213 |
+
$html .= $this->set_form_select( 'business_type', 'Local Business Type', $option['business_type'], 'Default : "Local Business"' );
|
214 |
+
$html .= $this->set_form_text( 'name', 'Business Name', $option['name'], true, 'Default : bloginfo("name")' );
|
215 |
+
$html .= $this->set_form_text( 'url', 'Url', $option['url'], true, 'Default : bloginfo("url")' );
|
216 |
+
$html .= $this->set_form_text( 'telephone', 'Telephone', $option['telephone'], false, 'e.g. : +1-880-555-1212' );
|
217 |
+
$html .= '</table>';
|
218 |
+
echo $html;
|
219 |
+
|
220 |
+
/** For food establishments */
|
221 |
+
$html = '<table class="schema-admin-table">';
|
222 |
+
$html .= '<caption>For food establishments ( recommended )</caption>';
|
223 |
+
if ( !isset( $option['food_active'] ) ) {
|
224 |
+
$option['food_active'] = "";
|
225 |
+
}
|
226 |
+
$html .= $this->set_form_checkbox( 'food_active', 'Setting', $option['food_active'], 'Active' );
|
227 |
+
$html .= $this->set_form_text( 'menu', 'Menu url', $option['menu'], false, 'For food establishments, the fully-qualified URL of the menu.' );
|
228 |
+
if ( !isset( $option['accepts_reservations'] ) ) {
|
229 |
+
$option['accepts_reservations'] = "";
|
230 |
+
}
|
231 |
+
$html .= $this->set_form_checkbox( 'accepts_reservations', 'Accepts Reservations', $option['accepts_reservations'], 'For food establishments, and whether it is possible to accept a reservation?' );
|
232 |
+
$html .= '</table>';
|
233 |
+
echo $html;
|
234 |
+
|
235 |
+
/** Postal Address */
|
236 |
+
$html = '<table class="schema-admin-table">';
|
237 |
+
$html .= '<caption>Postal Address ( required )</caption>';
|
238 |
+
$html .= $this->set_form_text( 'street_address', 'Street Address', $option['street_address'], true );
|
239 |
+
$html .= $this->set_form_text( 'address_locality', 'Address Locality', $option['address_locality'], true );
|
240 |
+
$html .= $this->set_form_text( 'address_region', 'Address Region', $option['address_region'], false );
|
241 |
+
$html .= $this->set_form_text( 'postal_code', 'Postal Code', $option['postal_code'], true );
|
242 |
+
$html .= $this->set_form_text( 'address_country', 'Address Country', $option['address_country'], true, '<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2" target="_blank">The 2-letter ISO 3166-1 alpha-2 country code.</a>' );
|
243 |
+
$html .= '</table>';
|
244 |
+
echo $html;
|
245 |
+
|
246 |
+
/** Geo Coordinates */
|
247 |
+
$html = '<table class="schema-admin-table">';
|
248 |
+
$html .= '<caption>Geo Coordinates ( recommended )</caption>';
|
249 |
+
if ( !isset( $option['geo_active'] ) ) {
|
250 |
+
$option['geo_active'] = "";
|
251 |
+
}
|
252 |
+
$html .= $this->set_form_checkbox( 'geo_active', 'Setting', $option['geo_active'], 'Active' );
|
253 |
+
$html .= $this->set_form_text( 'latitude', 'Latitude', $option['latitude'], false );
|
254 |
+
$html .= $this->set_form_text( 'longitude', 'Longitude', $option['latitude'], false );
|
255 |
+
$html .= '</table>';
|
256 |
+
echo $html;
|
257 |
+
|
258 |
+
/** Opening Hours Specification */
|
259 |
+
$html = '<table class="schema-admin-table">';
|
260 |
+
$html .= '<caption>Opening Hours Specification ( recommended )</caption>';
|
261 |
+
|
262 |
+
foreach ( $this->week_array as $value ) {
|
263 |
+
if ( !isset( $option[$value['type']] ) ) {
|
264 |
+
$option[$value['type']] = "";
|
265 |
+
}
|
266 |
+
$html .= $this->set_form_checkbox( $value['type'], $value['display'], $option[$value['type']], 'Active' );
|
267 |
+
$html .= $this->set_form_time( $value['type'], '', $option[$value['type'] . '-open'], $option[$value['type'] . '-close'], '' );
|
268 |
+
}
|
269 |
+
|
270 |
+
$html .= '</table>';
|
271 |
+
echo $html;
|
272 |
+
|
273 |
+
echo '<p>Setting Knowledge : <a href="https://developers.google.com/structured-data/local-businesses/" target="_blank">https://developers.google.com/structured-data/local-businesses/</a></p>';
|
274 |
+
submit_button();
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Return the default options array
|
279 |
+
*
|
280 |
+
* @since 2.3.0
|
281 |
+
* @param array $args
|
282 |
+
* @return array $args
|
283 |
+
*/
|
284 |
+
private function get_default_options ( array $args ) {
|
285 |
+
$args['business_type'] = 'local_business';
|
286 |
+
$args['name'] = get_bloginfo('name');
|
287 |
+
$args['url'] = get_bloginfo('url');
|
288 |
+
$args['telephone'] = '';
|
289 |
+
$args['food_active'] = '';
|
290 |
+
$args['menu'] = '';
|
291 |
+
$args['accepts_reservations'] = '';
|
292 |
+
$args['street_address'] = '';
|
293 |
+
$args['address_locality'] = '';
|
294 |
+
$args['address_region'] = '';
|
295 |
+
$args['postal_code'] = '';
|
296 |
+
$args['address_country'] = '';
|
297 |
+
$args['geo_active'] = '';
|
298 |
+
$args['latitude'] = '';
|
299 |
+
$args['longitude'] = '';
|
300 |
+
$args['opening_active'] = '';
|
301 |
+
|
302 |
+
foreach ( $this->week_array as $value ) {
|
303 |
+
$args[$value['type']] = '';
|
304 |
+
$args[$value['type'] . '-open'] = '';
|
305 |
+
$args[$value['type'] . '-close'] = '';
|
306 |
+
}
|
307 |
+
|
308 |
+
return (array) $args;
|
309 |
+
}
|
310 |
+
|
311 |
+
/**
|
312 |
+
* Return the form text
|
313 |
+
*
|
314 |
+
* @since 2.3.0
|
315 |
+
* @param string $id
|
316 |
+
* @param string $display
|
317 |
+
* @param string $value
|
318 |
+
* @param boolean $required
|
319 |
+
* @param string $note
|
320 |
+
* @return string $html
|
321 |
+
*/
|
322 |
+
private function set_form_text ( $id, $display, $value = "", $required = false, $note = "" ) {
|
323 |
+
$value = esc_attr( $value );
|
324 |
+
|
325 |
+
$format = '<tr><th><label for=%s>%s :</label></th><td>';
|
326 |
+
$format .= '<input type="text" name="option[%s]" id="%s" class="regular-text" value="%s"';
|
327 |
+
if ( $required ) {
|
328 |
+
$format .= ' required';
|
329 |
+
}
|
330 |
+
$format .= '><small>%s</small></td></tr>';
|
331 |
+
|
332 |
+
return (string) sprintf( $format, $id, $display, $id, $id, $value, $note );
|
333 |
+
}
|
334 |
+
|
335 |
+
/**
|
336 |
+
* Return the form checkbox
|
337 |
+
*
|
338 |
+
* @since 2.3.0
|
339 |
+
* @param string $id
|
340 |
+
* @param string $display
|
341 |
+
* @param string $value
|
342 |
+
* @param string $note
|
343 |
+
* @return string $html
|
344 |
+
*/
|
345 |
+
private function set_form_checkbox ( $id, $display, $value = "", $note = "" ) {
|
346 |
+
$value = esc_attr( $value );
|
347 |
+
|
348 |
+
$format = '<tr><th><label for=%s>%s :</label></th><td>';
|
349 |
+
$format .= '<input type="checkbox" name="option[%s]" id="%s" value="on"';
|
350 |
+
if ( $value === 'on' ) {
|
351 |
+
$format .= ' checked="checked"';
|
352 |
+
}
|
353 |
+
$format .= '><small>%s</small></td></tr>';
|
354 |
+
|
355 |
+
return (string) sprintf( $format, $id, $display, $id, $id, $note );
|
356 |
+
}
|
357 |
+
|
358 |
+
/**
|
359 |
+
* Return the form select
|
360 |
+
*
|
361 |
+
* @since 2.3.0
|
362 |
+
* @param string $id
|
363 |
+
* @param string $display
|
364 |
+
* @param string $value
|
365 |
+
* @param string $note
|
366 |
+
* @return string $html
|
367 |
+
*/
|
368 |
+
private function set_form_select ( $id, $display, $value = "", $note = "" ) {
|
369 |
+
$value = esc_attr( $value );
|
370 |
+
|
371 |
+
$format = '<tr><th><label for=%s>%s :</label></th><td>';
|
372 |
+
$format .= '<select id="%s" name="option[%s]">';
|
373 |
+
foreach ( $this->business_type_array as $args ) {
|
374 |
+
$format .= '<option value="' . $args['type'] . '"';
|
375 |
+
if ( $args['type'] === $value ) {
|
376 |
+
$format .= ' selected';
|
377 |
+
}
|
378 |
+
$format .= '>' . $args['display'] . '</option>';
|
379 |
+
}
|
380 |
+
$format .= '</select>';
|
381 |
+
$format .= '<small>%s</small></td></tr>';
|
382 |
+
|
383 |
+
return (string) sprintf( $format, $id, $display, $id, $id, $note );
|
384 |
+
}
|
385 |
+
|
386 |
+
/**
|
387 |
+
* Return the form time
|
388 |
+
*
|
389 |
+
* @since 2.3.0
|
390 |
+
* @param string $id
|
391 |
+
* @param string $display
|
392 |
+
* @param string $value1
|
393 |
+
* @param string $value2
|
394 |
+
* @param string $note
|
395 |
+
* @return string $html
|
396 |
+
*/
|
397 |
+
private function set_form_time ( $id, $display, $value1 = "", $value2 = "", $note = "" ) {
|
398 |
+
$value1 = esc_attr( $value1 );
|
399 |
+
$value2 = esc_attr( $value2 );
|
400 |
+
|
401 |
+
$format = '<tr><th><label for=%s>%s :</label></th><td>';
|
402 |
+
$format .= 'Open Time : <input type="time" name="option[%s-open]" id="%s-open" value="%s">';
|
403 |
+
$format .= ' Close Time : <input type="time" name="option[%s-close]" id="%s-close" value="%s">';
|
404 |
+
$format .= '<small>%s</small></td></tr>';
|
405 |
+
|
406 |
+
return (string) sprintf( $format, $id, $display, $id, $id, $value1, $id, $id, $value2, $note );
|
407 |
+
}
|
408 |
+
}
|
includes/wp-structuring-admin-type-news-article.php
CHANGED
@@ -44,14 +44,14 @@ class Structuring_Markup_Type_NewsArticle {
|
|
44 |
echo $html;
|
45 |
|
46 |
$html = '<table class="schema-admin-table">';
|
47 |
-
$html .= '<caption>mainEntityOfPage( recommended )</caption>';
|
48 |
$html .= '<tr><th>@type :</th><td><small>"WebPage"</small></td></tr>';
|
49 |
$html .= '<tr><th>@id :</th><td><small>Default : get_permalink( ID )</small></td></tr>';
|
50 |
$html .= '</table>';
|
51 |
echo $html;
|
52 |
|
53 |
$html = '<table class="schema-admin-table">';
|
54 |
-
$html .= '<caption>image( required )</caption>';
|
55 |
$html .= '<tr><th>@type :</th><td><small>"ImageObject"</small></td></tr>';
|
56 |
$html .= '<tr><th>url :</th><td><small>Default : thumbnail</small></td></tr>';
|
57 |
$html .= '<tr><th>height :</th><td><small>Auto : The height of the image, in pixels.</small></td></tr>';
|
@@ -60,7 +60,7 @@ class Structuring_Markup_Type_NewsArticle {
|
|
60 |
echo $html;
|
61 |
|
62 |
$html = '<table class="schema-admin-table">';
|
63 |
-
$html .= '<caption>publisher( required )</caption>';
|
64 |
$html .= '<tr><th>@type :</th><td><small>"Organization"</small></td></tr>';
|
65 |
$html .= '<tr><th><label for="name">Organization Name :</label></th><td>';
|
66 |
$html .= '<input type="text" name="option[' . "name" . ']" id="name" class="regular-text" required value="' . esc_attr( $option['name'] ) . '">';
|
@@ -70,7 +70,7 @@ class Structuring_Markup_Type_NewsArticle {
|
|
70 |
echo $html;
|
71 |
|
72 |
$html = '<table class="schema-admin-table">';
|
73 |
-
$html .= '<caption>logo( required )</caption>';
|
74 |
$html .= '<tr><th>@type :</th><td><small>"ImageObject"</small></td></tr>';
|
75 |
$html .= '<tr><th><label for="logo">url :</label></th><td>';
|
76 |
$html .= '<input type="text" name="option[' . "logo" . ']" id="logo" class="regular-text" required value="' . esc_attr( $option['logo'] ) . '">';
|
44 |
echo $html;
|
45 |
|
46 |
$html = '<table class="schema-admin-table">';
|
47 |
+
$html .= '<caption>mainEntityOfPage ( recommended )</caption>';
|
48 |
$html .= '<tr><th>@type :</th><td><small>"WebPage"</small></td></tr>';
|
49 |
$html .= '<tr><th>@id :</th><td><small>Default : get_permalink( ID )</small></td></tr>';
|
50 |
$html .= '</table>';
|
51 |
echo $html;
|
52 |
|
53 |
$html = '<table class="schema-admin-table">';
|
54 |
+
$html .= '<caption>image ( required )</caption>';
|
55 |
$html .= '<tr><th>@type :</th><td><small>"ImageObject"</small></td></tr>';
|
56 |
$html .= '<tr><th>url :</th><td><small>Default : thumbnail</small></td></tr>';
|
57 |
$html .= '<tr><th>height :</th><td><small>Auto : The height of the image, in pixels.</small></td></tr>';
|
60 |
echo $html;
|
61 |
|
62 |
$html = '<table class="schema-admin-table">';
|
63 |
+
$html .= '<caption>publisher ( required )</caption>';
|
64 |
$html .= '<tr><th>@type :</th><td><small>"Organization"</small></td></tr>';
|
65 |
$html .= '<tr><th><label for="name">Organization Name :</label></th><td>';
|
66 |
$html .= '<input type="text" name="option[' . "name" . ']" id="name" class="regular-text" required value="' . esc_attr( $option['name'] ) . '">';
|
70 |
echo $html;
|
71 |
|
72 |
$html = '<table class="schema-admin-table">';
|
73 |
+
$html .= '<caption>logo ( required )</caption>';
|
74 |
$html .= '<tr><th>@type :</th><td><small>"ImageObject"</small></td></tr>';
|
75 |
$html .= '<tr><th><label for="logo">url :</label></th><td>';
|
76 |
$html .= '<input type="text" name="option[' . "logo" . ']" id="logo" class="regular-text" required value="' . esc_attr( $option['logo'] ) . '">';
|
includes/wp-structuring-admin-type-organization.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Schema.org Type Organization
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
-
* @version 2.
|
7 |
* @since 1.0.0
|
8 |
* @see wp-structuring-admin-db.php
|
9 |
* @link https://schema.org/Organization
|
@@ -14,7 +14,6 @@
|
|
14 |
*/
|
15 |
class Structuring_Markup_Type_Organization {
|
16 |
|
17 |
-
|
18 |
/**
|
19 |
* Variable definition.
|
20 |
*
|
@@ -23,7 +22,7 @@ class Structuring_Markup_Type_Organization {
|
|
23 |
*/
|
24 |
/** contactType defined. */
|
25 |
private $contact_type_array = array(
|
26 |
-
array("type" => "
|
27 |
array("type" => "technical_support", "display" => "technical support"),
|
28 |
array("type" => "billing_support", "display" => "billing support"),
|
29 |
array("type" => "bill_payment", "display" => "bill payment"),
|
@@ -67,7 +66,7 @@ class Structuring_Markup_Type_Organization {
|
|
67 |
* Form Layout Render
|
68 |
*
|
69 |
* @since 1.0.0
|
70 |
-
* @version 2.
|
71 |
* @param array $option
|
72 |
*/
|
73 |
private function page_render ( array $option ) {
|
@@ -101,7 +100,7 @@ class Structuring_Markup_Type_Organization {
|
|
101 |
$html .= '</td></tr>';
|
102 |
$html .= '<tr><th><label for="telephone">telephone :</label></th><td>';
|
103 |
$html .= '<input type="text" name="option[' . "telephone" . ']" id="telephone" class="regular-text" value="' . esc_attr( $option['telephone'] ) . '">';
|
104 |
-
$html .= '<small>
|
105 |
$html .= '</td></tr>';
|
106 |
$html .= '<tr><th><label for="contact_type">contactType :</label></th><td>';
|
107 |
$html .= '<select id="contact_type" name="option[' . "contact_type" . ']">';
|
@@ -157,7 +156,7 @@ class Structuring_Markup_Type_Organization {
|
|
157 |
* Return the default options array
|
158 |
*
|
159 |
* @since 1.0.0
|
160 |
-
* @version 2.
|
161 |
* @param array $args
|
162 |
* @return array $args
|
163 |
*/
|
@@ -166,8 +165,8 @@ class Structuring_Markup_Type_Organization {
|
|
166 |
$args['url'] = get_bloginfo('url');
|
167 |
$args['logo'] = get_bloginfo('url') . '/images/logo.png';
|
168 |
$args['contact_point'] = '';
|
169 |
-
$args['telephone'] = '
|
170 |
-
$args['contact_type'] = '
|
171 |
$args['area_served'] = 'US';
|
172 |
$args['contact_option_1'] = '';
|
173 |
$args['contact_option_2'] = '';
|
3 |
* Schema.org Type Organization
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
+
* @version 2.3.0
|
7 |
* @since 1.0.0
|
8 |
* @see wp-structuring-admin-db.php
|
9 |
* @link https://schema.org/Organization
|
14 |
*/
|
15 |
class Structuring_Markup_Type_Organization {
|
16 |
|
|
|
17 |
/**
|
18 |
* Variable definition.
|
19 |
*
|
22 |
*/
|
23 |
/** contactType defined. */
|
24 |
private $contact_type_array = array(
|
25 |
+
array("type" => "customer_service", "display" => "customer service"),
|
26 |
array("type" => "technical_support", "display" => "technical support"),
|
27 |
array("type" => "billing_support", "display" => "billing support"),
|
28 |
array("type" => "bill_payment", "display" => "bill payment"),
|
66 |
* Form Layout Render
|
67 |
*
|
68 |
* @since 1.0.0
|
69 |
+
* @version 2.3.0
|
70 |
* @param array $option
|
71 |
*/
|
72 |
private function page_render ( array $option ) {
|
100 |
$html .= '</td></tr>';
|
101 |
$html .= '<tr><th><label for="telephone">telephone :</label></th><td>';
|
102 |
$html .= '<input type="text" name="option[' . "telephone" . ']" id="telephone" class="regular-text" value="' . esc_attr( $option['telephone'] ) . '">';
|
103 |
+
$html .= '<small>e.g. : +1-880-555-1212</small>';
|
104 |
$html .= '</td></tr>';
|
105 |
$html .= '<tr><th><label for="contact_type">contactType :</label></th><td>';
|
106 |
$html .= '<select id="contact_type" name="option[' . "contact_type" . ']">';
|
156 |
* Return the default options array
|
157 |
*
|
158 |
* @since 1.0.0
|
159 |
+
* @version 2.3.0
|
160 |
* @param array $args
|
161 |
* @return array $args
|
162 |
*/
|
165 |
$args['url'] = get_bloginfo('url');
|
166 |
$args['logo'] = get_bloginfo('url') . '/images/logo.png';
|
167 |
$args['contact_point'] = '';
|
168 |
+
$args['telephone'] = '';
|
169 |
+
$args['contact_type'] = 'customer_service';
|
170 |
$args['area_served'] = 'US';
|
171 |
$args['contact_option_1'] = '';
|
172 |
$args['contact_option_2'] = '';
|
includes/wp-structuring-display.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Schema.org Display
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
-
* @version 2.
|
7 |
* @since 1.0.0
|
8 |
*/
|
9 |
class Structuring_Markup_Display {
|
@@ -47,7 +47,7 @@ class Structuring_Markup_Display {
|
|
47 |
* Setting JSON-LD Template
|
48 |
*
|
49 |
* @since 1.0.0
|
50 |
-
* @version 2.
|
51 |
* @param Structuring_Markup_Admin_Db $db
|
52 |
* @param string $output
|
53 |
*/
|
@@ -76,6 +76,11 @@ class Structuring_Markup_Display {
|
|
76 |
case 'event':
|
77 |
$this->set_schema_event();
|
78 |
break;
|
|
|
|
|
|
|
|
|
|
|
79 |
case 'news_article':
|
80 |
if ( isset( $row->options ) && $row->options ) {
|
81 |
$this->set_schema_news_article( unserialize( $row->options ) );
|
@@ -311,6 +316,79 @@ class Structuring_Markup_Display {
|
|
311 |
}
|
312 |
}
|
313 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
/**
|
315 |
* Setting schema.org NewsArticle
|
316 |
*
|
3 |
* Schema.org Display
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
+
* @version 2.3.0
|
7 |
* @since 1.0.0
|
8 |
*/
|
9 |
class Structuring_Markup_Display {
|
47 |
* Setting JSON-LD Template
|
48 |
*
|
49 |
* @since 1.0.0
|
50 |
+
* @version 2.3.0
|
51 |
* @param Structuring_Markup_Admin_Db $db
|
52 |
* @param string $output
|
53 |
*/
|
76 |
case 'event':
|
77 |
$this->set_schema_event();
|
78 |
break;
|
79 |
+
case 'local_business':
|
80 |
+
if ( isset( $row->options ) && $row->options ) {
|
81 |
+
$this->set_schema_local_business( unserialize( $row->options ) );
|
82 |
+
}
|
83 |
+
break;
|
84 |
case 'news_article':
|
85 |
if ( isset( $row->options ) && $row->options ) {
|
86 |
$this->set_schema_news_article( unserialize( $row->options ) );
|
316 |
}
|
317 |
}
|
318 |
|
319 |
+
/**
|
320 |
+
* Setting schema.org LocalBusiness
|
321 |
+
*
|
322 |
+
* @since 2.3.0
|
323 |
+
* @version 2.3.0
|
324 |
+
* @param array $options
|
325 |
+
*/
|
326 |
+
private function set_schema_local_business ( array $options ) {
|
327 |
+
|
328 |
+
/** weekType defined. */
|
329 |
+
$week_array = array(
|
330 |
+
array("type" => "mon", "display" => "Monday"),
|
331 |
+
array("type" => "tue", "display" => "Tuesday"),
|
332 |
+
array("type" => "wed", "display" => "Wednesday"),
|
333 |
+
array("type" => "thu", "display" => "Thursday"),
|
334 |
+
array("type" => "fri", "display" => "Friday"),
|
335 |
+
array("type" => "sat", "display" => "Saturday"),
|
336 |
+
array("type" => "sun", "display" => "Sunday")
|
337 |
+
);
|
338 |
+
|
339 |
+
$args = array(
|
340 |
+
"@context" => "http://schema.org",
|
341 |
+
"@type" => isset( $options['name'] ) ? esc_html( $options['business_type'] ) : "",
|
342 |
+
"name" => isset( $options['name'] ) ? esc_html( $options['name'] ) : "",
|
343 |
+
"url" => isset( $options['name'] ) ? esc_url( $options['url'] ) : "",
|
344 |
+
"telephone" => isset( $options['name'] ) ? esc_html( $options['telephone'] ) : ""
|
345 |
+
);
|
346 |
+
|
347 |
+
if ( isset( $options['food_active'] ) && $options['food_active'] === 'on' ) {
|
348 |
+
if ( isset( $options['menu'] ) && $options['menu'] !== '' ) {
|
349 |
+
$args['menu'] = esc_url( $options['menu'] );
|
350 |
+
}
|
351 |
+
if ( isset( $options['accepts_reservations'] ) && $options['accepts_reservations'] === 'on' ) {
|
352 |
+
$args['acceptsReservations'] = "True";
|
353 |
+
} else {
|
354 |
+
$args['acceptsReservations'] = "False";
|
355 |
+
}
|
356 |
+
}
|
357 |
+
|
358 |
+
$address_array["address"] = array(
|
359 |
+
"@type" => "PostalAddress",
|
360 |
+
"streetAddress" => isset( $options['name'] ) ? esc_html( $options['street_address'] ) : "",
|
361 |
+
"addressLocality" => isset( $options['name'] ) ? esc_html( $options['address_locality'] ) : "",
|
362 |
+
"addressRegion" => isset( $options['name'] ) ? esc_html( $options['address_region'] ) : "",
|
363 |
+
"postalCode" => isset( $options['name'] ) ? esc_html( $options['postal_code'] ) : "",
|
364 |
+
"addressCountry" => isset( $options['name'] ) ? esc_html( $options['address_country'] ) : ""
|
365 |
+
);
|
366 |
+
$args = array_merge( $args, $address_array );
|
367 |
+
|
368 |
+
if ( isset( $options['geo_active'] ) && $options['geo_active'] === 'on' ) {
|
369 |
+
$geo_array["geo"] = array(
|
370 |
+
"@type" => "GeoCoordinates",
|
371 |
+
"latitude" => isset( $options['name'] ) ? esc_html( floatval( $options['latitude'] ) ) : "",
|
372 |
+
"longitude" => isset( $options['name'] ) ? esc_html( floatval( $options['longitude'] ) ) : ""
|
373 |
+
);
|
374 |
+
$args = array_merge( $args, $geo_array );
|
375 |
+
}
|
376 |
+
|
377 |
+
foreach ( $week_array as $value ) {
|
378 |
+
if ( isset( $options[$value['type']] ) && $options[$value['type']] === 'on' ) {
|
379 |
+
$opening_array["openingHoursSpecification"][] = array(
|
380 |
+
"@type" => "OpeningHoursSpecification",
|
381 |
+
"dayOfWeek" => $value['display'],
|
382 |
+
"opens" => isset( $options['name'] ) ? esc_html( $options[$value['type'] . '-open'] ) : "",
|
383 |
+
"closes" => isset( $options['name'] ) ? esc_html( $options[$value['type'] . '-close'] ) : ""
|
384 |
+
);
|
385 |
+
$args = array_merge( $args, $opening_array );
|
386 |
+
}
|
387 |
+
}
|
388 |
+
|
389 |
+
$this->set_schema_json( $args );
|
390 |
+
}
|
391 |
+
|
392 |
/**
|
393 |
* Setting schema.org NewsArticle
|
394 |
*
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: miiitaka
|
|
3 |
Tags: schema, schema.org, json, json-ld, seo, post, posts, google, shortcode, breadcrumb
|
4 |
Requires at least: 4.3.1
|
5 |
Tested up to: 4.4
|
6 |
-
Stable tag: 2.
|
7 |
|
8 |
It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an post page, fixed page and etc.
|
9 |
|
@@ -18,6 +18,7 @@ Base knowledge is "https://schema.org/" and "https://developers.google.com/struc
|
|
18 |
* BlogPosting: http://schema.org/BlogPosting
|
19 |
* BreadcrumbList: https://schema.org/BreadcrumbList
|
20 |
* Event: https://schema.org/Event
|
|
|
21 |
* NewsArticle: http://schema.org/NewsArticle
|
22 |
* Organization: https://schema.org/Organization
|
23 |
* Website: https://schema.org/WebSite
|
@@ -44,6 +45,11 @@ if (shortcode_exists('wp-structuring-markup-breadcrumb')) {
|
|
44 |
|
45 |
== Changelog ==
|
46 |
|
|
|
|
|
|
|
|
|
|
|
47 |
= 2.2.1 (2015-12-21) =
|
48 |
|
49 |
* Fixed : Breadcrumb ShortCode minor bug fixed.
|
3 |
Tags: schema, schema.org, json, json-ld, seo, post, posts, google, shortcode, breadcrumb
|
4 |
Requires at least: 4.3.1
|
5 |
Tested up to: 4.4
|
6 |
+
Stable tag: 2.3.0
|
7 |
|
8 |
It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an post page, fixed page and etc.
|
9 |
|
18 |
* BlogPosting: http://schema.org/BlogPosting
|
19 |
* BreadcrumbList: https://schema.org/BreadcrumbList
|
20 |
* Event: https://schema.org/Event
|
21 |
+
* LocalBusiness : http://schema.org/LocalBusiness
|
22 |
* NewsArticle: http://schema.org/NewsArticle
|
23 |
* Organization: https://schema.org/Organization
|
24 |
* Website: https://schema.org/WebSite
|
45 |
|
46 |
== Changelog ==
|
47 |
|
48 |
+
= 2.3.0 (2016-01-03) =
|
49 |
+
|
50 |
+
* Added : Schema.org type "LocalBusiness".
|
51 |
+
* Fixed : Organization Definition minor bug fixed.
|
52 |
+
|
53 |
= 2.2.1 (2015-12-21) =
|
54 |
|
55 |
* Fixed : Breadcrumb ShortCode minor bug fixed.
|
wp-structuring-markup.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Markup (JSON-LD) structured in schema.org
|
4 |
Plugin URI: https://wordpress.org/plugins/wp-structuring-markup/
|
5 |
Description: It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
|
6 |
-
Version: 2.
|
7 |
Author: Kazuya Takami
|
8 |
Author URI: http://programp.com/
|
9 |
License: GPLv2 or later
|
@@ -19,7 +19,7 @@ new Structuring_Markup();
|
|
19 |
*
|
20 |
* @author Kazuya Takami
|
21 |
* @since 1.0.0
|
22 |
-
* @version 2.
|
23 |
*/
|
24 |
class Structuring_Markup {
|
25 |
|
@@ -27,10 +27,10 @@ class Structuring_Markup {
|
|
27 |
* Variable definition.
|
28 |
*
|
29 |
* @since 1.3.0
|
30 |
-
* @version 2.
|
31 |
*/
|
32 |
private $text_domain = 'wp-structuring-markup';
|
33 |
-
private $version = '2.
|
34 |
|
35 |
/**
|
36 |
* Constructor Define.
|
3 |
Plugin Name: Markup (JSON-LD) structured in schema.org
|
4 |
Plugin URI: https://wordpress.org/plugins/wp-structuring-markup/
|
5 |
Description: It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
|
6 |
+
Version: 2.3.0
|
7 |
Author: Kazuya Takami
|
8 |
Author URI: http://programp.com/
|
9 |
License: GPLv2 or later
|
19 |
*
|
20 |
* @author Kazuya Takami
|
21 |
* @since 1.0.0
|
22 |
+
* @version 2.3.0
|
23 |
*/
|
24 |
class Structuring_Markup {
|
25 |
|
27 |
* Variable definition.
|
28 |
*
|
29 |
* @since 1.3.0
|
30 |
+
* @version 2.3.0
|
31 |
*/
|
32 |
private $text_domain = 'wp-structuring-markup';
|
33 |
+
private $version = '2.3.0';
|
34 |
|
35 |
/**
|
36 |
* Constructor Define.
|