Version Description
(2017-06-14) = * Checked : WordPress version 4.8.0 operation check. * Updated : Warning: Event type schema.org ( availability, validFrom and performer. ) * Fixed : Events and videos of custom posts should not appear in choices.
Download this release
Release Info
Developer | miiitaka |
Plugin | Markup (JSON-LD) structured in schema.org |
Version | 4.0.2 |
Comparing to | |
See all releases |
Code changes from version 4.0.1 to 4.0.2
- css/style.css +21 -7
- includes/admin/wp-structuring-admin-list.php +14 -14
- includes/admin/wp-structuring-admin-post.php +13 -6
- includes/admin/wp-structuring-admin-type-event.php +12 -5
- includes/custom/wp-structuring-custom-post-event.php +58 -18
- includes/meta/wp-structuring-meta-event.php +30 -10
- readme.txt +7 -2
- wp-structuring-markup.php +4 -4
css/style.css
CHANGED
@@ -1,8 +1,7 @@
|
|
1 |
/** List Setting */
|
2 |
-
.schema-admin-table-list
|
3 |
-
|
4 |
}
|
5 |
-
|
6 |
.schema-admin-table-list .schema-admin-table-list-type {
|
7 |
width: 15%;
|
8 |
}
|
@@ -11,18 +10,32 @@
|
|
11 |
width: 30%;
|
12 |
}
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
.schema-admin-table-list td {
|
15 |
vertical-align: middle;
|
16 |
}
|
17 |
|
18 |
-
.schema-admin-table-list td:nth-child(1) span {
|
|
|
|
|
|
|
|
|
|
|
19 |
display: inline-block;
|
|
|
20 |
padding: 0 1em 0 1em;
|
21 |
text-align: center;
|
22 |
width: 8em;
|
23 |
}
|
24 |
|
25 |
-
.schema-admin-table-list td:nth-child(1) span.active {
|
26 |
background: #00a0d2;
|
27 |
color: #fff;
|
28 |
}
|
@@ -35,7 +48,7 @@
|
|
35 |
background: #efefef;
|
36 |
}
|
37 |
|
38 |
-
.schema-admin-table-list td:nth-child(1) span.stop {
|
39 |
background: #ddd;
|
40 |
}
|
41 |
|
@@ -97,7 +110,8 @@
|
|
97 |
}
|
98 |
|
99 |
.schema-admin-table input:invalid {
|
100 |
-
|
|
|
101 |
}
|
102 |
|
103 |
/** LocalBusiness */
|
1 |
/** List Setting */
|
2 |
+
.schema-admin-table-list {
|
3 |
+
border-collapse: collapse;
|
4 |
}
|
|
|
5 |
.schema-admin-table-list .schema-admin-table-list-type {
|
6 |
width: 15%;
|
7 |
}
|
10 |
width: 30%;
|
11 |
}
|
12 |
|
13 |
+
.schema-admin-table-list tr {
|
14 |
+
border-bottom: solid 1px #ddd;
|
15 |
+
}
|
16 |
+
|
17 |
+
.schema-admin-table-list tr:last-child {
|
18 |
+
border-bottom: none;
|
19 |
+
}
|
20 |
+
|
21 |
.schema-admin-table-list td {
|
22 |
vertical-align: middle;
|
23 |
}
|
24 |
|
25 |
+
.schema-admin-table-list td:nth-child(1) > span {
|
26 |
+
float: left;
|
27 |
+
height: 2em;
|
28 |
+
}
|
29 |
+
|
30 |
+
.schema-admin-table-list td:nth-child(1) > span span {
|
31 |
display: inline-block;
|
32 |
+
margin: 0 10px 0 0;
|
33 |
padding: 0 1em 0 1em;
|
34 |
text-align: center;
|
35 |
width: 8em;
|
36 |
}
|
37 |
|
38 |
+
.schema-admin-table-list td:nth-child(1) > span span.active {
|
39 |
background: #00a0d2;
|
40 |
color: #fff;
|
41 |
}
|
48 |
background: #efefef;
|
49 |
}
|
50 |
|
51 |
+
.schema-admin-table-list td:nth-child(1) > span span.stop {
|
52 |
background: #ddd;
|
53 |
}
|
54 |
|
110 |
}
|
111 |
|
112 |
.schema-admin-table input:invalid {
|
113 |
+
border: solid 1px #d8000c;
|
114 |
+
background: #ffbaba;
|
115 |
}
|
116 |
|
117 |
/** LocalBusiness */
|
includes/admin/wp-structuring-admin-list.php
CHANGED
@@ -47,10 +47,8 @@ class Structuring_Markup_Admin_List {
|
|
47 |
$html = '<hr>';
|
48 |
$html .= '<table class="wp-list-table widefat fixed striped posts schema-admin-table-list">';
|
49 |
$html .= '<tr>';
|
50 |
-
$html .= '<th scope="row" class="schema-admin-table-list-
|
51 |
-
$html .= '<th scope="row" class="schema-admin-table-list-
|
52 |
-
$html .= '<th scope="row" class="schema-admin-table-list-output">' . esc_html__( 'Output On', $this->text_domain ) . '</th>';
|
53 |
-
$html .= '<th scope="row"> </th>';
|
54 |
$html .= '</tr>';
|
55 |
echo $html;
|
56 |
|
@@ -61,23 +59,25 @@ class Structuring_Markup_Admin_List {
|
|
61 |
if ( $results ) {
|
62 |
foreach ( $results as $row ) {
|
63 |
if ( $row->activate === 'on' ) {
|
64 |
-
$html = '<tr class="active"><td><span class="active">Enabled';
|
65 |
} else {
|
66 |
-
$html = '<tr class="stop"><td><span class="stop">Disabled';
|
67 |
}
|
68 |
-
$html .= '</span></
|
69 |
-
$html .= '<
|
70 |
$html .= admin_url( $post_url . '&type=' . esc_html( $row->type ) . '&schema_post_id=' . esc_html( $row->id ) ) . '">' . $type_array[esc_html( $row->type )];
|
71 |
-
$html .= '</a></
|
72 |
-
$html .= '<
|
73 |
-
$html .= '
|
74 |
-
$html .=
|
75 |
-
$html .= '</
|
|
|
|
|
76 |
$html .= '</tr>';
|
77 |
echo $html;
|
78 |
}
|
79 |
} else {
|
80 |
-
echo '<td colspan="
|
81 |
}
|
82 |
$html = '</table>';
|
83 |
$html .= '</div>';
|
47 |
$html = '<hr>';
|
48 |
$html .= '<table class="wp-list-table widefat fixed striped posts schema-admin-table-list">';
|
49 |
$html .= '<tr>';
|
50 |
+
$html .= '<th scope="row" class="schema-admin-table-list-type column-primary">' . esc_html__( 'Status', $this->text_domain ) . ' / ' . esc_html__( 'Schema.org Type', $this->text_domain ) . '</th>';
|
51 |
+
$html .= '<th scope="row" class="schema-admin-table-list-output">' . esc_html__( 'Output On', $this->text_domain ) . '</th>';
|
|
|
|
|
52 |
$html .= '</tr>';
|
53 |
echo $html;
|
54 |
|
59 |
if ( $results ) {
|
60 |
foreach ( $results as $row ) {
|
61 |
if ( $row->activate === 'on' ) {
|
62 |
+
$html = '<tr class="active"><td class="column-primary"><span><span class="active">Enabled';
|
63 |
} else {
|
64 |
+
$html = '<tr class="stop"><td class="column-primary"><span><span class="stop">Disabled';
|
65 |
}
|
66 |
+
$html .= '</span></span>';
|
67 |
+
$html .= '<strong><a href="';
|
68 |
$html .= admin_url( $post_url . '&type=' . esc_html( $row->type ) . '&schema_post_id=' . esc_html( $row->id ) ) . '">' . $type_array[esc_html( $row->type )];
|
69 |
+
$html .= '</a></strong>';
|
70 |
+
$html .= '<div class="row-actions"><span class="edit"><a href="';
|
71 |
+
$html .= admin_url( $post_url . '&type=' . esc_html( $row->type ) . '&schema_post_id=' . esc_html( $row->id ) ) . '" class="edit" aria-label="編集">' . esc_html__( 'Edit', $this->text_domain );
|
72 |
+
$html .= '</a></span></div>';
|
73 |
+
$html .= '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details', $this->text_domain ) . '</span></button>';
|
74 |
+
$html .= '</td>';
|
75 |
+
$html .= '<td data-colname="' . esc_html__( 'Output On', $this->text_domain ) . '">' . $this->unserialize_output( $row->output ) . '</td>';
|
76 |
$html .= '</tr>';
|
77 |
echo $html;
|
78 |
}
|
79 |
} else {
|
80 |
+
echo '<td colspan="2">' . esc_html__( 'Without registration.', $this->text_domain ) . '</td>';
|
81 |
}
|
82 |
$html = '</table>';
|
83 |
$html .= '</div>';
|
includes/admin/wp-structuring-admin-post.php
CHANGED
@@ -44,7 +44,7 @@ class Structuring_Markup_Admin_Post {
|
|
44 |
/**
|
45 |
* Constructor Define.
|
46 |
*
|
47 |
-
* @version
|
48 |
* @since 1.0.0
|
49 |
* @param String $text_domain
|
50 |
*/
|
@@ -54,6 +54,10 @@ class Structuring_Markup_Admin_Post {
|
|
54 |
'_builtin' => false
|
55 |
);
|
56 |
$post_types = get_post_types( $args, 'objects' );
|
|
|
|
|
|
|
|
|
57 |
foreach ( $post_types as $post_type ) {
|
58 |
$this->post_args[] = array(
|
59 |
'label' => esc_html( $post_type->label ),
|
@@ -317,17 +321,20 @@ class Structuring_Markup_Admin_Post {
|
|
317 |
/**
|
318 |
* Custom Posts Build Render
|
319 |
*
|
320 |
-
* @version
|
321 |
* @since 2.5.0
|
322 |
* @param array $option['output']
|
323 |
* @return string $html
|
324 |
*/
|
325 |
private function output_custom_posts_render ( array $option ) {
|
326 |
-
$html
|
327 |
-
|
328 |
-
$html .=
|
|
|
|
|
|
|
|
|
329 |
}
|
330 |
-
$html .= '</td></tr>';
|
331 |
return (string) $html;
|
332 |
}
|
333 |
|
44 |
/**
|
45 |
* Constructor Define.
|
46 |
*
|
47 |
+
* @version 4.0.2
|
48 |
* @since 1.0.0
|
49 |
* @param String $text_domain
|
50 |
*/
|
54 |
'_builtin' => false
|
55 |
);
|
56 |
$post_types = get_post_types( $args, 'objects' );
|
57 |
+
|
58 |
+
unset( $post_types['schema_event_post'] );
|
59 |
+
unset( $post_types['schema_video_post'] );
|
60 |
+
|
61 |
foreach ( $post_types as $post_type ) {
|
62 |
$this->post_args[] = array(
|
63 |
'label' => esc_html( $post_type->label ),
|
321 |
/**
|
322 |
* Custom Posts Build Render
|
323 |
*
|
324 |
+
* @version 4.0.2
|
325 |
* @since 2.5.0
|
326 |
* @param array $option['output']
|
327 |
* @return string $html
|
328 |
*/
|
329 |
private function output_custom_posts_render ( array $option ) {
|
330 |
+
$html = '';
|
331 |
+
if ( count( $this->post_args ) > 0 ) {
|
332 |
+
$html .= '<tr><th>' . esc_html__( 'Output On(Custom Posts)', $this->text_domain ) . ' : </th><td>';
|
333 |
+
foreach ( $this->post_args as $post_type ) {
|
334 |
+
$html .= $this->output_checkbox_render( $option, $post_type['value'], $post_type['label'] );
|
335 |
+
}
|
336 |
+
$html .= '</td></tr>';
|
337 |
}
|
|
|
338 |
return (string) $html;
|
339 |
}
|
340 |
|
includes/admin/wp-structuring-admin-type-event.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Schema.org Type Event
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
-
* @version
|
7 |
* @since 2.1.0
|
8 |
* @see wp-structuring-admin-db.php
|
9 |
* @link http://schema.org/Event
|
@@ -25,7 +25,7 @@ class Structuring_Markup_Type_Event {
|
|
25 |
/**
|
26 |
* Form Layout Render
|
27 |
*
|
28 |
-
* @version
|
29 |
* @since 2.1.0
|
30 |
*/
|
31 |
private function page_render () {
|
@@ -44,16 +44,23 @@ class Structuring_Markup_Type_Event {
|
|
44 |
$html = '<table class="schema-admin-table">';
|
45 |
$html .= '<caption>Location Type "Place" Setting</caption>';
|
46 |
$html .= '<tr><th class="require">name :</th><td><small>Input a custom post: field name "schema_event_place_name"</small></td></tr>';
|
47 |
-
$html .= '<tr><th>url(sameAs) :</th><td><small>Input a custom post: field name "
|
48 |
$html .= '<tr><th class="require">address :</th><td><small>Input a custom post: field name "schema_event_place_address"</small></td></tr>';
|
49 |
$html .= '</table>';
|
50 |
echo $html;
|
51 |
|
52 |
$html = '<table class="schema-admin-table">';
|
53 |
$html .= '<caption>Location Type "Offers" Setting</caption>';
|
54 |
-
$html .= '<tr><th>price :</th><td><small>Input a custom post: field name "
|
55 |
-
$html .= '<tr><th class="require">priceCurrency :</th><td><small>Input a custom post: field name "
|
56 |
$html .= '<tr><th>url :</th><td><small>Input a custom post: field name "schema_event_place_url"</small></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
$html .= '</table>';
|
58 |
echo $html;
|
59 |
|
3 |
* Schema.org Type Event
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
+
* @version 4.0.2
|
7 |
* @since 2.1.0
|
8 |
* @see wp-structuring-admin-db.php
|
9 |
* @link http://schema.org/Event
|
25 |
/**
|
26 |
* Form Layout Render
|
27 |
*
|
28 |
+
* @version 4.0.2
|
29 |
* @since 2.1.0
|
30 |
*/
|
31 |
private function page_render () {
|
44 |
$html = '<table class="schema-admin-table">';
|
45 |
$html .= '<caption>Location Type "Place" Setting</caption>';
|
46 |
$html .= '<tr><th class="require">name :</th><td><small>Input a custom post: field name "schema_event_place_name"</small></td></tr>';
|
47 |
+
$html .= '<tr><th>url(sameAs) :</th><td><small>Input a custom post: field name "schema_event_url"</small></td></tr>';
|
48 |
$html .= '<tr><th class="require">address :</th><td><small>Input a custom post: field name "schema_event_place_address"</small></td></tr>';
|
49 |
$html .= '</table>';
|
50 |
echo $html;
|
51 |
|
52 |
$html = '<table class="schema-admin-table">';
|
53 |
$html .= '<caption>Location Type "Offers" Setting</caption>';
|
54 |
+
$html .= '<tr><th>price :</th><td><small>Input a custom post: field name "schema_event_offers_price"</small></td></tr>';
|
55 |
+
$html .= '<tr><th class="require">priceCurrency :</th><td><small>Input a custom post: field name "schema_event_offers_currency"</small></td></tr>';
|
56 |
$html .= '<tr><th>url :</th><td><small>Input a custom post: field name "schema_event_place_url"</small></td></tr>';
|
57 |
+
$html .= '<tr><th>validFrom :</th><td><small>Input a custom post: field name "schema_event_offers_date" & "schema_event_offers_time"</small></td></tr>';
|
58 |
+
$html .= '</table>';
|
59 |
+
echo $html;
|
60 |
+
|
61 |
+
$html = '<table class="schema-admin-table">';
|
62 |
+
$html .= '<caption>Location Type "PerformingGroup" Setting</caption>';
|
63 |
+
$html .= '<tr><th>name :</th><td><small>Input a custom post: field name "schema_event_performer_name"</small></td></tr>';
|
64 |
$html .= '</table>';
|
65 |
echo $html;
|
66 |
|
includes/custom/wp-structuring-custom-post-event.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Schema.org Custom Post "Event"
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
-
* @version
|
7 |
* @since 2.1.0
|
8 |
* @link https://schema.org/Event
|
9 |
* @link https://developers.google.com/search/docs/data-types/events
|
@@ -47,6 +47,18 @@ class Structuring_Markup_Custom_Post_Event {
|
|
47 |
"VisualArtsEvent"
|
48 |
);
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
/**
|
51 |
* Constructor Define.
|
52 |
*
|
@@ -124,7 +136,7 @@ class Structuring_Markup_Custom_Post_Event {
|
|
124 |
/**
|
125 |
* Set custom fields.
|
126 |
*
|
127 |
-
* @version
|
128 |
* @since 2.1.0
|
129 |
*/
|
130 |
public function set_custom_fields () {
|
@@ -149,7 +161,7 @@ class Structuring_Markup_Custom_Post_Event {
|
|
149 |
if ( $value === $args['schema_event_type'] ) {
|
150 |
$html .= ' selected="selected"';
|
151 |
}
|
152 |
-
$html .=
|
153 |
}
|
154 |
$html .= '</select>';
|
155 |
$html .= '</td></tr>';
|
@@ -200,6 +212,19 @@ class Structuring_Markup_Custom_Post_Event {
|
|
200 |
$html .= ' (required)</label></td><td>';
|
201 |
$html .= '<input type="text" name="option[' . "schema_event_place_address" . ']" id="schema_event_place_address" class="regular-text" required value="' . esc_attr( $args['schema_event_place_address'] ) . '">';
|
202 |
$html .= '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
$html .= '<tr><td><label for="schema_event_offers_price">';
|
204 |
$html .= esc_html__( 'Price', $this->text_domain );
|
205 |
$html .= ' (required)</label></td><td>';
|
@@ -211,6 +236,17 @@ class Structuring_Markup_Custom_Post_Event {
|
|
211 |
$html .= '<input type="text" name="option[' . "schema_event_offers_currency" . ']" id="schema_event_offers_currency" maxlength="3" required value="' . esc_attr( $args['schema_event_offers_currency'] ) . '">';
|
212 |
$html .= ' <small>( with <a hre="https://en.wikipedia.org/wiki/ISO_4217#Active_codes" target="_blank">ISO 4217 codes</a> e.g. "USD" )</small>';
|
213 |
$html .= '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
$html .= '</table>';
|
215 |
|
216 |
echo $html;
|
@@ -232,26 +268,30 @@ class Structuring_Markup_Custom_Post_Event {
|
|
232 |
/**
|
233 |
* Return the default options array
|
234 |
*
|
235 |
-
* @version
|
236 |
* @since 3.2.3
|
237 |
* @return array $args
|
238 |
*/
|
239 |
private function get_default_options () {
|
240 |
$args = array(
|
241 |
-
'schema_event_type'
|
242 |
-
'schema_event_name'
|
243 |
-
'schema_event_description'
|
244 |
-
'schema_event_image'
|
245 |
-
'schema_event_date'
|
246 |
-
'schema_event_time'
|
247 |
-
'schema_event_date_end'
|
248 |
-
'schema_event_time_end'
|
249 |
-
'schema_event_url'
|
250 |
-
'schema_event_place_name'
|
251 |
-
'schema_event_place_url'
|
252 |
-
'schema_event_place_address'
|
253 |
-
'
|
254 |
-
'
|
|
|
|
|
|
|
|
|
255 |
);
|
256 |
|
257 |
return (array) $args;
|
3 |
* Schema.org Custom Post "Event"
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
+
* @version 4.0.2
|
7 |
* @since 2.1.0
|
8 |
* @link https://schema.org/Event
|
9 |
* @link https://developers.google.com/search/docs/data-types/events
|
47 |
"VisualArtsEvent"
|
48 |
);
|
49 |
|
50 |
+
/**
|
51 |
+
* Event Type.
|
52 |
+
*
|
53 |
+
* @version 4.0.2
|
54 |
+
* @since 4.0.2
|
55 |
+
*/
|
56 |
+
private $offers_availability = array(
|
57 |
+
"InStock",
|
58 |
+
"SoldOut",
|
59 |
+
"PreOrder"
|
60 |
+
);
|
61 |
+
|
62 |
/**
|
63 |
* Constructor Define.
|
64 |
*
|
136 |
/**
|
137 |
* Set custom fields.
|
138 |
*
|
139 |
+
* @version 4.0.2
|
140 |
* @since 2.1.0
|
141 |
*/
|
142 |
public function set_custom_fields () {
|
161 |
if ( $value === $args['schema_event_type'] ) {
|
162 |
$html .= ' selected="selected"';
|
163 |
}
|
164 |
+
$html .= ' value="' . $value . '">' . $value . '</option>';
|
165 |
}
|
166 |
$html .= '</select>';
|
167 |
$html .= '</td></tr>';
|
212 |
$html .= ' (required)</label></td><td>';
|
213 |
$html .= '<input type="text" name="option[' . "schema_event_place_address" . ']" id="schema_event_place_address" class="regular-text" required value="' . esc_attr( $args['schema_event_place_address'] ) . '">';
|
214 |
$html .= '</td></tr>';
|
215 |
+
$html .= '<tr><td><label for="schema_event_type">';
|
216 |
+
$html .= esc_html__( 'Availability', $this->text_domain );
|
217 |
+
$html .= ' (required)</label></td><td>';
|
218 |
+
$html .= '<select name="option[' . "schema_event_offers_availability" . ']" id="schema_event_offers_availability">';
|
219 |
+
foreach( $this->offers_availability as $value) {
|
220 |
+
$html .= '<option';
|
221 |
+
if ( $value === $args['schema_event_offers_availability'] ) {
|
222 |
+
$html .= ' selected="selected"';
|
223 |
+
}
|
224 |
+
$html .= ' value="' . $value . '">' . $value . '</option>';
|
225 |
+
}
|
226 |
+
$html .= '</select>';
|
227 |
+
$html .= '</td></tr>';
|
228 |
$html .= '<tr><td><label for="schema_event_offers_price">';
|
229 |
$html .= esc_html__( 'Price', $this->text_domain );
|
230 |
$html .= ' (required)</label></td><td>';
|
236 |
$html .= '<input type="text" name="option[' . "schema_event_offers_currency" . ']" id="schema_event_offers_currency" maxlength="3" required value="' . esc_attr( $args['schema_event_offers_currency'] ) . '">';
|
237 |
$html .= ' <small>( with <a hre="https://en.wikipedia.org/wiki/ISO_4217#Active_codes" target="_blank">ISO 4217 codes</a> e.g. "USD" )</small>';
|
238 |
$html .= '</td></tr>';
|
239 |
+
$html .= '<tr><td><label for="schema_event_offers_date">';
|
240 |
+
$html .= esc_html__( 'validFrom', $this->text_domain );
|
241 |
+
$html .= ' (recommended)</label></td><td>';
|
242 |
+
$html .= '<input type="date" name="option[' . "schema_event_offers_date" . ']" id="schema_event_offers_date" value="' . esc_attr( $args['schema_event_offers_date'] ) . '">';
|
243 |
+
$html .= '<input type="time" name="option[' . "schema_event_offers_time" . ']" id="schema_event_offers_time" value="' . esc_attr( $args['schema_event_offers_time'] ) . '">';
|
244 |
+
$html .= '</td></tr>';
|
245 |
+
$html .= '<tr><td><label for="schema_event_performer_name">';
|
246 |
+
$html .= esc_html__( 'Event Performer', $this->text_domain );
|
247 |
+
$html .= ' (recommended)</label></td><td>';
|
248 |
+
$html .= '<input type="text" name="option[' . "schema_event_performer_name" . ']" id="schema_event_performer_name" class="regular-text" required value="' . esc_attr( $args['schema_event_performer_name'] ) . '">';
|
249 |
+
$html .= '</td></tr>';
|
250 |
$html .= '</table>';
|
251 |
|
252 |
echo $html;
|
268 |
/**
|
269 |
* Return the default options array
|
270 |
*
|
271 |
+
* @version 4.0.2
|
272 |
* @since 3.2.3
|
273 |
* @return array $args
|
274 |
*/
|
275 |
private function get_default_options () {
|
276 |
$args = array(
|
277 |
+
'schema_event_type' => 'Event',
|
278 |
+
'schema_event_name' => '',
|
279 |
+
'schema_event_description' => '',
|
280 |
+
'schema_event_image' => '',
|
281 |
+
'schema_event_date' => date( 'Y-m-d' ),
|
282 |
+
'schema_event_time' => date( 'h:i' ),
|
283 |
+
'schema_event_date_end' => '',
|
284 |
+
'schema_event_time_end' => '',
|
285 |
+
'schema_event_url' => '',
|
286 |
+
'schema_event_place_name' => '',
|
287 |
+
'schema_event_place_url' => '',
|
288 |
+
'schema_event_place_address' => '',
|
289 |
+
'schema_event_offers_availability' => 'InStock',
|
290 |
+
'schema_event_offers_price' => 0,
|
291 |
+
'schema_event_offers_currency' => esc_html__( 'USD', $this->text_domain ),
|
292 |
+
'schema_event_offers_date' => '',
|
293 |
+
'schema_event_offers_time' => '',
|
294 |
+
'schema_event_performer_name' => ''
|
295 |
);
|
296 |
|
297 |
return (array) $args;
|
includes/meta/wp-structuring-meta-event.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Schema.org Type Event
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
-
* @version 4.0.
|
7 |
* @since 4.0.0
|
8 |
* @link http://schema.org/Event
|
9 |
* @link http://schema.org/Place
|
@@ -15,7 +15,7 @@ class Structuring_Markup_Meta_Event {
|
|
15 |
/**
|
16 |
* Setting schema.org Event
|
17 |
*
|
18 |
-
* @version 4.0.
|
19 |
* @since 4.0.0
|
20 |
* @return array $args
|
21 |
*/
|
@@ -26,7 +26,7 @@ class Structuring_Markup_Meta_Event {
|
|
26 |
if ( isset( $meta[0] ) ) {
|
27 |
$meta = unserialize( $meta[0] );
|
28 |
|
29 |
-
|
30 |
if ( !isset( $meta['schema_event_type']) ) $meta['schema_event_type'] = 'Event';
|
31 |
if ( !isset( $meta['schema_event_name']) ) $meta['schema_event_name'] = '';
|
32 |
if ( !isset( $meta['schema_event_date']) ) $meta['schema_event_date'] = date('Y-m-d');
|
@@ -49,16 +49,10 @@ class Structuring_Markup_Meta_Event {
|
|
49 |
"sameAs" => esc_url( $meta['schema_event_place_url'] ),
|
50 |
"name" => esc_html( $meta['schema_event_place_name'] ),
|
51 |
"address" => esc_html( $meta['schema_event_place_address'] )
|
52 |
-
),
|
53 |
-
"offers" => array(
|
54 |
-
"@type" => "Offer",
|
55 |
-
"price" => esc_html( $meta['schema_event_offers_price'] ),
|
56 |
-
"priceCurrency" => esc_html( $meta['schema_event_offers_currency'] ),
|
57 |
-
"url" => esc_url( $meta['schema_event_url'] )
|
58 |
)
|
59 |
);
|
60 |
|
61 |
-
|
62 |
if ( isset( $meta['schema_event_description'] ) && $meta['schema_event_description'] !== '' ) {
|
63 |
$args['description'] = esc_html( $meta['schema_event_description'] );
|
64 |
}
|
@@ -69,6 +63,32 @@ class Structuring_Markup_Meta_Event {
|
|
69 |
$args['endDate'] = esc_html( $meta['schema_event_date_end'] ) . 'T' . esc_html( $meta['schema_event_time_end'] );
|
70 |
}
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
return (array) $args;
|
73 |
}
|
74 |
}
|
3 |
* Schema.org Type Event
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
+
* @version 4.0.2
|
7 |
* @since 4.0.0
|
8 |
* @link http://schema.org/Event
|
9 |
* @link http://schema.org/Place
|
15 |
/**
|
16 |
* Setting schema.org Event
|
17 |
*
|
18 |
+
* @version 4.0.2
|
19 |
* @since 4.0.0
|
20 |
* @return array $args
|
21 |
*/
|
26 |
if ( isset( $meta[0] ) ) {
|
27 |
$meta = unserialize( $meta[0] );
|
28 |
|
29 |
+
// @type: Event
|
30 |
if ( !isset( $meta['schema_event_type']) ) $meta['schema_event_type'] = 'Event';
|
31 |
if ( !isset( $meta['schema_event_name']) ) $meta['schema_event_name'] = '';
|
32 |
if ( !isset( $meta['schema_event_date']) ) $meta['schema_event_date'] = date('Y-m-d');
|
49 |
"sameAs" => esc_url( $meta['schema_event_place_url'] ),
|
50 |
"name" => esc_html( $meta['schema_event_place_name'] ),
|
51 |
"address" => esc_html( $meta['schema_event_place_address'] )
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
)
|
53 |
);
|
54 |
|
55 |
+
// @type: Event recommended items
|
56 |
if ( isset( $meta['schema_event_description'] ) && $meta['schema_event_description'] !== '' ) {
|
57 |
$args['description'] = esc_html( $meta['schema_event_description'] );
|
58 |
}
|
63 |
$args['endDate'] = esc_html( $meta['schema_event_date_end'] ) . 'T' . esc_html( $meta['schema_event_time_end'] );
|
64 |
}
|
65 |
|
66 |
+
// @type: Offer
|
67 |
+
$offer = array(
|
68 |
+
"@type" => "Offer",
|
69 |
+
"price" => esc_html( $meta['schema_event_offers_price'] ),
|
70 |
+
"priceCurrency" => esc_html( $meta['schema_event_offers_currency'] ),
|
71 |
+
"url" => esc_url( $meta['schema_event_url'] )
|
72 |
+
);
|
73 |
+
|
74 |
+
// @type: Offer recommended items
|
75 |
+
if ( isset( $meta['schema_event_offers_availability'] ) && $meta['schema_event_offers_availability'] !== '' ) {
|
76 |
+
$offer['availability'] = "http://schema.org/" . esc_html( $meta['schema_event_offers_availability'] );
|
77 |
+
}
|
78 |
+
if ( isset( $meta['schema_event_offers_date'] ) && $meta['schema_event_offers_date'] !== '' && isset( $meta['schema_event_offers_time'] ) && $meta['schema_event_offers_time'] !== '' ) {
|
79 |
+
$offer['validFrom'] = esc_html( $meta['schema_event_offers_date'] ) . 'T' . esc_html( $meta['schema_event_offers_time'] );
|
80 |
+
}
|
81 |
+
|
82 |
+
$args['offers'] = $offer;
|
83 |
+
|
84 |
+
// @type: PerformingGroup recommended items
|
85 |
+
if ( isset( $meta['schema_event_performer_name'] ) && $meta['schema_event_performer_name'] !== '' ) {
|
86 |
+
$args['performer'] = array(
|
87 |
+
"@type" => "PerformingGroup",
|
88 |
+
"name" => esc_html( $meta['schema_event_performer_name'] )
|
89 |
+
);
|
90 |
+
}
|
91 |
+
|
92 |
return (array) $args;
|
93 |
}
|
94 |
}
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
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.
|
6 |
-
Stable tag: 4.0.
|
7 |
|
8 |
Allows you to include schema.org JSON-LD syntax markup on your website
|
9 |
|
@@ -54,6 +54,11 @@ if ( shortcode_exists( 'wp-structuring-markup-breadcrumb' ) ) {
|
|
54 |
|
55 |
== Changelog ==
|
56 |
|
|
|
|
|
|
|
|
|
|
|
57 |
= 4.0.1 (2017-05-25) =
|
58 |
* Added : Hook point of AMP plug-ins (Automattic, Inc. release). https://wordpress.org/plugins/amp/
|
59 |
* Added : Site Navigation on only Home Page.
|
2 |
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.8.0
|
6 |
+
Stable tag: 4.0.2
|
7 |
|
8 |
Allows you to include schema.org JSON-LD syntax markup on your website
|
9 |
|
54 |
|
55 |
== Changelog ==
|
56 |
|
57 |
+
= 4.0.2 (2017-06-14) =
|
58 |
+
* Checked : WordPress version 4.8.0 operation check.
|
59 |
+
* Updated : Warning: Event type schema.org ( availability, validFrom and performer. )
|
60 |
+
* Fixed : Events and videos of custom posts should not appear in choices.
|
61 |
+
|
62 |
= 4.0.1 (2017-05-25) =
|
63 |
* Added : Hook point of AMP plug-ins (Automattic, Inc. release). https://wordpress.org/plugins/amp/
|
64 |
* Added : Site Navigation on only Home Page.
|
wp-structuring-markup.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Markup (JSON-LD) structured in schema.org
|
4 |
Plugin URI: https://github.com/miiitaka/wp-structuring-markup
|
5 |
Description: Allows you to include schema.org JSON-LD syntax markup on your website
|
6 |
-
Version: 4.0.
|
7 |
Author: Kazuya Takami
|
8 |
Author URI: https://www.terakoya.work/
|
9 |
License: GPLv2 or later
|
@@ -18,7 +18,7 @@ new Structuring_Markup();
|
|
18 |
* Schema.org Basic Class
|
19 |
*
|
20 |
* @author Kazuya Takami
|
21 |
-
* @version 4.0.
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
class Structuring_Markup {
|
@@ -26,10 +26,10 @@ class Structuring_Markup {
|
|
26 |
/**
|
27 |
* Variable definition version.
|
28 |
*
|
29 |
-
* @version 4.0.
|
30 |
* @since 1.3.0
|
31 |
*/
|
32 |
-
private $version = '4.0.
|
33 |
|
34 |
/**
|
35 |
* Variable definition Text Domain.
|
3 |
Plugin Name: Markup (JSON-LD) structured in schema.org
|
4 |
Plugin URI: https://github.com/miiitaka/wp-structuring-markup
|
5 |
Description: Allows you to include schema.org JSON-LD syntax markup on your website
|
6 |
+
Version: 4.0.2
|
7 |
Author: Kazuya Takami
|
8 |
Author URI: https://www.terakoya.work/
|
9 |
License: GPLv2 or later
|
18 |
* Schema.org Basic Class
|
19 |
*
|
20 |
* @author Kazuya Takami
|
21 |
+
* @version 4.0.2
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
class Structuring_Markup {
|
26 |
/**
|
27 |
* Variable definition version.
|
28 |
*
|
29 |
+
* @version 4.0.2
|
30 |
* @since 1.3.0
|
31 |
*/
|
32 |
+
private $version = '4.0.2';
|
33 |
|
34 |
/**
|
35 |
* Variable definition Text Domain.
|