Version Description
(2019-01-06) = * Checked : WordPress version 5.0.2 operation check. * Checked : WordPress version 5.0.1 operation check. * Checked : WordPress version 5.0.0 operation check. * Fixed : Version information missing at new registration.
Download this release
Release Info
Developer | miiitaka |
Plugin | Markup (JSON-LD) structured in schema.org |
Version | 4.6.2 |
Comparing to | |
See all releases |
Code changes from version 4.6.1 to 4.6.2
- includes/admin/wp-structuring-admin-db.php +291 -289
- readme.txt +364 -358
- wp-structuring-markup.php +307 -307
includes/admin/wp-structuring-admin-db.php
CHANGED
@@ -1,290 +1,292 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Schema.org Admin DB Connection.
|
4 |
-
*
|
5 |
-
* @author Kazuya Takami
|
6 |
-
* @version 4.
|
7 |
-
* @since 1.0.0
|
8 |
-
*/
|
9 |
-
class Structuring_Markup_Admin_Db {
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Variable definition.
|
13 |
-
*
|
14 |
-
* @version 3.1.0
|
15 |
-
* @since 1.0.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 |
-
"person" => "Person",
|
29 |
-
"site_navigation"=> "Site Navigation",
|
30 |
-
"video" => "Video",
|
31 |
-
"website" => "Web Site"
|
32 |
-
);
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Constructor Define.
|
36 |
-
*
|
37 |
-
* @version 1.3.2
|
38 |
-
* @since 1.0.0
|
39 |
-
*/
|
40 |
-
public function __construct () {
|
41 |
-
global $wpdb;
|
42 |
-
$this->table_name = $wpdb->prefix . 'structuring_markup';
|
43 |
-
}
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Create Table.
|
47 |
-
*
|
48 |
-
* @version 4.3.0
|
49 |
-
* @since 1.0.0
|
50 |
-
* @param string $text_domain
|
51 |
-
* @param string $version
|
52 |
-
*/
|
53 |
-
public function create_table ( $text_domain, $version ) {
|
54 |
-
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
55 |
-
|
56 |
-
global $wpdb;
|
57 |
-
|
58 |
-
$prepared = $wpdb->prepare( "SHOW TABLES LIKE %s", $this->table_name );
|
59 |
-
$is_db_exists = $wpdb->get_var( $prepared );
|
60 |
-
$charset_collate = $wpdb->get_charset_collate();
|
61 |
-
|
62 |
-
if ( is_null( $is_db_exists ) ) {
|
63 |
-
$this->create_table_execute( $charset_collate, $text_domain, $version );
|
64 |
-
|
65 |
-
foreach ( $this->type_array as $key => $value ) {
|
66 |
-
$args = array(
|
67 |
-
'type' => $key,
|
68 |
-
'activate' => "",
|
69 |
-
'output' => serialize( array() ),
|
70 |
-
'options' => serialize( array() ),
|
71 |
-
'register_date' => date( "Y-m-d H:i:s" ),
|
72 |
-
'update_date' => date( "Y-m-d H:i:s" )
|
73 |
-
);
|
74 |
-
$this->insert_options( $args );
|
75 |
-
}
|
76 |
-
} else {
|
77 |
-
/**
|
78 |
-
* version up process.
|
79 |
-
*
|
80 |
-
* @version 4.4.0
|
81 |
-
* @since 2.0.0
|
82 |
-
* */
|
83 |
-
$options = get_option( $text_domain );
|
84 |
-
|
85 |
-
if ( !isset( $options['version'] ) || $options['version'] !== $version ) {
|
86 |
-
$lists = $this->get_list_options();
|
87 |
-
|
88 |
-
$wpdb->query( "DROP TABLE " . $this->table_name );
|
89 |
-
$this->create_table_execute( $charset_collate, $text_domain, $version );
|
90 |
-
|
91 |
-
foreach ( $this->type_array as $key => $value ) {
|
92 |
-
$args = array(
|
93 |
-
'type' => $key,
|
94 |
-
'activate' => "",
|
95 |
-
'output' => serialize( array() ),
|
96 |
-
'options' => serialize( array() ),
|
97 |
-
'register_date' => date( "Y-m-d H:i:s" ),
|
98 |
-
'update_date' => date( "Y-m-d H:i:s" )
|
99 |
-
);
|
100 |
-
foreach ( $lists as $list ) {
|
101 |
-
if ( $list->type === $key ) {
|
102 |
-
$activate = isset( $list->activate ) ? $list->activate : "";
|
103 |
-
|
104 |
-
// version up default value setting.
|
105 |
-
if ( $version >= '4.3.0' && $key === 'breadcrumb' ) {
|
106 |
-
$works = unserialize( $list->options );
|
107 |
-
$works['current_link'] = 'on';
|
108 |
-
$list->options = serialize( $works );
|
109 |
-
}
|
110 |
-
|
111 |
-
$args = array(
|
112 |
-
'type' => $key,
|
113 |
-
'activate' => $activate,
|
114 |
-
'output' => $list->output,
|
115 |
-
'options' => $list->options,
|
116 |
-
'register_date' => date( "Y-m-d H:i:s" ),
|
117 |
-
'update_date' => date( "Y-m-d H:i:s" )
|
118 |
-
);
|
119 |
-
}
|
120 |
-
}
|
121 |
-
$this->insert_options( $args );
|
122 |
-
}
|
123 |
-
}
|
124 |
-
}
|
125 |
-
}
|
126 |
-
|
127 |
-
/**
|
128 |
-
* Create table execute
|
129 |
-
*
|
130 |
-
* @version 4.
|
131 |
-
* @since 2.0.0
|
132 |
-
* @param string $charset_collate
|
133 |
-
* @param string $text_domain
|
134 |
-
* @param string $version
|
135 |
-
*/
|
136 |
-
private function create_table_execute ( $charset_collate, $text_domain, $version ) {
|
137 |
-
$query = " CREATE TABLE " . $this->table_name;
|
138 |
-
$query .= " (id MEDIUMINT(9) NOT NULL AUTO_INCREMENT PRIMARY KEY";
|
139 |
-
$query .= ",type TINYTEXT NOT NULL";
|
140 |
-
$query .= ",activate TINYTEXT NOT NULL";
|
141 |
-
$query .= ",output TEXT NOT NULL";
|
142 |
-
$query .= ",options TEXT NOT NULL";
|
143 |
-
$query .= ",register_date DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL";
|
144 |
-
$query .= ",update_date DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL";
|
145 |
-
$query .= ",UNIQUE KEY id (id)) " . $charset_collate;
|
146 |
-
|
147 |
-
dbDelta( $query );
|
148 |
-
|
149 |
-
$args = array( 'version' => $version );
|
150 |
-
$options = get_option( $text_domain );
|
151 |
-
|
152 |
-
if ( $options ) {
|
153 |
-
$options = array_merge( $options, $args );
|
154 |
-
}
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
*
|
162 |
-
*
|
163 |
-
* @
|
164 |
-
* @
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
$
|
172 |
-
$
|
173 |
-
$
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
$results['
|
179 |
-
$results['
|
180 |
-
$results['
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
*
|
189 |
-
*
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
*
|
203 |
-
*
|
204 |
-
* @
|
205 |
-
* @
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
$
|
213 |
-
$
|
214 |
-
$
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
$results['
|
220 |
-
$results['
|
221 |
-
$results['
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
*
|
230 |
-
*
|
231 |
-
* @
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
$
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
*
|
244 |
-
*
|
245 |
-
* @
|
246 |
-
* @
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
$
|
252 |
-
|
253 |
-
|
254 |
-
'
|
255 |
-
'
|
256 |
-
'
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
$
|
261 |
-
|
262 |
-
$
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
*
|
271 |
-
*
|
272 |
-
* @
|
273 |
-
* @
|
274 |
-
* @
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
|
|
|
|
290 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Schema.org Admin DB Connection.
|
4 |
+
*
|
5 |
+
* @author Kazuya Takami
|
6 |
+
* @version 4.6.2
|
7 |
+
* @since 1.0.0
|
8 |
+
*/
|
9 |
+
class Structuring_Markup_Admin_Db {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Variable definition.
|
13 |
+
*
|
14 |
+
* @version 3.1.0
|
15 |
+
* @since 1.0.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 |
+
"person" => "Person",
|
29 |
+
"site_navigation"=> "Site Navigation",
|
30 |
+
"video" => "Video",
|
31 |
+
"website" => "Web Site"
|
32 |
+
);
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Constructor Define.
|
36 |
+
*
|
37 |
+
* @version 1.3.2
|
38 |
+
* @since 1.0.0
|
39 |
+
*/
|
40 |
+
public function __construct () {
|
41 |
+
global $wpdb;
|
42 |
+
$this->table_name = $wpdb->prefix . 'structuring_markup';
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Create Table.
|
47 |
+
*
|
48 |
+
* @version 4.3.0
|
49 |
+
* @since 1.0.0
|
50 |
+
* @param string $text_domain
|
51 |
+
* @param string $version
|
52 |
+
*/
|
53 |
+
public function create_table ( $text_domain, $version ) {
|
54 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
55 |
+
|
56 |
+
global $wpdb;
|
57 |
+
|
58 |
+
$prepared = $wpdb->prepare( "SHOW TABLES LIKE %s", $this->table_name );
|
59 |
+
$is_db_exists = $wpdb->get_var( $prepared );
|
60 |
+
$charset_collate = $wpdb->get_charset_collate();
|
61 |
+
|
62 |
+
if ( is_null( $is_db_exists ) ) {
|
63 |
+
$this->create_table_execute( $charset_collate, $text_domain, $version );
|
64 |
+
|
65 |
+
foreach ( $this->type_array as $key => $value ) {
|
66 |
+
$args = array(
|
67 |
+
'type' => $key,
|
68 |
+
'activate' => "",
|
69 |
+
'output' => serialize( array() ),
|
70 |
+
'options' => serialize( array() ),
|
71 |
+
'register_date' => date( "Y-m-d H:i:s" ),
|
72 |
+
'update_date' => date( "Y-m-d H:i:s" )
|
73 |
+
);
|
74 |
+
$this->insert_options( $args );
|
75 |
+
}
|
76 |
+
} else {
|
77 |
+
/**
|
78 |
+
* version up process.
|
79 |
+
*
|
80 |
+
* @version 4.4.0
|
81 |
+
* @since 2.0.0
|
82 |
+
* */
|
83 |
+
$options = get_option( $text_domain );
|
84 |
+
|
85 |
+
if ( !isset( $options['version'] ) || $options['version'] !== $version ) {
|
86 |
+
$lists = $this->get_list_options();
|
87 |
+
|
88 |
+
$wpdb->query( "DROP TABLE " . $this->table_name );
|
89 |
+
$this->create_table_execute( $charset_collate, $text_domain, $version );
|
90 |
+
|
91 |
+
foreach ( $this->type_array as $key => $value ) {
|
92 |
+
$args = array(
|
93 |
+
'type' => $key,
|
94 |
+
'activate' => "",
|
95 |
+
'output' => serialize( array() ),
|
96 |
+
'options' => serialize( array() ),
|
97 |
+
'register_date' => date( "Y-m-d H:i:s" ),
|
98 |
+
'update_date' => date( "Y-m-d H:i:s" )
|
99 |
+
);
|
100 |
+
foreach ( $lists as $list ) {
|
101 |
+
if ( $list->type === $key ) {
|
102 |
+
$activate = isset( $list->activate ) ? $list->activate : "";
|
103 |
+
|
104 |
+
// version up default value setting.
|
105 |
+
if ( $version >= '4.3.0' && $key === 'breadcrumb' ) {
|
106 |
+
$works = unserialize( $list->options );
|
107 |
+
$works['current_link'] = 'on';
|
108 |
+
$list->options = serialize( $works );
|
109 |
+
}
|
110 |
+
|
111 |
+
$args = array(
|
112 |
+
'type' => $key,
|
113 |
+
'activate' => $activate,
|
114 |
+
'output' => $list->output,
|
115 |
+
'options' => $list->options,
|
116 |
+
'register_date' => date( "Y-m-d H:i:s" ),
|
117 |
+
'update_date' => date( "Y-m-d H:i:s" )
|
118 |
+
);
|
119 |
+
}
|
120 |
+
}
|
121 |
+
$this->insert_options( $args );
|
122 |
+
}
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Create table execute
|
129 |
+
*
|
130 |
+
* @version 4.6.2
|
131 |
+
* @since 2.0.0
|
132 |
+
* @param string $charset_collate
|
133 |
+
* @param string $text_domain
|
134 |
+
* @param string $version
|
135 |
+
*/
|
136 |
+
private function create_table_execute ( $charset_collate, $text_domain, $version ) {
|
137 |
+
$query = " CREATE TABLE " . $this->table_name;
|
138 |
+
$query .= " (id MEDIUMINT(9) NOT NULL AUTO_INCREMENT PRIMARY KEY";
|
139 |
+
$query .= ",type TINYTEXT NOT NULL";
|
140 |
+
$query .= ",activate TINYTEXT NOT NULL";
|
141 |
+
$query .= ",output TEXT NOT NULL";
|
142 |
+
$query .= ",options TEXT NOT NULL";
|
143 |
+
$query .= ",register_date DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL";
|
144 |
+
$query .= ",update_date DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL";
|
145 |
+
$query .= ",UNIQUE KEY id (id)) " . $charset_collate;
|
146 |
+
|
147 |
+
dbDelta( $query );
|
148 |
+
|
149 |
+
$args = array( 'version' => $version );
|
150 |
+
$options = get_option( $text_domain );
|
151 |
+
|
152 |
+
if ( $options ) {
|
153 |
+
$options = array_merge( $options, $args );
|
154 |
+
} else {
|
155 |
+
$options = $args;
|
156 |
+
}
|
157 |
+
update_option( $text_domain, $options );
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Get Data.
|
162 |
+
*
|
163 |
+
* @version 2.1.0
|
164 |
+
* @since 1.0.0
|
165 |
+
* @param integer $id
|
166 |
+
* @return array $results
|
167 |
+
*/
|
168 |
+
public function get_options ( $id ) {
|
169 |
+
global $wpdb;
|
170 |
+
|
171 |
+
$query = "SELECT * FROM " . $this->table_name . " WHERE id = %d";
|
172 |
+
$data = array( esc_html( $id ) );
|
173 |
+
$prepared = $wpdb->prepare( $query, $data );
|
174 |
+
$args = $wpdb->get_row( $prepared );
|
175 |
+
$results = array();
|
176 |
+
|
177 |
+
if ( $args ) {
|
178 |
+
$results['id'] = $args->id;
|
179 |
+
$results['activate'] = isset( $args->activate ) ? $args->activate : "";
|
180 |
+
$results['type'] = $args->type;
|
181 |
+
$results['output'] = unserialize( $args->output );
|
182 |
+
$results['option'] = unserialize( $args->options );
|
183 |
+
}
|
184 |
+
return (array) $results;
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Get All Data.
|
189 |
+
*
|
190 |
+
* @since 1.0.0
|
191 |
+
* @return array $results
|
192 |
+
*/
|
193 |
+
public function get_list_options () {
|
194 |
+
global $wpdb;
|
195 |
+
|
196 |
+
$query = "SELECT * FROM " . $this->table_name . " ORDER BY type ASC";
|
197 |
+
|
198 |
+
return (array) $wpdb->get_results( $query );
|
199 |
+
}
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Get Type Data.
|
203 |
+
*
|
204 |
+
* @version 2.1.0
|
205 |
+
* @since 2.0.0
|
206 |
+
* @param string $type
|
207 |
+
* @return array $results
|
208 |
+
*/
|
209 |
+
public function get_type_options ( $type ) {
|
210 |
+
global $wpdb;
|
211 |
+
|
212 |
+
$query = "SELECT * FROM " . $this->table_name . " WHERE type = %s";
|
213 |
+
$data = array( esc_html( $type ) );
|
214 |
+
$prepared = $wpdb->prepare( $query, $data );
|
215 |
+
$args = $wpdb->get_row( $prepared );
|
216 |
+
$results = array();
|
217 |
+
|
218 |
+
if ( $args ) {
|
219 |
+
$results['id'] = $args->id;
|
220 |
+
$results['activate'] = isset( $args->activate ) ? $args->activate : "";
|
221 |
+
$results['type'] = $args->type;
|
222 |
+
$results['output'] = unserialize( $args->output );
|
223 |
+
$results['option'] = unserialize( $args->options );
|
224 |
+
}
|
225 |
+
return (array) $results;
|
226 |
+
}
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Insert Data.
|
230 |
+
*
|
231 |
+
* @version 2.0.0
|
232 |
+
* @since 1.0.0
|
233 |
+
* @param array $args
|
234 |
+
*/
|
235 |
+
private function insert_options ( array $args ) {
|
236 |
+
global $wpdb;
|
237 |
+
|
238 |
+
$prepared = array( '%s', '%s', '%s', '%s', '%s', '%s' );
|
239 |
+
$wpdb->insert( $this->table_name, $args, $prepared );
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* Update Data.
|
244 |
+
*
|
245 |
+
* @version 2.0.0
|
246 |
+
* @since 1.0.0
|
247 |
+
* @param array $post($_POST)
|
248 |
+
* @return integer $post['id']
|
249 |
+
*/
|
250 |
+
public function update_options ( array $post ) {
|
251 |
+
global $wpdb;
|
252 |
+
|
253 |
+
$data = array(
|
254 |
+
'type' => $post['type'],
|
255 |
+
'activate' => isset( $post['activate'] ) ? $post['activate'] : "",
|
256 |
+
'output' => serialize( $post['output'] ),
|
257 |
+
'options' => isset( $post['option'] ) ? serialize( $post['option'] ) : "",
|
258 |
+
'update_date' => date( "Y-m-d H:i:s" )
|
259 |
+
);
|
260 |
+
$key = array( 'id' => esc_html( $post['id'] ) );
|
261 |
+
$prepared = array( '%s', '%s', '%s', '%s', '%s' );
|
262 |
+
$key_prepared = array( '%d' );
|
263 |
+
|
264 |
+
$wpdb->update( $this->table_name, $data, $key, $prepared, $key_prepared );
|
265 |
+
|
266 |
+
return (integer) $post['id'];
|
267 |
+
}
|
268 |
+
|
269 |
+
/**
|
270 |
+
* Update Config Data.
|
271 |
+
*
|
272 |
+
* @version 4.5.0
|
273 |
+
* @since 4.5.0
|
274 |
+
* @param array $post
|
275 |
+
* @param string $text_domain
|
276 |
+
* @return boolean
|
277 |
+
*/
|
278 |
+
public function update_config ( array $post, $text_domain ) {
|
279 |
+
$options = get_option( $text_domain );
|
280 |
+
|
281 |
+
if ( !$options ) {
|
282 |
+
return __return_false();
|
283 |
+
} else {
|
284 |
+
$args = array(
|
285 |
+
'compress' => isset( $post['compress'] ) ? $post['compress'] : ''
|
286 |
+
);
|
287 |
+
$options = array_merge( $options, $args );
|
288 |
+
update_option( $text_domain, $options );
|
289 |
+
return __return_true();
|
290 |
+
}
|
291 |
+
}
|
292 |
}
|
readme.txt
CHANGED
@@ -1,358 +1,364 @@
|
|
1 |
-
=== Markup (JSON-LD) structured in schema.org ===
|
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:
|
6 |
-
Stable tag: 4.6.
|
7 |
-
|
8 |
-
Allows you to include schema.org JSON-LD syntax markup on your website
|
9 |
-
|
10 |
-
== Description ==
|
11 |
-
|
12 |
-
Allows you to include schema.org JSON-LD syntax markup on your website
|
13 |
-
Base knowledge is "https://schema.org/" and "https://developers.google.com/structured-data/"
|
14 |
-
|
15 |
-
= Schema.org Type =
|
16 |
-
|
17 |
-
* Article: http://schema.org/Article
|
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 |
-
* Person: https://schema.org/Person
|
25 |
-
* SiteNavigation: https://schema.org/SiteNavigationElement
|
26 |
-
* Speakable: https://pending.schema.org/speakable
|
27 |
-
* Video: https://schema.org/Video
|
28 |
-
* Website: https://schema.org/WebSite
|
29 |
-
|
30 |
-
= Breadcrumb =
|
31 |
-
|
32 |
-
You can display the breadcrumbs in the short code. Breadcrumb definition is available even if not active.
|
33 |
-
|
34 |
-
[ Example ]
|
35 |
-
`
|
36 |
-
<?php
|
37 |
-
if ( shortcode_exists( 'wp-structuring-markup-breadcrumb' ) ) {
|
38 |
-
echo do_shortcode( '[wp-structuring-markup-breadcrumb]' );
|
39 |
-
}
|
40 |
-
?>
|
41 |
-
`
|
42 |
-
|
43 |
-
[ ShortCode Options ]
|
44 |
-
|
45 |
-
* Option : id="id_name" attribute additional ol element.
|
46 |
-
* Option : class="class_name" attribute additional ol element.
|
47 |
-
|
48 |
-
|
49 |
-
== Installation ==
|
50 |
-
|
51 |
-
* A plug-in installation screen is displayed in the WordPress admin panel.
|
52 |
-
* It installs in `wp-content/plugins`.
|
53 |
-
* The plug-in is activated.
|
54 |
-
* Open 'Schema.org Setting' menu.
|
55 |
-
|
56 |
-
== Changelog ==
|
57 |
-
|
58 |
-
= 4.6.
|
59 |
-
*
|
60 |
-
|
61 |
-
|
62 |
-
*
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
*
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
*
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
*
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
*
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
* Checked : WordPress version 4.9.
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
*
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
*
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
*
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
*
|
127 |
-
*
|
128 |
-
* Fixed :
|
129 |
-
|
130 |
-
= 4.0
|
131 |
-
*
|
132 |
-
* Updated :
|
133 |
-
* Fixed : Events and videos of custom posts should not appear in choices.
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
*
|
138 |
-
*
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
*
|
145 |
-
|
146 |
-
= 3.2.
|
147 |
-
*
|
148 |
-
|
149 |
-
|
150 |
-
*
|
151 |
-
|
152 |
-
= 3.2.
|
153 |
-
* Fixed :
|
154 |
-
*
|
155 |
-
*
|
156 |
-
* Updated :
|
157 |
-
|
158 |
-
= 3.2.
|
159 |
-
* Fixed :
|
160 |
-
*
|
161 |
-
*
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
*
|
168 |
-
|
169 |
-
|
170 |
-
*
|
171 |
-
|
172 |
-
= 3.
|
173 |
-
*
|
174 |
-
|
175 |
-
|
176 |
-
*
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
*
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
*
|
195 |
-
|
196 |
-
|
197 |
-
*
|
198 |
-
|
199 |
-
= 3.
|
200 |
-
*
|
201 |
-
*
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
*
|
212 |
-
|
213 |
-
= 3.0.
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
*
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
*
|
229 |
-
*
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
*
|
235 |
-
*
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
*
|
243 |
-
* Updated :
|
244 |
-
*
|
245 |
-
|
246 |
-
= 2.4.
|
247 |
-
|
248 |
-
*
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
*
|
255 |
-
|
256 |
-
= 2.
|
257 |
-
|
258 |
-
*
|
259 |
-
*
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
* Fixed :
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
*
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
*
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
* Added :
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Markup (JSON-LD) structured in schema.org ===
|
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: 5.0.2
|
6 |
+
Stable tag: 4.6.2
|
7 |
+
|
8 |
+
Allows you to include schema.org JSON-LD syntax markup on your website
|
9 |
+
|
10 |
+
== Description ==
|
11 |
+
|
12 |
+
Allows you to include schema.org JSON-LD syntax markup on your website
|
13 |
+
Base knowledge is "https://schema.org/" and "https://developers.google.com/structured-data/"
|
14 |
+
|
15 |
+
= Schema.org Type =
|
16 |
+
|
17 |
+
* Article: http://schema.org/Article
|
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 |
+
* Person: https://schema.org/Person
|
25 |
+
* SiteNavigation: https://schema.org/SiteNavigationElement
|
26 |
+
* Speakable: https://pending.schema.org/speakable
|
27 |
+
* Video: https://schema.org/Video
|
28 |
+
* Website: https://schema.org/WebSite
|
29 |
+
|
30 |
+
= Breadcrumb =
|
31 |
+
|
32 |
+
You can display the breadcrumbs in the short code. Breadcrumb definition is available even if not active.
|
33 |
+
|
34 |
+
[ Example ]
|
35 |
+
`
|
36 |
+
<?php
|
37 |
+
if ( shortcode_exists( 'wp-structuring-markup-breadcrumb' ) ) {
|
38 |
+
echo do_shortcode( '[wp-structuring-markup-breadcrumb]' );
|
39 |
+
}
|
40 |
+
?>
|
41 |
+
`
|
42 |
+
|
43 |
+
[ ShortCode Options ]
|
44 |
+
|
45 |
+
* Option : id="id_name" attribute additional ol element.
|
46 |
+
* Option : class="class_name" attribute additional ol element.
|
47 |
+
|
48 |
+
|
49 |
+
== Installation ==
|
50 |
+
|
51 |
+
* A plug-in installation screen is displayed in the WordPress admin panel.
|
52 |
+
* It installs in `wp-content/plugins`.
|
53 |
+
* The plug-in is activated.
|
54 |
+
* Open 'Schema.org Setting' menu.
|
55 |
+
|
56 |
+
== Changelog ==
|
57 |
+
|
58 |
+
= 4.6.2 (2019-01-06) =
|
59 |
+
* Checked : WordPress version 5.0.2 operation check.
|
60 |
+
* Checked : WordPress version 5.0.1 operation check.
|
61 |
+
* Checked : WordPress version 5.0.0 operation check.
|
62 |
+
* Fixed : Version information missing at new registration.
|
63 |
+
|
64 |
+
= 4.6.1 (2018-09-19) =
|
65 |
+
* Fixed : Typo Error.
|
66 |
+
|
67 |
+
= 4.6.0 (2018-09-19) =
|
68 |
+
* Updated : Schema type Breadcrumbs: Added switching between home_url () and site_url ().
|
69 |
+
* Updated : Organization schema.org type subdivision.
|
70 |
+
|
71 |
+
= 4.5.3 (2018-09-07) =
|
72 |
+
* Fixed : Fixed broken links.
|
73 |
+
* Fixed : Fixed bug when displaying Config menu.
|
74 |
+
|
75 |
+
= 4.5.2 (2018-09-03) =
|
76 |
+
* Fixed : Changed title fixing of breadcrumbs on page 404.
|
77 |
+
|
78 |
+
= 4.5.0 (2018-08-17) =
|
79 |
+
* Checked : WordPress version 4.9.8 operation check.
|
80 |
+
* Added : Speakable structured markup is implemented in "Article", "BlogPosting", "NewsArticle".
|
81 |
+
* Added : Added function to compress output data.
|
82 |
+
|
83 |
+
= 4.4.0 (2018-07-10) =
|
84 |
+
* Checked : WordPress version 4.9.7 operation check.
|
85 |
+
* Updated : Schema.ory Type "Image", "BlogPosting", "NewsArticle" image property added so that default image URL can be set.
|
86 |
+
|
87 |
+
= 4.3.0 (2018-06-16) =
|
88 |
+
* Checked : WordPress version 4.9.6 operation check.
|
89 |
+
* Updated : Enable / disable function of link setting of current page of breadcrumbs.
|
90 |
+
|
91 |
+
= 4.2.2 (2018-05-15) =
|
92 |
+
* Checked : WordPress version 4.9.5 operation check.
|
93 |
+
* Fixed : If there is a child element on that page in the top fixed page, the parent element duplicates.
|
94 |
+
* Fixed : Taxonomy name of custom posting is not displayed in a custom taxonomy archive page.
|
95 |
+
|
96 |
+
= 4.2.1 (2018-03-23) =
|
97 |
+
* Fixed : Taxonomy name of custom posting is not displayed.
|
98 |
+
|
99 |
+
= 4.1.8 (2018-02-16) =
|
100 |
+
* Checked : WordPress version 4.9.4 operation check.
|
101 |
+
* Checked : WordPress version 4.9.3 operation check.
|
102 |
+
|
103 |
+
= 4.1.7 (2018-01-22) =
|
104 |
+
* Checked : WordPress version 4.9.2 operation check.
|
105 |
+
|
106 |
+
= 4.1.6 (2017-12-12) =
|
107 |
+
* Checked : WordPress version 4.9.1 operation check.
|
108 |
+
* Fixed : Hidden if addressRegion and telephone is empty.
|
109 |
+
|
110 |
+
= 4.1.5 (2017-11-22) =
|
111 |
+
* Checked : WordPress version 4.9.0 operation check.
|
112 |
+
|
113 |
+
= 4.1.4 (2017-11-01) =
|
114 |
+
* Checked : WordPress version 4.8.3 operation check.
|
115 |
+
* Fixed : Error setting aria-label.
|
116 |
+
|
117 |
+
= 4.1.3 (2017-09-27) =
|
118 |
+
* Checked : WordPress version 4.8.2 operation check.
|
119 |
+
* Updated : Stop setting the default value.
|
120 |
+
* Fixed : availableLanguage and area_served array setting ( Organization )
|
121 |
+
|
122 |
+
= 4.1.2 (2017-08-23) =
|
123 |
+
* Checked : WordPress version 4.8.1 operation check.
|
124 |
+
|
125 |
+
= 4.1.1 (2017-07-26) =
|
126 |
+
* Added : Correct to display / hide the current page.(BreadcrumbList schema.org)
|
127 |
+
* Updated : Event and Video type css update.
|
128 |
+
* Fixed : Do not display when the search query is empty.
|
129 |
+
|
130 |
+
= 4.1.0 (2017-07-03) =
|
131 |
+
* Added : If there is no feature image setting, set the first image of the post.
|
132 |
+
* Updated : Organization Image recommended.(Article / NewsArticle / BlogPosting)
|
133 |
+
* Fixed : Events and videos of custom posts should not appear in choices.
|
134 |
+
* Fixed : Organization type Notice Error.
|
135 |
+
|
136 |
+
= 4.0.2 (2017-06-14) =
|
137 |
+
* Checked : WordPress version 4.8.0 operation check.
|
138 |
+
* Updated : Warning: Event type schema.org ( availability, validFrom and performer. )
|
139 |
+
* Fixed : Events and videos of custom posts should not appear in choices.
|
140 |
+
|
141 |
+
= 4.0.1 (2017-05-25) =
|
142 |
+
* Added : Hook point of AMP plug-ins (Automattic, Inc. release). https://wordpress.org/plugins/amp/
|
143 |
+
* Added : Site Navigation on only Home Page.
|
144 |
+
* Fixed : Problem with custom taxonomies.(BreadcrumbList)
|
145 |
+
|
146 |
+
= 3.2.6 (2017-05-20) =
|
147 |
+
* Checked : WordPress version 4.7.5 operation check.
|
148 |
+
|
149 |
+
= 3.2.5 (2017-04-24) =
|
150 |
+
* Checked : WordPress version 4.7.4 operation check.
|
151 |
+
|
152 |
+
= 3.2.4 (2017-03-30) =
|
153 |
+
* Fixed : BreadcrumbList - Ignore the Home setting when setting the head fixed page.
|
154 |
+
* Fixed : BreadcrumbList - Categories of two or more levels are not displayed.
|
155 |
+
* Fixed : Minor bug fixed.
|
156 |
+
* Updated : Article,BlogPosting and NewsArticle - Limit headline to 110 chars.
|
157 |
+
|
158 |
+
= 3.2.3 (2017-03-21) =
|
159 |
+
* Fixed : "Warning: Illegal string offset" error occurred on Video and Event Schema.org.
|
160 |
+
* Updated : Event Types add fields.
|
161 |
+
* Updated : Video Types add fields.
|
162 |
+
* Updated : Change selection method of SiteNavigation type.
|
163 |
+
|
164 |
+
= 3.2.2 (2017-03-09) =
|
165 |
+
* Fixed : Article, BlogPosting, and NewsArticle can not display the Publisher attribute.
|
166 |
+
* Added : Add media selection function to the field for inputting image path.
|
167 |
+
* Checked : WordPress version 4.7.3 operation check.
|
168 |
+
|
169 |
+
= 3.2.1 (2017-02-21) =
|
170 |
+
* Fixed : Call to undefined function imagecreatefromstring().
|
171 |
+
|
172 |
+
= 3.2.0 (2017-01-30) =
|
173 |
+
* Fixed : Invalid breadcrumb markup.
|
174 |
+
* Fixed : Some items are not displayed on "Organization schema.org".
|
175 |
+
* Added : Add items to e-mail to "Organization schema.org".
|
176 |
+
* Checked : WordPress version 4.7.2 operation check.
|
177 |
+
|
178 |
+
= 3.1.7 (2017-01-12) =
|
179 |
+
* Checked : WordPress version 4.7.1 operation check.
|
180 |
+
|
181 |
+
= 3.1.6 (2016-12-16) =
|
182 |
+
* Updated : Change ImageObject attribute of Schema.org type "Article", "BlogPosting", "NewsArticle" from "required" to "recommended".
|
183 |
+
* Fixed : Custom post menu control.
|
184 |
+
|
185 |
+
= 3.1.5 (2016-12-08) =
|
186 |
+
* Checked : WordPress version 4.7.0 operation check.
|
187 |
+
|
188 |
+
= 3.1.4 (2016-11-25) =
|
189 |
+
* Added : Schema.org type "LocalBusiness" item added. "Image", "priceRange" and "servesCuisine".
|
190 |
+
* Added : Print plugin version in comments.
|
191 |
+
|
192 |
+
= 3.1.3 (2016-11-22) =
|
193 |
+
* Updated : Event Type select item of Schema.org type "Event".
|
194 |
+
* Updated : Short Code display changed of Schema.org type "BreadcrumbList".
|
195 |
+
|
196 |
+
= 3.1.2 (2016-09-27) =
|
197 |
+
* Updated : homeLocation input item of Schema.org type "Person".
|
198 |
+
|
199 |
+
= 3.1.1 (2016-09-20) =
|
200 |
+
* Added : Schema.org type "SiteNavigation".
|
201 |
+
* Checked : WordPress version 4.6.1 operation check.
|
202 |
+
* Updated : Application URL input item of Schema.org type "WebSite".
|
203 |
+
* Fixed : LocalBusiness Convert data(In the case of version 2.3.x) Logic remove.
|
204 |
+
|
205 |
+
= 3.0.5 (2016-09-06) =
|
206 |
+
* Fixed : CSS & JavaScript version control.
|
207 |
+
* Fixed : Registration screen display adjustment.
|
208 |
+
|
209 |
+
= 3.0.4 (2016-08-17) =
|
210 |
+
* Fixed : Type Person and Organization Non-display case "sameAs" is empty.
|
211 |
+
* Checked : WordPress version 4.6.0 operation check.
|
212 |
+
|
213 |
+
= 3.0.3 (2016-07-27) =
|
214 |
+
* Fixed : If you select a static page in a display of the front page, the home page is not output at the output page. (Added is_front_page function)
|
215 |
+
|
216 |
+
= 3.0.2 (2016-07-15) =
|
217 |
+
* Updated : Security measures of the update process.
|
218 |
+
|
219 |
+
= 3.0.1 (2016-06-25) =
|
220 |
+
|
221 |
+
* Checked : WordPress version 4.5.3 operation check.
|
222 |
+
|
223 |
+
= 3.0.0 (2016-06-20) =
|
224 |
+
|
225 |
+
* Added : Schema.org type "Video".
|
226 |
+
* Added : Display the cause of the JSON-LD is not output in HTML comments.
|
227 |
+
* Fixed : "Schema.org Event" solve the output of JSON-LD is a problem with the double in the custom posts.
|
228 |
+
* Fixed : Changes to the search of the array to remove the SQL statement to get the output page.
|
229 |
+
* Fixed : "Schema.org Organization" If you have not set up a Social Profiles, it does not show an empty array.
|
230 |
+
* Updated : Japanese translation.
|
231 |
+
|
232 |
+
= 2.5.1 (2016-05-09) =
|
233 |
+
|
234 |
+
* Checked : WordPress version 4.5.2 operation check.
|
235 |
+
* Checked : WordPress version 4.5.1 operation check.
|
236 |
+
|
237 |
+
= 2.5.0 (2016-04-19) =
|
238 |
+
|
239 |
+
* Updated : You can select a custom posts at the output page.
|
240 |
+
* Updated : Add the output on "Pages" in the "Article","BlogPosting" and "NewsArticle" Schema.org type.
|
241 |
+
* Updated : It added the Holiday Opening Hour of items to Schema.org Type "LocalBusiness".
|
242 |
+
* Updated : It added the GeoCircle of items to Schema.org Type "LocalBusiness".
|
243 |
+
* Updated : Japanese translation.
|
244 |
+
* Checked : WordPress version 4.5.0 operation check.
|
245 |
+
|
246 |
+
= 2.4.2 (2016-03-09) =
|
247 |
+
|
248 |
+
* Fixed : Updated image size detection to use curl first, as attachment_url_to_postid() hits the database
|
249 |
+
* Updated : Added a transient cache class to cache taxing operations
|
250 |
+
* Updated : Turkish translation.
|
251 |
+
|
252 |
+
= 2.4.1 (2016-03-01) =
|
253 |
+
|
254 |
+
* Updated : Japanese translation.
|
255 |
+
|
256 |
+
= 2.4.0 (2016-02-06) =
|
257 |
+
|
258 |
+
* Added : Schema.org type "Person".
|
259 |
+
* Updated : Schema.org type "LocalBusiness" OpenHours : shift time setting.
|
260 |
+
* Checked : WordPress version 4.4.2 operation check.
|
261 |
+
|
262 |
+
= 2.3.3 (2016-01-19) =
|
263 |
+
|
264 |
+
* Fixed : Improved wording on admin pages.
|
265 |
+
* Fixed : Added alternate methods to get image dimensions for systems running legacy SSL.
|
266 |
+
|
267 |
+
= 2.3.2 (2016-01-10) =
|
268 |
+
|
269 |
+
* Fixed : Fixed a bug that Organization type of display error of contactType comes out.
|
270 |
+
* Fixed : Fixed a bug that can not save LocalBusiness type of latitude and longitude.
|
271 |
+
|
272 |
+
= 2.3.1 (2016-01-07) =
|
273 |
+
|
274 |
+
* Checked : WordPress version 4.4.1 operation check.
|
275 |
+
* Added : Breadcrumb ShortCode option add.
|
276 |
+
|
277 |
+
= 2.3.0 (2016-01-03) =
|
278 |
+
|
279 |
+
* Added : Schema.org type "LocalBusiness".
|
280 |
+
* Fixed : Organization Definition minor bug fixed.
|
281 |
+
|
282 |
+
= 2.2.1 (2015-12-21) =
|
283 |
+
|
284 |
+
* Fixed : Breadcrumb ShortCode minor bug fixed.
|
285 |
+
|
286 |
+
= 2.2.0 (2015-12-16) =
|
287 |
+
|
288 |
+
* Updated : Updated on December 14, 2015 was structured data (Article) AMP correspondence. https://developers.google.com/structured-data/rich-snippets/articles?hl=ja
|
289 |
+
|
290 |
+
= 2.1.3 (2015-12-11) =
|
291 |
+
|
292 |
+
* Fixed : Minor bug fixed.
|
293 |
+
|
294 |
+
= 2.1.2 (2015-12-09) =
|
295 |
+
|
296 |
+
* Check : WordPress version 4.4 operation check.
|
297 |
+
|
298 |
+
= 2.1.1 (2015-12-04) =
|
299 |
+
|
300 |
+
* Added : Add the table update processing at the time of version up.
|
301 |
+
|
302 |
+
= 2.1.0 (2015-12-03) =
|
303 |
+
|
304 |
+
* Added : Schema.org type "Event" schema.org definition Add "Event" custom post output that works.
|
305 |
+
|
306 |
+
= 2.0.2 (2015-11-27) =
|
307 |
+
|
308 |
+
* Fixed : Breadcrumb ShortCode minor bug fixed.
|
309 |
+
|
310 |
+
= 2.0.1 (2015-11-25) =
|
311 |
+
|
312 |
+
* Fixed : Notice error fixed.
|
313 |
+
|
314 |
+
= 2.0.0 (2015-11-23) =
|
315 |
+
|
316 |
+
* Added : Schema.org type "BreadcrumbList" schema.org definition Add breadcrumbs short code output that works.
|
317 |
+
* Updated : Schema.org definition immobilization.
|
318 |
+
|
319 |
+
= 1.3.2 (2015-11-17) =
|
320 |
+
|
321 |
+
* Fixed : Fixed translation.
|
322 |
+
* Added : Additional output comment.
|
323 |
+
|
324 |
+
= 1.3.1 =
|
325 |
+
|
326 |
+
* Fixed : none-function fixed.
|
327 |
+
|
328 |
+
= 1.3.0 =
|
329 |
+
|
330 |
+
* Added : Localizing into Japanese.
|
331 |
+
|
332 |
+
= 1.2.1 =
|
333 |
+
|
334 |
+
* Updated : Read admin menu css -> wp_register_style setting
|
335 |
+
* Fixed : Typo Missing.
|
336 |
+
|
337 |
+
= 1.2.0 =
|
338 |
+
|
339 |
+
* Added : Schema.org type "BlogPosting".
|
340 |
+
|
341 |
+
= 1.1.3 =
|
342 |
+
|
343 |
+
* Fixed : To escape a newline code and the tag of the body attribute in Type "Article" and "NewsArticle".
|
344 |
+
|
345 |
+
= 1.1.2 =
|
346 |
+
|
347 |
+
* Updated : Schema.org type "Article" image attribute.
|
348 |
+
|
349 |
+
= 1.1.0 =
|
350 |
+
|
351 |
+
* Added : Schema.org type "Article".
|
352 |
+
|
353 |
+
= 1.0.1 - 1.0.8 =
|
354 |
+
|
355 |
+
* Fixed : Missing plugin path setting.
|
356 |
+
|
357 |
+
= 1.0.0 =
|
358 |
+
|
359 |
+
* First release of this plugin.
|
360 |
+
|
361 |
+
== Contact ==
|
362 |
+
|
363 |
+
* email to foundationmeister[at]outlook.com
|
364 |
+
* twitter @miiitaka
|
wp-structuring-markup.php
CHANGED
@@ -1,308 +1,308 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
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.6.
|
7 |
-
Author: Kazuya Takami
|
8 |
-
Author URI: https://www.terakoya.work/
|
9 |
-
License: GPLv2 or later
|
10 |
-
Text Domain: wp-structuring-markup
|
11 |
-
Domain Path: /languages
|
12 |
-
*/
|
13 |
-
require_once( plugin_dir_path( __FILE__ ) . 'includes/admin/wp-structuring-admin-db.php' );
|
14 |
-
|
15 |
-
new Structuring_Markup();
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Schema.org Basic Class
|
19 |
-
*
|
20 |
-
* @author Kazuya Takami
|
21 |
-
* @version 4.6.
|
22 |
-
* @since 1.0.0
|
23 |
-
*/
|
24 |
-
class Structuring_Markup {
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Variable definition version.
|
28 |
-
*
|
29 |
-
* @version 4.6.
|
30 |
-
* @since 1.3.0
|
31 |
-
*/
|
32 |
-
private $version = '4.6.
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Variable definition Text Domain.
|
36 |
-
*
|
37 |
-
* @version 3.2.5
|
38 |
-
* @since 1.3.0
|
39 |
-
*/
|
40 |
-
private $text_domain = 'wp-structuring-markup';
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Constructor Define.
|
44 |
-
*
|
45 |
-
* @version 4.1.1
|
46 |
-
* @since 1.0.0
|
47 |
-
*/
|
48 |
-
public function __construct() {
|
49 |
-
register_activation_hook( __FILE__, array( $this, 'create_table' ) );
|
50 |
-
|
51 |
-
add_shortcode( $this->text_domain . '-breadcrumb', array( $this, 'short_code_init_breadcrumb' ) );
|
52 |
-
|
53 |
-
add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) );
|
54 |
-
add_action( 'init', array( $this, 'create_post_type' ) );
|
55 |
-
|
56 |
-
if ( is_admin() ) {
|
57 |
-
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
58 |
-
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
59 |
-
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'plugin_action_links' ) );
|
60 |
-
} else {
|
61 |
-
add_action( 'wp_head', array( $this, 'wp_head' ) );
|
62 |
-
add_filter( 'amp_post_template_metadata', array( $this, 'amp_post_template_metadata' ), 9 );
|
63 |
-
}
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Create table.
|
68 |
-
*
|
69 |
-
* @version 2.0.0
|
70 |
-
* @since 2.0.0
|
71 |
-
*/
|
72 |
-
public function create_table() {
|
73 |
-
$db = new Structuring_Markup_Admin_Db();
|
74 |
-
$db->create_table( $this->text_domain, $this->version );
|
75 |
-
}
|
76 |
-
|
77 |
-
/**
|
78 |
-
* Breadcrumb ShortCode Register.
|
79 |
-
*
|
80 |
-
* @version 2.3.1
|
81 |
-
* @since 2.0.0
|
82 |
-
* @param string $args short code params
|
83 |
-
* @return string $html
|
84 |
-
*/
|
85 |
-
public function short_code_init_breadcrumb ( $args ) {
|
86 |
-
$db = new Structuring_Markup_Admin_Db();
|
87 |
-
$results = $db->get_type_options( 'breadcrumb' );
|
88 |
-
|
89 |
-
if ( isset( $results['option'] ) ) {
|
90 |
-
$options = $results['option'];
|
91 |
-
|
92 |
-
require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-short-code-breadcrumb.php');
|
93 |
-
$obj = new Structuring_Markup_ShortCode_Breadcrumb();
|
94 |
-
return $obj->short_code_display( $options, $args );
|
95 |
-
} else {
|
96 |
-
return __return_false();
|
97 |
-
}
|
98 |
-
}
|
99 |
-
|
100 |
-
/**
|
101 |
-
* i18n.
|
102 |
-
*
|
103 |
-
* @version 1.3.0
|
104 |
-
* @since 1.3.0
|
105 |
-
*/
|
106 |
-
public function plugins_loaded () {
|
107 |
-
load_plugin_textdomain( $this->text_domain, __return_false(), dirname( plugin_basename( __FILE__ ) ) . '/languages' );
|
108 |
-
}
|
109 |
-
|
110 |
-
/**
|
111 |
-
* Create custom post type.
|
112 |
-
*
|
113 |
-
* @version 4.0.0
|
114 |
-
* @since 2.1.0
|
115 |
-
*/
|
116 |
-
function create_post_type () {
|
117 |
-
require_once( plugin_dir_path( __FILE__ ) . 'includes/custom/wp-structuring-custom-post-event.php' );
|
118 |
-
new Structuring_Markup_Custom_Post_Event( $this->text_domain );
|
119 |
-
require_once( plugin_dir_path( __FILE__ ) . 'includes/custom/wp-structuring-custom-post-video.php' );
|
120 |
-
new Structuring_Markup_Custom_Post_Video( $this->text_domain );
|
121 |
-
}
|
122 |
-
|
123 |
-
/**
|
124 |
-
* admin init.
|
125 |
-
*
|
126 |
-
* @version 4.1.1
|
127 |
-
* @since 1.3.1
|
128 |
-
*/
|
129 |
-
public function admin_init () {
|
130 |
-
/** version up check */
|
131 |
-
$options = get_option( $this->text_domain );
|
132 |
-
if ( !isset( $options['version'] ) || $options['version'] !== $this->version ) {
|
133 |
-
$this->create_table();
|
134 |
-
}
|
135 |
-
|
136 |
-
wp_register_style( 'wp-structuring-markup-admin-style', plugins_url( 'css/style.css', __FILE__ ), array(), $this->version );
|
137 |
-
wp_register_style( 'wp-structuring-markup-admin-post', plugins_url( 'css/schema-custom-post.css', __FILE__ ), array(), $this->version );
|
138 |
-
}
|
139 |
-
|
140 |
-
/**
|
141 |
-
* Add Menu to the Admin Screen.
|
142 |
-
*
|
143 |
-
* @version 4.5.0
|
144 |
-
* @since 1.0.0
|
145 |
-
*/
|
146 |
-
public function admin_menu () {
|
147 |
-
add_menu_page(
|
148 |
-
esc_html__( 'Schema.org Settings', $this->text_domain ),
|
149 |
-
esc_html__( 'Schema.org Settings', $this->text_domain ),
|
150 |
-
'manage_options',
|
151 |
-
plugin_basename( __FILE__ ),
|
152 |
-
array( $this, 'list_page_render' )
|
153 |
-
);
|
154 |
-
$list_page = add_submenu_page(
|
155 |
-
__FILE__,
|
156 |
-
esc_html__( 'Schema.org List', $this->text_domain ),
|
157 |
-
esc_html__( 'Schema.org List', $this->text_domain ),
|
158 |
-
'manage_options',
|
159 |
-
plugin_basename( __FILE__ ),
|
160 |
-
array( $this, 'list_page_render' )
|
161 |
-
);
|
162 |
-
$post_page = add_submenu_page(
|
163 |
-
$this->text_domain . '-post',
|
164 |
-
esc_html__( 'Schema.org Setting Edit', $this->text_domain ),
|
165 |
-
esc_html__( 'Edit', $this->text_domain ),
|
166 |
-
'manage_options',
|
167 |
-
$this->text_domain . '-post',
|
168 |
-
array( $this, 'post_page_render' )
|
169 |
-
);
|
170 |
-
$config_page = add_submenu_page(
|
171 |
-
__FILE__,
|
172 |
-
esc_html__( 'Schema.org Config', $this->text_domain ),
|
173 |
-
esc_html__( 'Schema.org Config', $this->text_domain ),
|
174 |
-
'manage_options',
|
175 |
-
$this->text_domain . '-config',
|
176 |
-
array( $this, 'config_page_render' )
|
177 |
-
);
|
178 |
-
|
179 |
-
/** Using registered $page handle to hook stylesheet loading */
|
180 |
-
add_action( 'admin_print_styles-post.php', array( $this, 'add_style_post' ) );
|
181 |
-
add_action( 'admin_print_styles-' . $list_page, array( $this, 'add_style' ) );
|
182 |
-
add_action( 'admin_print_styles-' . $post_page, array( $this, 'add_style' ) );
|
183 |
-
add_action( 'admin_print_styles-' . $config_page, array( $this, 'add_style' ) );
|
184 |
-
add_action( 'admin_print_scripts-' . $post_page, array( $this, 'admin_scripts' ) );
|
185 |
-
}
|
186 |
-
|
187 |
-
/**
|
188 |
-
* Add Menu to the Admin Screen.
|
189 |
-
*
|
190 |
-
* @version 4.1.1
|
191 |
-
* @since 4.1.1
|
192 |
-
* @param array $links
|
193 |
-
* @return array $links
|
194 |
-
*/
|
195 |
-
public function plugin_action_links( $links ) {
|
196 |
-
$url = admin_url( 'admin.php?page=' . $this->text_domain . '/' . $this->text_domain . '.php' );
|
197 |
-
$url = '<a href="' . esc_url( $url ) . '">' . __( 'Settings' ) . '</a>';
|
198 |
-
array_unshift( $links, $url );
|
199 |
-
return $links;
|
200 |
-
}
|
201 |
-
|
202 |
-
/**
|
203 |
-
* CSS admin add. (Custom Post)
|
204 |
-
*
|
205 |
-
* @version 4.1.1
|
206 |
-
* @since 4.1.1
|
207 |
-
*/
|
208 |
-
public function add_style_post () {
|
209 |
-
wp_enqueue_style( 'wp-structuring-markup-admin-post' );
|
210 |
-
}
|
211 |
-
|
212 |
-
/**
|
213 |
-
* CSS admin add.
|
214 |
-
*
|
215 |
-
* @version 1.3.1
|
216 |
-
* @since 1.3.1
|
217 |
-
*/
|
218 |
-
public function add_style () {
|
219 |
-
wp_enqueue_style( 'wp-structuring-markup-admin-style' );
|
220 |
-
}
|
221 |
-
|
222 |
-
/**
|
223 |
-
* admin_scripts
|
224 |
-
*
|
225 |
-
* @author Justin Frydman
|
226 |
-
* @author Kazuya Takami
|
227 |
-
* @version 3.2.2
|
228 |
-
* @since 2.4.0
|
229 |
-
*/
|
230 |
-
public function admin_scripts () {
|
231 |
-
if ( isset( $_GET["type"] ) && $_GET["type"] === 'local_business' ) {
|
232 |
-
wp_enqueue_script ( 'wp-structuring-markup-admin-main-js', plugins_url ( 'js/main.min.js', __FILE__ ), array( 'jquery' ), $this->version );
|
233 |
-
}
|
234 |
-
if ( isset( $_GET["type"] ) ) {
|
235 |
-
switch ( $_GET["type"] ) {
|
236 |
-
case "article":
|
237 |
-
case "blog_posting":
|
238 |
-
case "news_article":
|
239 |
-
case "organization":
|
240 |
-
wp_enqueue_script ( 'wp-structuring-markup-admin-media-js', plugins_url ( 'js/media-uploader-main.js', __FILE__ ), array( 'jquery' ), $this->version );
|
241 |
-
wp_enqueue_media();
|
242 |
-
break;
|
243 |
-
}
|
244 |
-
}
|
245 |
-
}
|
246 |
-
|
247 |
-
/**
|
248 |
-
* LIST Page Template Require.
|
249 |
-
*
|
250 |
-
* @version 4.0.0
|
251 |
-
* @since 1.0.0
|
252 |
-
*/
|
253 |
-
public function list_page_render () {
|
254 |
-
require_once( plugin_dir_path( __FILE__ ) . 'includes/admin/wp-structuring-admin-list.php' );
|
255 |
-
new Structuring_Markup_Admin_List( $this->text_domain );
|
256 |
-
}
|
257 |
-
|
258 |
-
/**
|
259 |
-
* POST Page Template Require.
|
260 |
-
*
|
261 |
-
* @version 4.0.0
|
262 |
-
* @since 1.0.0
|
263 |
-
*/
|
264 |
-
public function post_page_render () {
|
265 |
-
require_once( plugin_dir_path( __FILE__ ) . 'includes/admin/wp-structuring-admin-post.php' );
|
266 |
-
new Structuring_Markup_Admin_Post( $this->text_domain );
|
267 |
-
}
|
268 |
-
|
269 |
-
/**
|
270 |
-
* POST Page Template Require.
|
271 |
-
*
|
272 |
-
* @version 4.5.0
|
273 |
-
* @since 1.0.0
|
274 |
-
*/
|
275 |
-
public function config_page_render () {
|
276 |
-
require_once( plugin_dir_path( __FILE__ ) . 'includes/admin/wp-structuring-admin-config.php' );
|
277 |
-
new Structuring_Markup_Admin_Config( $this->text_domain );
|
278 |
-
}
|
279 |
-
|
280 |
-
/**
|
281 |
-
* Display Page Template Require.
|
282 |
-
*
|
283 |
-
* @version 4.5.0
|
284 |
-
* @since 1.3.0
|
285 |
-
*/
|
286 |
-
public function wp_head () {
|
287 |
-
require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-display.php' );
|
288 |
-
new Structuring_Markup_Display( $this->version, $this->text_domain );
|
289 |
-
}
|
290 |
-
|
291 |
-
/**
|
292 |
-
* Display Page Template Require.
|
293 |
-
*
|
294 |
-
* @version 4.0.0
|
295 |
-
* @since 4.0.0
|
296 |
-
* @param array $metadata
|
297 |
-
* @return array $metadata
|
298 |
-
*/
|
299 |
-
public function amp_post_template_metadata ( array $metadata ) {
|
300 |
-
require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-display-amp.php' );
|
301 |
-
$amp = new Structuring_Markup_Display_Amp();
|
302 |
-
|
303 |
-
if ( !empty( $amp->json_ld ) ) {
|
304 |
-
$metadata = $amp->json_ld;
|
305 |
-
}
|
306 |
-
return (array) $metadata;
|
307 |
-
}
|
308 |
}
|
1 |
+
<?php
|
2 |
+
/*
|
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.6.2
|
7 |
+
Author: Kazuya Takami
|
8 |
+
Author URI: https://www.terakoya.work/
|
9 |
+
License: GPLv2 or later
|
10 |
+
Text Domain: wp-structuring-markup
|
11 |
+
Domain Path: /languages
|
12 |
+
*/
|
13 |
+
require_once( plugin_dir_path( __FILE__ ) . 'includes/admin/wp-structuring-admin-db.php' );
|
14 |
+
|
15 |
+
new Structuring_Markup();
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Schema.org Basic Class
|
19 |
+
*
|
20 |
+
* @author Kazuya Takami
|
21 |
+
* @version 4.6.2
|
22 |
+
* @since 1.0.0
|
23 |
+
*/
|
24 |
+
class Structuring_Markup {
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Variable definition version.
|
28 |
+
*
|
29 |
+
* @version 4.6.2
|
30 |
+
* @since 1.3.0
|
31 |
+
*/
|
32 |
+
private $version = '4.6.2';
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Variable definition Text Domain.
|
36 |
+
*
|
37 |
+
* @version 3.2.5
|
38 |
+
* @since 1.3.0
|
39 |
+
*/
|
40 |
+
private $text_domain = 'wp-structuring-markup';
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Constructor Define.
|
44 |
+
*
|
45 |
+
* @version 4.1.1
|
46 |
+
* @since 1.0.0
|
47 |
+
*/
|
48 |
+
public function __construct() {
|
49 |
+
register_activation_hook( __FILE__, array( $this, 'create_table' ) );
|
50 |
+
|
51 |
+
add_shortcode( $this->text_domain . '-breadcrumb', array( $this, 'short_code_init_breadcrumb' ) );
|
52 |
+
|
53 |
+
add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) );
|
54 |
+
add_action( 'init', array( $this, 'create_post_type' ) );
|
55 |
+
|
56 |
+
if ( is_admin() ) {
|
57 |
+
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
58 |
+
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
59 |
+
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'plugin_action_links' ) );
|
60 |
+
} else {
|
61 |
+
add_action( 'wp_head', array( $this, 'wp_head' ) );
|
62 |
+
add_filter( 'amp_post_template_metadata', array( $this, 'amp_post_template_metadata' ), 9 );
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Create table.
|
68 |
+
*
|
69 |
+
* @version 2.0.0
|
70 |
+
* @since 2.0.0
|
71 |
+
*/
|
72 |
+
public function create_table() {
|
73 |
+
$db = new Structuring_Markup_Admin_Db();
|
74 |
+
$db->create_table( $this->text_domain, $this->version );
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Breadcrumb ShortCode Register.
|
79 |
+
*
|
80 |
+
* @version 2.3.1
|
81 |
+
* @since 2.0.0
|
82 |
+
* @param string $args short code params
|
83 |
+
* @return string $html
|
84 |
+
*/
|
85 |
+
public function short_code_init_breadcrumb ( $args ) {
|
86 |
+
$db = new Structuring_Markup_Admin_Db();
|
87 |
+
$results = $db->get_type_options( 'breadcrumb' );
|
88 |
+
|
89 |
+
if ( isset( $results['option'] ) ) {
|
90 |
+
$options = $results['option'];
|
91 |
+
|
92 |
+
require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-short-code-breadcrumb.php');
|
93 |
+
$obj = new Structuring_Markup_ShortCode_Breadcrumb();
|
94 |
+
return $obj->short_code_display( $options, $args );
|
95 |
+
} else {
|
96 |
+
return __return_false();
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* i18n.
|
102 |
+
*
|
103 |
+
* @version 1.3.0
|
104 |
+
* @since 1.3.0
|
105 |
+
*/
|
106 |
+
public function plugins_loaded () {
|
107 |
+
load_plugin_textdomain( $this->text_domain, __return_false(), dirname( plugin_basename( __FILE__ ) ) . '/languages' );
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Create custom post type.
|
112 |
+
*
|
113 |
+
* @version 4.0.0
|
114 |
+
* @since 2.1.0
|
115 |
+
*/
|
116 |
+
function create_post_type () {
|
117 |
+
require_once( plugin_dir_path( __FILE__ ) . 'includes/custom/wp-structuring-custom-post-event.php' );
|
118 |
+
new Structuring_Markup_Custom_Post_Event( $this->text_domain );
|
119 |
+
require_once( plugin_dir_path( __FILE__ ) . 'includes/custom/wp-structuring-custom-post-video.php' );
|
120 |
+
new Structuring_Markup_Custom_Post_Video( $this->text_domain );
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* admin init.
|
125 |
+
*
|
126 |
+
* @version 4.1.1
|
127 |
+
* @since 1.3.1
|
128 |
+
*/
|
129 |
+
public function admin_init () {
|
130 |
+
/** version up check */
|
131 |
+
$options = get_option( $this->text_domain );
|
132 |
+
if ( !isset( $options['version'] ) || $options['version'] !== $this->version ) {
|
133 |
+
$this->create_table();
|
134 |
+
}
|
135 |
+
|
136 |
+
wp_register_style( 'wp-structuring-markup-admin-style', plugins_url( 'css/style.css', __FILE__ ), array(), $this->version );
|
137 |
+
wp_register_style( 'wp-structuring-markup-admin-post', plugins_url( 'css/schema-custom-post.css', __FILE__ ), array(), $this->version );
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Add Menu to the Admin Screen.
|
142 |
+
*
|
143 |
+
* @version 4.5.0
|
144 |
+
* @since 1.0.0
|
145 |
+
*/
|
146 |
+
public function admin_menu () {
|
147 |
+
add_menu_page(
|
148 |
+
esc_html__( 'Schema.org Settings', $this->text_domain ),
|
149 |
+
esc_html__( 'Schema.org Settings', $this->text_domain ),
|
150 |
+
'manage_options',
|
151 |
+
plugin_basename( __FILE__ ),
|
152 |
+
array( $this, 'list_page_render' )
|
153 |
+
);
|
154 |
+
$list_page = add_submenu_page(
|
155 |
+
__FILE__,
|
156 |
+
esc_html__( 'Schema.org List', $this->text_domain ),
|
157 |
+
esc_html__( 'Schema.org List', $this->text_domain ),
|
158 |
+
'manage_options',
|
159 |
+
plugin_basename( __FILE__ ),
|
160 |
+
array( $this, 'list_page_render' )
|
161 |
+
);
|
162 |
+
$post_page = add_submenu_page(
|
163 |
+
$this->text_domain . '-post',
|
164 |
+
esc_html__( 'Schema.org Setting Edit', $this->text_domain ),
|
165 |
+
esc_html__( 'Edit', $this->text_domain ),
|
166 |
+
'manage_options',
|
167 |
+
$this->text_domain . '-post',
|
168 |
+
array( $this, 'post_page_render' )
|
169 |
+
);
|
170 |
+
$config_page = add_submenu_page(
|
171 |
+
__FILE__,
|
172 |
+
esc_html__( 'Schema.org Config', $this->text_domain ),
|
173 |
+
esc_html__( 'Schema.org Config', $this->text_domain ),
|
174 |
+
'manage_options',
|
175 |
+
$this->text_domain . '-config',
|
176 |
+
array( $this, 'config_page_render' )
|
177 |
+
);
|
178 |
+
|
179 |
+
/** Using registered $page handle to hook stylesheet loading */
|
180 |
+
add_action( 'admin_print_styles-post.php', array( $this, 'add_style_post' ) );
|
181 |
+
add_action( 'admin_print_styles-' . $list_page, array( $this, 'add_style' ) );
|
182 |
+
add_action( 'admin_print_styles-' . $post_page, array( $this, 'add_style' ) );
|
183 |
+
add_action( 'admin_print_styles-' . $config_page, array( $this, 'add_style' ) );
|
184 |
+
add_action( 'admin_print_scripts-' . $post_page, array( $this, 'admin_scripts' ) );
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Add Menu to the Admin Screen.
|
189 |
+
*
|
190 |
+
* @version 4.1.1
|
191 |
+
* @since 4.1.1
|
192 |
+
* @param array $links
|
193 |
+
* @return array $links
|
194 |
+
*/
|
195 |
+
public function plugin_action_links( $links ) {
|
196 |
+
$url = admin_url( 'admin.php?page=' . $this->text_domain . '/' . $this->text_domain . '.php' );
|
197 |
+
$url = '<a href="' . esc_url( $url ) . '">' . __( 'Settings' ) . '</a>';
|
198 |
+
array_unshift( $links, $url );
|
199 |
+
return $links;
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* CSS admin add. (Custom Post)
|
204 |
+
*
|
205 |
+
* @version 4.1.1
|
206 |
+
* @since 4.1.1
|
207 |
+
*/
|
208 |
+
public function add_style_post () {
|
209 |
+
wp_enqueue_style( 'wp-structuring-markup-admin-post' );
|
210 |
+
}
|
211 |
+
|
212 |
+
/**
|
213 |
+
* CSS admin add.
|
214 |
+
*
|
215 |
+
* @version 1.3.1
|
216 |
+
* @since 1.3.1
|
217 |
+
*/
|
218 |
+
public function add_style () {
|
219 |
+
wp_enqueue_style( 'wp-structuring-markup-admin-style' );
|
220 |
+
}
|
221 |
+
|
222 |
+
/**
|
223 |
+
* admin_scripts
|
224 |
+
*
|
225 |
+
* @author Justin Frydman
|
226 |
+
* @author Kazuya Takami
|
227 |
+
* @version 3.2.2
|
228 |
+
* @since 2.4.0
|
229 |
+
*/
|
230 |
+
public function admin_scripts () {
|
231 |
+
if ( isset( $_GET["type"] ) && $_GET["type"] === 'local_business' ) {
|
232 |
+
wp_enqueue_script ( 'wp-structuring-markup-admin-main-js', plugins_url ( 'js/main.min.js', __FILE__ ), array( 'jquery' ), $this->version );
|
233 |
+
}
|
234 |
+
if ( isset( $_GET["type"] ) ) {
|
235 |
+
switch ( $_GET["type"] ) {
|
236 |
+
case "article":
|
237 |
+
case "blog_posting":
|
238 |
+
case "news_article":
|
239 |
+
case "organization":
|
240 |
+
wp_enqueue_script ( 'wp-structuring-markup-admin-media-js', plugins_url ( 'js/media-uploader-main.js', __FILE__ ), array( 'jquery' ), $this->version );
|
241 |
+
wp_enqueue_media();
|
242 |
+
break;
|
243 |
+
}
|
244 |
+
}
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* LIST Page Template Require.
|
249 |
+
*
|
250 |
+
* @version 4.0.0
|
251 |
+
* @since 1.0.0
|
252 |
+
*/
|
253 |
+
public function list_page_render () {
|
254 |
+
require_once( plugin_dir_path( __FILE__ ) . 'includes/admin/wp-structuring-admin-list.php' );
|
255 |
+
new Structuring_Markup_Admin_List( $this->text_domain );
|
256 |
+
}
|
257 |
+
|
258 |
+
/**
|
259 |
+
* POST Page Template Require.
|
260 |
+
*
|
261 |
+
* @version 4.0.0
|
262 |
+
* @since 1.0.0
|
263 |
+
*/
|
264 |
+
public function post_page_render () {
|
265 |
+
require_once( plugin_dir_path( __FILE__ ) . 'includes/admin/wp-structuring-admin-post.php' );
|
266 |
+
new Structuring_Markup_Admin_Post( $this->text_domain );
|
267 |
+
}
|
268 |
+
|
269 |
+
/**
|
270 |
+
* POST Page Template Require.
|
271 |
+
*
|
272 |
+
* @version 4.5.0
|
273 |
+
* @since 1.0.0
|
274 |
+
*/
|
275 |
+
public function config_page_render () {
|
276 |
+
require_once( plugin_dir_path( __FILE__ ) . 'includes/admin/wp-structuring-admin-config.php' );
|
277 |
+
new Structuring_Markup_Admin_Config( $this->text_domain );
|
278 |
+
}
|
279 |
+
|
280 |
+
/**
|
281 |
+
* Display Page Template Require.
|
282 |
+
*
|
283 |
+
* @version 4.5.0
|
284 |
+
* @since 1.3.0
|
285 |
+
*/
|
286 |
+
public function wp_head () {
|
287 |
+
require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-display.php' );
|
288 |
+
new Structuring_Markup_Display( $this->version, $this->text_domain );
|
289 |
+
}
|
290 |
+
|
291 |
+
/**
|
292 |
+
* Display Page Template Require.
|
293 |
+
*
|
294 |
+
* @version 4.0.0
|
295 |
+
* @since 4.0.0
|
296 |
+
* @param array $metadata
|
297 |
+
* @return array $metadata
|
298 |
+
*/
|
299 |
+
public function amp_post_template_metadata ( array $metadata ) {
|
300 |
+
require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-display-amp.php' );
|
301 |
+
$amp = new Structuring_Markup_Display_Amp();
|
302 |
+
|
303 |
+
if ( !empty( $amp->json_ld ) ) {
|
304 |
+
$metadata = $amp->json_ld;
|
305 |
+
}
|
306 |
+
return (array) $metadata;
|
307 |
+
}
|
308 |
}
|