Version Description
(2017-07-26) = * Added : Correct to display / hide the current page.(BreadcrumbList schema.org) * Updated : Event and Video type css update. * Fixed : Do not display when the search query is empty.
Download this release
Release Info
Developer | miiitaka |
Plugin | Markup (JSON-LD) structured in schema.org |
Version | 4.1.1 |
Comparing to | |
See all releases |
Code changes from version 4.1.0 to 4.1.1
- css/schema-custom-post.css +21 -0
- includes/admin/wp-structuring-admin-db.php +10 -3
- includes/admin/wp-structuring-admin-type-breadcrumb.php +24 -12
- includes/custom/wp-structuring-custom-post-event.php +33 -33
- includes/custom/wp-structuring-custom-post-video.php +21 -21
- includes/wp-structuring-short-code-breadcrumb.php +10 -3
- includes/wp-structuring-utility.php +3 -3
- readme.txt +7 -2
- wp-structuring-markup.php +35 -7
css/schema-custom-post.css
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/** Event & Video Style */
|
2 |
+
.schema-admin-custom-post label:before {
|
3 |
+
border-radius: 2px;
|
4 |
+
box-shadow: inset 0 -1px 0 rgba(27,31,35,0.12);
|
5 |
+
line-height: 1;
|
6 |
+
margin: 0 5px 0 0;
|
7 |
+
}
|
8 |
+
|
9 |
+
.schema-admin-required:before {
|
10 |
+
background: #efefef;
|
11 |
+
color: #a00;
|
12 |
+
content: 'required';
|
13 |
+
padding: 3px 41px 3px 5px;
|
14 |
+
}
|
15 |
+
|
16 |
+
.schema-admin-recommended:before {
|
17 |
+
background: #efefef;
|
18 |
+
color: #0073aa;
|
19 |
+
content: 'recommended';
|
20 |
+
padding: 3px 5px;
|
21 |
+
}
|
includes/admin/wp-structuring-admin-db.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Schema.org Admin DB Connection.
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
-
* @version
|
7 |
* @since 1.0.0
|
8 |
*/
|
9 |
class Structuring_Markup_Admin_Db {
|
@@ -45,7 +45,7 @@ class Structuring_Markup_Admin_Db {
|
|
45 |
/**
|
46 |
* Create Table.
|
47 |
*
|
48 |
-
* @version
|
49 |
* @since 1.0.0
|
50 |
* @param string $text_domain
|
51 |
* @param string $version
|
@@ -77,7 +77,7 @@ class Structuring_Markup_Admin_Db {
|
|
77 |
/**
|
78 |
* version up process.
|
79 |
*
|
80 |
-
* @version
|
81 |
* @since 2.0.0
|
82 |
* */
|
83 |
$options = get_option( $text_domain );
|
@@ -101,6 +101,13 @@ class Structuring_Markup_Admin_Db {
|
|
101 |
if ( $list->type === $key ) {
|
102 |
$activate = isset( $list->activate ) ? $list->activate : "";
|
103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
$args = array(
|
105 |
'type' => $key,
|
106 |
'activate' => $activate,
|
3 |
* Schema.org Admin DB Connection.
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
+
* @version 4.1.1
|
7 |
* @since 1.0.0
|
8 |
*/
|
9 |
class Structuring_Markup_Admin_Db {
|
45 |
/**
|
46 |
* Create Table.
|
47 |
*
|
48 |
+
* @version 4.1.1
|
49 |
* @since 1.0.0
|
50 |
* @param string $text_domain
|
51 |
* @param string $version
|
77 |
/**
|
78 |
* version up process.
|
79 |
*
|
80 |
+
* @version 4.1.1
|
81 |
* @since 2.0.0
|
82 |
* */
|
83 |
$options = get_option( $text_domain );
|
101 |
if ( $list->type === $key ) {
|
102 |
$activate = isset( $list->activate ) ? $list->activate : "";
|
103 |
|
104 |
+
// version up default value setting.
|
105 |
+
if ( $version >= '4.1.1' && $key === 'breadcrumb' ) {
|
106 |
+
$works = unserialize( $list->options );
|
107 |
+
$works['current_on'] = 'on';
|
108 |
+
$list->options = serialize( $works );
|
109 |
+
}
|
110 |
+
|
111 |
$args = array(
|
112 |
'type' => $key,
|
113 |
'activate' => $activate,
|
includes/admin/wp-structuring-admin-type-breadcrumb.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Schema.org Type Breadcrumb
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
-
* @version
|
7 |
* @since 2.0.0
|
8 |
* @see wp-structuring-admin-db.php
|
9 |
* @link https://schema.org/BreadcrumbList
|
@@ -14,21 +14,25 @@ class Structuring_Markup_Type_Breadcrumb {
|
|
14 |
/**
|
15 |
* Constructor Define.
|
16 |
*
|
17 |
-
* @
|
|
|
18 |
* @param array $option
|
19 |
*/
|
20 |
public function __construct ( array $option ) {
|
21 |
/** Default Value Set */
|
22 |
-
|
23 |
-
|
|
|
|
|
24 |
}
|
25 |
-
|
|
|
26 |
}
|
27 |
|
28 |
/**
|
29 |
* Form Layout Render
|
30 |
*
|
31 |
-
* @version
|
32 |
* @since 2.3.3
|
33 |
* @param array $option
|
34 |
*/
|
@@ -41,12 +45,20 @@ class Structuring_Markup_Type_Breadcrumb {
|
|
41 |
$html .= ' checked="checked"';
|
42 |
}
|
43 |
$html .= '>Enabled';
|
44 |
-
$html .= '<small>
|
45 |
$html .= '</td></tr>';
|
46 |
$html .= '<tr><th><label for="home_name">Home Name :</label></th><td>';
|
47 |
$html .= '<input type="text" name="option[' . "home_name" . ']" id="home_name" class="regular-text" value="' . esc_attr( $option['home_name'] ) . '">';
|
48 |
$html .= '<small>Default : bloginfo("name")<br>* In the case of the pattern set for the static page on the front page its title is the default value.</small>';
|
49 |
$html .= '</td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
$html .= '</table>';
|
51 |
echo $html;
|
52 |
|
@@ -66,14 +78,14 @@ class Structuring_Markup_Type_Breadcrumb {
|
|
66 |
/**
|
67 |
* Return the default options array
|
68 |
*
|
69 |
-
* @version
|
70 |
* @since 2.0.0
|
71 |
-
* @param array $args
|
72 |
* @return array $args
|
73 |
*/
|
74 |
-
private function get_default_options (
|
75 |
-
$args['home_on']
|
76 |
-
$args['home_name']
|
|
|
77 |
|
78 |
return (array) $args;
|
79 |
}
|
3 |
* Schema.org Type Breadcrumb
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
+
* @version 4.1.1
|
7 |
* @since 2.0.0
|
8 |
* @see wp-structuring-admin-db.php
|
9 |
* @link https://schema.org/BreadcrumbList
|
14 |
/**
|
15 |
* Constructor Define.
|
16 |
*
|
17 |
+
* @version 4.1.1
|
18 |
+
* @since 2.0.0
|
19 |
* @param array $option
|
20 |
*/
|
21 |
public function __construct ( array $option ) {
|
22 |
/** Default Value Set */
|
23 |
+
$option_array = $this->get_default_options();
|
24 |
+
|
25 |
+
if ( !empty( $option ) ) {
|
26 |
+
$option_array = array_merge( $option_array, $option );
|
27 |
}
|
28 |
+
|
29 |
+
$this->page_render( $option_array );
|
30 |
}
|
31 |
|
32 |
/**
|
33 |
* Form Layout Render
|
34 |
*
|
35 |
+
* @version 4.1.1
|
36 |
* @since 2.3.3
|
37 |
* @param array $option
|
38 |
*/
|
45 |
$html .= ' checked="checked"';
|
46 |
}
|
47 |
$html .= '>Enabled';
|
48 |
+
$html .= '<small>Installed the HOME to breadcrumbs.</small>';
|
49 |
$html .= '</td></tr>';
|
50 |
$html .= '<tr><th><label for="home_name">Home Name :</label></th><td>';
|
51 |
$html .= '<input type="text" name="option[' . "home_name" . ']" id="home_name" class="regular-text" value="' . esc_attr( $option['home_name'] ) . '">';
|
52 |
$html .= '<small>Default : bloginfo("name")<br>* In the case of the pattern set for the static page on the front page its title is the default value.</small>';
|
53 |
$html .= '</td></tr>';
|
54 |
+
$html .= '<tr><th><label for="current_on">Display Current Page :</label></th><td>';
|
55 |
+
$html .= '<input type="checkbox" name="option[' . "current_on" . ']" id="current_on" value="on"';
|
56 |
+
if ( isset( $option['current_on'] ) && $option['current_on'] === 'on' ) {
|
57 |
+
$html .= ' checked="checked"';
|
58 |
+
}
|
59 |
+
$html .= '>Enabled';
|
60 |
+
$html .= '<small>Installed the Current Page to breadcrumbs.</small>';
|
61 |
+
$html .= '</td></tr>';
|
62 |
$html .= '</table>';
|
63 |
echo $html;
|
64 |
|
78 |
/**
|
79 |
* Return the default options array
|
80 |
*
|
81 |
+
* @version 4.1.1
|
82 |
* @since 2.0.0
|
|
|
83 |
* @return array $args
|
84 |
*/
|
85 |
+
private function get_default_options () {
|
86 |
+
$args['home_on'] = '';
|
87 |
+
$args['home_name'] = '';
|
88 |
+
$args['current_on'] = '';
|
89 |
|
90 |
return (array) $args;
|
91 |
}
|
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 4.
|
7 |
* @since 2.1.0
|
8 |
* @link https://schema.org/Event
|
9 |
* @link https://developers.google.com/search/docs/data-types/events
|
@@ -136,7 +136,7 @@ class Structuring_Markup_Custom_Post_Event {
|
|
136 |
/**
|
137 |
* Set custom fields.
|
138 |
*
|
139 |
-
* @version 4.
|
140 |
* @since 2.1.0
|
141 |
*/
|
142 |
public function set_custom_fields () {
|
@@ -151,10 +151,10 @@ class Structuring_Markup_Custom_Post_Event {
|
|
151 |
}
|
152 |
|
153 |
$html = '';
|
154 |
-
$html .= '<table>';
|
155 |
-
$html .= '<tr><td><label for="schema_event_type">';
|
156 |
$html .= esc_html__( 'Event Type', $this->text_domain );
|
157 |
-
$html .= '
|
158 |
$html .= '<select name="option[' . "schema_event_type" . ']" id="schema_event_type">';
|
159 |
foreach( $this->event_type as $value) {
|
160 |
$html .= '<option';
|
@@ -165,56 +165,56 @@ class Structuring_Markup_Custom_Post_Event {
|
|
165 |
}
|
166 |
$html .= '</select>';
|
167 |
$html .= '</td></tr>';
|
168 |
-
$html .= '<tr><td><label for="schema_event_name">';
|
169 |
$html .= esc_html__( 'Event Name', $this->text_domain );
|
170 |
-
$html .= '
|
171 |
$html .= '<input type="text" name="option[' . "schema_event_name" . ']" id="schema_event_name" class="regular-text" required value="' . esc_attr( $args['schema_event_name'] ) . '">';
|
172 |
$html .= '</td></tr>';
|
173 |
-
$html .= '<tr><td><label for="schema_event_description">';
|
174 |
$html .= esc_html__( 'Event Description', $this->text_domain );
|
175 |
-
$html .= '
|
176 |
$html .= '<textarea name="option[' . "schema_event_description" . ']" id="schema_event_description" class="large-text code" rows="3">' . esc_attr( $args['schema_event_description'] ) . '</textarea>';
|
177 |
$html .= '</td></tr>';
|
178 |
-
$html .= '<tr><td><label for="schema_event_image">';
|
179 |
$html .= esc_html__( 'Event Image', $this->text_domain );
|
180 |
-
$html .= '
|
181 |
$html .= '<input type="text" name="option[' . "schema_event_image" . ']" id="schema_event_image" class="large-text" value="' . esc_attr( $args['schema_event_image'] ) . '">';
|
182 |
$html .= '</td></tr>';
|
183 |
-
$html .= '<tr><td><label for="schema_event_date">';
|
184 |
$html .= esc_html__( 'Start Date', $this->text_domain );
|
185 |
-
$html .= '
|
186 |
$html .= '<input type="date" name="option[' . "schema_event_date" . ']" id="schema_event_date" required value="' . esc_attr( $args['schema_event_date'] ) . '">';
|
187 |
$html .= '<input type="time" name="option[' . "schema_event_time" . ']" id="schema_event_time" required value="' . esc_attr( $args['schema_event_time'] ) . '">';
|
188 |
$html .= '</td></tr>';
|
189 |
-
$html .= '<tr><td><label for="schema_event_date_end">';
|
190 |
$html .= esc_html__( 'End Date', $this->text_domain );
|
191 |
-
$html .= '
|
192 |
$html .= '<input type="date" name="option[' . "schema_event_date_end" . ']" id="schema_event_date" value="' . esc_attr( $args['schema_event_date_end'] ) . '">';
|
193 |
$html .= '<input type="time" name="option[' . "schema_event_time_end" . ']" id="schema_event_time" value="' . esc_attr( $args['schema_event_time_end'] ) . '">';
|
194 |
$html .= '</td></tr>';
|
195 |
-
$html .= '<tr><td><label for="schema_event_url">';
|
196 |
$html .= esc_html__( 'Event URL', $this->text_domain );
|
197 |
-
$html .= '
|
198 |
$html .= '<input type="text" name="option[' . "schema_event_url" . ']" id="schema_event_url" class="regular-text" required value="' . esc_attr( $args['schema_event_url'] ) . '">';
|
199 |
$html .= '</td></tr>';
|
200 |
-
$html .= '<tr><td><label for="schema_event_place_name">';
|
201 |
$html .= esc_html__( 'Place Name', $this->text_domain );
|
202 |
-
$html .= '
|
203 |
$html .= '<input type="text" name="option[' . "schema_event_place_name" . ']" id="schema_event_place_name" class="regular-text" required value="' . esc_attr( $args['schema_event_place_name'] ) . '">';
|
204 |
$html .= '</td></tr>';
|
205 |
-
$html .= '<tr><td><label for="schema_event_place_url">';
|
206 |
$html .= esc_html__( 'Place URL', $this->text_domain );
|
207 |
-
$html .= '
|
208 |
$html .= '<input type="text" name="option[' . "schema_event_place_url" . ']" id="schema_event_place_url" class="regular-text" required value="' . esc_attr( $args['schema_event_place_url'] ) . '">';
|
209 |
$html .= '</td></tr>';
|
210 |
-
$html .= '<tr><td><label for="schema_event_place_address">';
|
211 |
$html .= esc_html__( 'Place Address', $this->text_domain );
|
212 |
-
$html .= '
|
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 .= '
|
218 |
$html .= '<select name="option[' . "schema_event_offers_availability" . ']" id="schema_event_offers_availability">';
|
219 |
foreach( $this->offers_availability as $value) {
|
220 |
$html .= '<option';
|
@@ -225,26 +225,26 @@ class Structuring_Markup_Custom_Post_Event {
|
|
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 .= '
|
231 |
$html .= '<input type="number" name="option[' . "schema_event_offers_price" . ']" id="schema_event_offers_price" required value="' . esc_attr( $args['schema_event_offers_price'] ) . '">';
|
232 |
$html .= '</td></tr>';
|
233 |
-
$html .= '<tr><td><label for="schema_event_offers_currency">';
|
234 |
$html .= esc_html__( 'Currency', $this->text_domain );
|
235 |
-
$html .= '
|
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 .= '
|
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 .= '
|
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>';
|
3 |
* Schema.org Custom Post "Event"
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
+
* @version 4.1.1
|
7 |
* @since 2.1.0
|
8 |
* @link https://schema.org/Event
|
9 |
* @link https://developers.google.com/search/docs/data-types/events
|
136 |
/**
|
137 |
* Set custom fields.
|
138 |
*
|
139 |
+
* @version 4.1.1
|
140 |
* @since 2.1.0
|
141 |
*/
|
142 |
public function set_custom_fields () {
|
151 |
}
|
152 |
|
153 |
$html = '';
|
154 |
+
$html .= '<table class="schema-admin-custom-post">';
|
155 |
+
$html .= '<tr><td><label class="schema-admin-required" for="schema_event_type">';
|
156 |
$html .= esc_html__( 'Event Type', $this->text_domain );
|
157 |
+
$html .= '</label></td><td>';
|
158 |
$html .= '<select name="option[' . "schema_event_type" . ']" id="schema_event_type">';
|
159 |
foreach( $this->event_type as $value) {
|
160 |
$html .= '<option';
|
165 |
}
|
166 |
$html .= '</select>';
|
167 |
$html .= '</td></tr>';
|
168 |
+
$html .= '<tr><td><label class="schema-admin-required" for="schema_event_name">';
|
169 |
$html .= esc_html__( 'Event Name', $this->text_domain );
|
170 |
+
$html .= '</label></td><td>';
|
171 |
$html .= '<input type="text" name="option[' . "schema_event_name" . ']" id="schema_event_name" class="regular-text" required value="' . esc_attr( $args['schema_event_name'] ) . '">';
|
172 |
$html .= '</td></tr>';
|
173 |
+
$html .= '<tr><td><label class="schema-admin-recommended" for="schema_event_description">';
|
174 |
$html .= esc_html__( 'Event Description', $this->text_domain );
|
175 |
+
$html .= '</label></td><td>';
|
176 |
$html .= '<textarea name="option[' . "schema_event_description" . ']" id="schema_event_description" class="large-text code" rows="3">' . esc_attr( $args['schema_event_description'] ) . '</textarea>';
|
177 |
$html .= '</td></tr>';
|
178 |
+
$html .= '<tr><td><label class="schema-admin-recommended" for="schema_event_image">';
|
179 |
$html .= esc_html__( 'Event Image', $this->text_domain );
|
180 |
+
$html .= '</label></td><td>';
|
181 |
$html .= '<input type="text" name="option[' . "schema_event_image" . ']" id="schema_event_image" class="large-text" value="' . esc_attr( $args['schema_event_image'] ) . '">';
|
182 |
$html .= '</td></tr>';
|
183 |
+
$html .= '<tr><td><label class="schema-admin-required" for="schema_event_date">';
|
184 |
$html .= esc_html__( 'Start Date', $this->text_domain );
|
185 |
+
$html .= '</label></td><td>';
|
186 |
$html .= '<input type="date" name="option[' . "schema_event_date" . ']" id="schema_event_date" required value="' . esc_attr( $args['schema_event_date'] ) . '">';
|
187 |
$html .= '<input type="time" name="option[' . "schema_event_time" . ']" id="schema_event_time" required value="' . esc_attr( $args['schema_event_time'] ) . '">';
|
188 |
$html .= '</td></tr>';
|
189 |
+
$html .= '<tr><td><label class="schema-admin-recommended" for="schema_event_date_end">';
|
190 |
$html .= esc_html__( 'End Date', $this->text_domain );
|
191 |
+
$html .= '</label></td><td>';
|
192 |
$html .= '<input type="date" name="option[' . "schema_event_date_end" . ']" id="schema_event_date" value="' . esc_attr( $args['schema_event_date_end'] ) . '">';
|
193 |
$html .= '<input type="time" name="option[' . "schema_event_time_end" . ']" id="schema_event_time" value="' . esc_attr( $args['schema_event_time_end'] ) . '">';
|
194 |
$html .= '</td></tr>';
|
195 |
+
$html .= '<tr><td><label class="schema-admin-required" for="schema_event_url">';
|
196 |
$html .= esc_html__( 'Event URL', $this->text_domain );
|
197 |
+
$html .= '</label></td><td>';
|
198 |
$html .= '<input type="text" name="option[' . "schema_event_url" . ']" id="schema_event_url" class="regular-text" required value="' . esc_attr( $args['schema_event_url'] ) . '">';
|
199 |
$html .= '</td></tr>';
|
200 |
+
$html .= '<tr><td><label class="schema-admin-required" for="schema_event_place_name">';
|
201 |
$html .= esc_html__( 'Place Name', $this->text_domain );
|
202 |
+
$html .= '</label></td><td>';
|
203 |
$html .= '<input type="text" name="option[' . "schema_event_place_name" . ']" id="schema_event_place_name" class="regular-text" required value="' . esc_attr( $args['schema_event_place_name'] ) . '">';
|
204 |
$html .= '</td></tr>';
|
205 |
+
$html .= '<tr><td><label class="schema-admin-required" for="schema_event_place_url">';
|
206 |
$html .= esc_html__( 'Place URL', $this->text_domain );
|
207 |
+
$html .= '</label></td><td>';
|
208 |
$html .= '<input type="text" name="option[' . "schema_event_place_url" . ']" id="schema_event_place_url" class="regular-text" required value="' . esc_attr( $args['schema_event_place_url'] ) . '">';
|
209 |
$html .= '</td></tr>';
|
210 |
+
$html .= '<tr><td><label class="schema-admin-required" for="schema_event_place_address">';
|
211 |
$html .= esc_html__( 'Place Address', $this->text_domain );
|
212 |
+
$html .= '</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 class="schema-admin-required" for="schema_event_type">';
|
216 |
$html .= esc_html__( 'Availability', $this->text_domain );
|
217 |
+
$html .= '</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';
|
225 |
}
|
226 |
$html .= '</select>';
|
227 |
$html .= '</td></tr>';
|
228 |
+
$html .= '<tr><td><label class="schema-admin-required" for="schema_event_offers_price">';
|
229 |
$html .= esc_html__( 'Price', $this->text_domain );
|
230 |
+
$html .= '</label></td><td>';
|
231 |
$html .= '<input type="number" name="option[' . "schema_event_offers_price" . ']" id="schema_event_offers_price" required value="' . esc_attr( $args['schema_event_offers_price'] ) . '">';
|
232 |
$html .= '</td></tr>';
|
233 |
+
$html .= '<tr><td><label class="schema-admin-required" for="schema_event_offers_currency">';
|
234 |
$html .= esc_html__( 'Currency', $this->text_domain );
|
235 |
+
$html .= '</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 class="schema-admin-recommended" for="schema_event_offers_date">';
|
240 |
$html .= esc_html__( 'validFrom', $this->text_domain );
|
241 |
+
$html .= '</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 class="schema-admin-recommended" for="schema_event_performer_name">';
|
246 |
$html .= esc_html__( 'Event Performer', $this->text_domain );
|
247 |
+
$html .= '</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>';
|
includes/custom/wp-structuring-custom-post-video.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Schema.org Custom Post "Video"
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
-
* @version
|
7 |
* @since 3.0.0
|
8 |
* @link https://schema.org/VideoObject
|
9 |
* @link https://developers.google.com/search/docs/data-types/videos
|
@@ -96,7 +96,7 @@ class Structuring_Markup_Custom_Post_Video {
|
|
96 |
/**
|
97 |
* Set custom fields.
|
98 |
*
|
99 |
-
* @version
|
100 |
* @since 3.0.0
|
101 |
*/
|
102 |
public function set_custom_fields () {
|
@@ -111,51 +111,51 @@ class Structuring_Markup_Custom_Post_Video {
|
|
111 |
}
|
112 |
|
113 |
$html = '';
|
114 |
-
$html .= '<table>';
|
115 |
-
$html .= '<tr><td><label for="schema_video_name">';
|
116 |
$html .= esc_html__( 'Video Name', $this->text_domain );
|
117 |
-
$html .= '
|
118 |
$html .= '<input type="text" name="option[' . "schema_video_name" . ']" id="schema_video_name" class="regular-text" required value="' . esc_attr( $args['schema_video_name'] ) . '">';
|
119 |
$html .= '</td></tr>';
|
120 |
-
$html .= '<tr><td><label for="schema_video_description">';
|
121 |
$html .= esc_html__( 'Video Description', $this->text_domain );
|
122 |
-
$html .= '
|
123 |
$html .= '<textarea name="option[' . "schema_video_description" . ']" id="schema_video_description" class="large-text code" required rows="3">' . esc_attr( $args['schema_video_description'] ) . '</textarea>';
|
124 |
$html .= '</td></tr>';
|
125 |
-
$html .= '<tr><td><label for="schema_video_thumbnail_url">';
|
126 |
$html .= esc_html__( 'Thumbnail Url', $this->text_domain );
|
127 |
-
$html .= '
|
128 |
$html .= '<input type="text" name="option[' . "schema_video_thumbnail_url" . ']" id="schema_video_thumbnail_url" class="regular-text" required value="' . esc_attr( $args['schema_video_thumbnail_url'] ) . '">';
|
129 |
$html .= '</td></tr>';
|
130 |
-
$html .= '<tr><td><label for="schema_video_upload_date">';
|
131 |
$html .= esc_html__( 'Upload Date', $this->text_domain );
|
132 |
-
$html .= '
|
133 |
$html .= '<input type="date" name="option[' . "schema_video_upload_date" . ']" id="schema_video_upload_date" required value="' . esc_attr( $args['schema_video_upload_date'] ) . '">';
|
134 |
$html .= '<input type="time" name="option[' . "schema_video_upload_time" . ']" id="schema_video_upload_time" required value="' . esc_attr( $args['schema_video_upload_time'] ) . '">';
|
135 |
$html .= '</td></tr>';
|
136 |
-
$html .= '<tr><td><label for="schema_video_duration">';
|
137 |
$html .= esc_html__( 'duration', $this->text_domain );
|
138 |
-
$html .= '
|
139 |
$html .= '<input type="text" name="option[' . "schema_video_duration" . ']" id="schema_video_duration" class="regular-text" value="' . esc_attr( $args['schema_video_duration'] ) . '">';
|
140 |
$html .= '</td></tr>';
|
141 |
-
$html .= '<tr><td><label for="schema_video_content_url">';
|
142 |
$html .= esc_html__( 'contentURL', $this->text_domain );
|
143 |
-
$html .= '
|
144 |
$html .= '<input type="text" name="option[' . "schema_video_content_url" . ']" id="schema_video_content_url" class="regular-text" value="' . esc_attr( $args['schema_video_content_url'] ) . '">';
|
145 |
$html .= '</td></tr>';
|
146 |
-
$html .= '<tr><td><label for="schema_video_embed_url">';
|
147 |
$html .= esc_html__( 'embedURL', $this->text_domain );
|
148 |
-
$html .= '
|
149 |
$html .= '<input type="text" name="option[' . "schema_video_embed_url" . ']" id="schema_video_embed_url" class="regular-text" value="' . esc_attr( $args['schema_video_embed_url'] ) . '">';
|
150 |
$html .= '</td></tr>';
|
151 |
-
$html .= '<tr><td><label for="schema_video_interaction_count">';
|
152 |
$html .= esc_html__( 'interactionCount', $this->text_domain );
|
153 |
-
$html .= '
|
154 |
$html .= '<input type="text" name="option[' . "schema_video_interaction_count" . ']" id="schema_video_interaction_count" class="regular-text" value="' . esc_attr( $args['schema_video_interaction_count'] ) . '">';
|
155 |
$html .= '</td></tr>';
|
156 |
-
$html .= '<tr><td><label for="schema_video_expires_date">';
|
157 |
$html .= esc_html__( 'expires', $this->text_domain );
|
158 |
-
$html .= '
|
159 |
$html .= '<input type="date" name="option[' . "schema_video_expires_date" . ']" id="schema_video_expires_date" value="' . esc_attr( $args['schema_video_expires_date'] ) . '">';
|
160 |
$html .= '<input type="time" name="option[' . "schema_video_expires_time" . ']" id="schema_video_expires_time" value="' . esc_attr( $args['schema_video_expires_time'] ) . '">';
|
161 |
$html .= '</td></tr>';
|
3 |
* Schema.org Custom Post "Video"
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
+
* @version 4.1.1
|
7 |
* @since 3.0.0
|
8 |
* @link https://schema.org/VideoObject
|
9 |
* @link https://developers.google.com/search/docs/data-types/videos
|
96 |
/**
|
97 |
* Set custom fields.
|
98 |
*
|
99 |
+
* @version 4.1.1
|
100 |
* @since 3.0.0
|
101 |
*/
|
102 |
public function set_custom_fields () {
|
111 |
}
|
112 |
|
113 |
$html = '';
|
114 |
+
$html .= '<table class="schema-admin-custom-post">';
|
115 |
+
$html .= '<tr><td><label class="schema-admin-required" for="schema_video_name">';
|
116 |
$html .= esc_html__( 'Video Name', $this->text_domain );
|
117 |
+
$html .= '</label></td><td>';
|
118 |
$html .= '<input type="text" name="option[' . "schema_video_name" . ']" id="schema_video_name" class="regular-text" required value="' . esc_attr( $args['schema_video_name'] ) . '">';
|
119 |
$html .= '</td></tr>';
|
120 |
+
$html .= '<tr><td><label class="schema-admin-required" for="schema_video_description">';
|
121 |
$html .= esc_html__( 'Video Description', $this->text_domain );
|
122 |
+
$html .= '</label></td><td>';
|
123 |
$html .= '<textarea name="option[' . "schema_video_description" . ']" id="schema_video_description" class="large-text code" required rows="3">' . esc_attr( $args['schema_video_description'] ) . '</textarea>';
|
124 |
$html .= '</td></tr>';
|
125 |
+
$html .= '<tr><td><label class="schema-admin-required" for="schema_video_thumbnail_url">';
|
126 |
$html .= esc_html__( 'Thumbnail Url', $this->text_domain );
|
127 |
+
$html .= '</label></td><td>';
|
128 |
$html .= '<input type="text" name="option[' . "schema_video_thumbnail_url" . ']" id="schema_video_thumbnail_url" class="regular-text" required value="' . esc_attr( $args['schema_video_thumbnail_url'] ) . '">';
|
129 |
$html .= '</td></tr>';
|
130 |
+
$html .= '<tr><td><label class="schema-admin-required" for="schema_video_upload_date">';
|
131 |
$html .= esc_html__( 'Upload Date', $this->text_domain );
|
132 |
+
$html .= '</label></td><td>';
|
133 |
$html .= '<input type="date" name="option[' . "schema_video_upload_date" . ']" id="schema_video_upload_date" required value="' . esc_attr( $args['schema_video_upload_date'] ) . '">';
|
134 |
$html .= '<input type="time" name="option[' . "schema_video_upload_time" . ']" id="schema_video_upload_time" required value="' . esc_attr( $args['schema_video_upload_time'] ) . '">';
|
135 |
$html .= '</td></tr>';
|
136 |
+
$html .= '<tr><td><label class="schema-admin-recommended" for="schema_video_duration">';
|
137 |
$html .= esc_html__( 'duration', $this->text_domain );
|
138 |
+
$html .= '</label></td><td>';
|
139 |
$html .= '<input type="text" name="option[' . "schema_video_duration" . ']" id="schema_video_duration" class="regular-text" value="' . esc_attr( $args['schema_video_duration'] ) . '">';
|
140 |
$html .= '</td></tr>';
|
141 |
+
$html .= '<tr><td><label class="schema-admin-recommended" for="schema_video_content_url">';
|
142 |
$html .= esc_html__( 'contentURL', $this->text_domain );
|
143 |
+
$html .= '</label></td><td>';
|
144 |
$html .= '<input type="text" name="option[' . "schema_video_content_url" . ']" id="schema_video_content_url" class="regular-text" value="' . esc_attr( $args['schema_video_content_url'] ) . '">';
|
145 |
$html .= '</td></tr>';
|
146 |
+
$html .= '<tr><td><label class="schema-admin-recommended" for="schema_video_embed_url">';
|
147 |
$html .= esc_html__( 'embedURL', $this->text_domain );
|
148 |
+
$html .= '</label></td><td>';
|
149 |
$html .= '<input type="text" name="option[' . "schema_video_embed_url" . ']" id="schema_video_embed_url" class="regular-text" value="' . esc_attr( $args['schema_video_embed_url'] ) . '">';
|
150 |
$html .= '</td></tr>';
|
151 |
+
$html .= '<tr><td><label class="schema-admin-recommended" for="schema_video_interaction_count">';
|
152 |
$html .= esc_html__( 'interactionCount', $this->text_domain );
|
153 |
+
$html .= '</label></td><td>';
|
154 |
$html .= '<input type="text" name="option[' . "schema_video_interaction_count" . ']" id="schema_video_interaction_count" class="regular-text" value="' . esc_attr( $args['schema_video_interaction_count'] ) . '">';
|
155 |
$html .= '</td></tr>';
|
156 |
+
$html .= '<tr><td><label class="schema-admin-recommended" for="schema_video_expires_date">';
|
157 |
$html .= esc_html__( 'expires', $this->text_domain );
|
158 |
+
$html .= '</label></td><td>';
|
159 |
$html .= '<input type="date" name="option[' . "schema_video_expires_date" . ']" id="schema_video_expires_date" value="' . esc_attr( $args['schema_video_expires_date'] ) . '">';
|
160 |
$html .= '<input type="time" name="option[' . "schema_video_expires_time" . ']" id="schema_video_expires_time" value="' . esc_attr( $args['schema_video_expires_time'] ) . '">';
|
161 |
$html .= '</td></tr>';
|
includes/wp-structuring-short-code-breadcrumb.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Breadcrumb ShortCode Settings
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
-
* @version
|
7 |
* @since 2.0.0
|
8 |
*/
|
9 |
class Structuring_Markup_ShortCode_Breadcrumb {
|
@@ -62,7 +62,7 @@ class Structuring_Markup_ShortCode_Breadcrumb {
|
|
62 |
/**
|
63 |
* Breadcrumb array setting.
|
64 |
*
|
65 |
-
* @version 4.
|
66 |
* @since 2.0.0
|
67 |
* @access public
|
68 |
* @param array $options
|
@@ -95,7 +95,10 @@ class Structuring_Markup_ShortCode_Breadcrumb {
|
|
95 |
}
|
96 |
|
97 |
if ( is_search() ) {
|
98 |
-
$
|
|
|
|
|
|
|
99 |
} elseif ( is_tag() ) {
|
100 |
$item_array[] = $this->set_schema_breadcrumb_item( $current_url, single_tag_title( '', false ) );
|
101 |
} elseif ( is_date() ) {
|
@@ -173,6 +176,10 @@ class Structuring_Markup_ShortCode_Breadcrumb {
|
|
173 |
$item_array[] = $this->set_schema_breadcrumb_item( $current_url, $post->post_title );
|
174 |
}
|
175 |
|
|
|
|
|
|
|
|
|
176 |
return (array) $item_array;
|
177 |
}
|
178 |
|
3 |
* Breadcrumb ShortCode Settings
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
+
* @version 4.1.1
|
7 |
* @since 2.0.0
|
8 |
*/
|
9 |
class Structuring_Markup_ShortCode_Breadcrumb {
|
62 |
/**
|
63 |
* Breadcrumb array setting.
|
64 |
*
|
65 |
+
* @version 4.1.1
|
66 |
* @since 2.0.0
|
67 |
* @access public
|
68 |
* @param array $options
|
95 |
}
|
96 |
|
97 |
if ( is_search() ) {
|
98 |
+
$search_query = get_search_query();
|
99 |
+
if ( $search_query !== '' ) {
|
100 |
+
$item_array[] = $this->set_schema_breadcrumb_item( $current_url, get_search_query() );
|
101 |
+
}
|
102 |
} elseif ( is_tag() ) {
|
103 |
$item_array[] = $this->set_schema_breadcrumb_item( $current_url, single_tag_title( '', false ) );
|
104 |
} elseif ( is_date() ) {
|
176 |
$item_array[] = $this->set_schema_breadcrumb_item( $current_url, $post->post_title );
|
177 |
}
|
178 |
|
179 |
+
if ( !isset( $options['current_on'] ) || $options['current_on'] !== 'on' ) {
|
180 |
+
array_pop( $item_array );
|
181 |
+
}
|
182 |
+
|
183 |
return (array) $item_array;
|
184 |
}
|
185 |
|
includes/wp-structuring-utility.php
CHANGED
@@ -53,11 +53,11 @@ class Structuring_Markup_Utility {
|
|
53 |
* @return array | boolean $images
|
54 |
*/
|
55 |
public function get_content_image ( $content ) {
|
56 |
-
$pattern = '/<img.*?src
|
57 |
|
58 |
if ( preg_match( $pattern, $content, $images ) ){
|
59 |
-
if ( is_array( $images ) && isset( $images[
|
60 |
-
return $images[
|
61 |
} else {
|
62 |
return __return_false();
|
63 |
}
|
53 |
* @return array | boolean $images
|
54 |
*/
|
55 |
public function get_content_image ( $content ) {
|
56 |
+
$pattern = '/<img.*?src\s*=\s*[\"|\'](.*?)[\"|\'].*?>/i';
|
57 |
|
58 |
if ( preg_match( $pattern, $content, $images ) ){
|
59 |
+
if ( is_array( $images ) && isset( $images[1] ) ) {
|
60 |
+
return $images[1];
|
61 |
} else {
|
62 |
return __return_false();
|
63 |
}
|
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.8.0
|
6 |
-
Stable tag: 4.1.
|
7 |
|
8 |
Allows you to include schema.org JSON-LD syntax markup on your website
|
9 |
|
@@ -54,9 +54,14 @@ if ( shortcode_exists( 'wp-structuring-markup-breadcrumb' ) ) {
|
|
54 |
|
55 |
== Changelog ==
|
56 |
|
|
|
|
|
|
|
|
|
|
|
57 |
= 4.1.0 (2017-07-03) =
|
58 |
* Added : If there is no feature image setting, set the first image of the post.
|
59 |
-
* Updated :
|
60 |
* Fixed : Events and videos of custom posts should not appear in choices.
|
61 |
* Fixed : Organization type Notice Error.
|
62 |
|
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.1.1
|
7 |
|
8 |
Allows you to include schema.org JSON-LD syntax markup on your website
|
9 |
|
54 |
|
55 |
== Changelog ==
|
56 |
|
57 |
+
= 4.1.1 (2017-07-26) =
|
58 |
+
* Added : Correct to display / hide the current page.(BreadcrumbList schema.org)
|
59 |
+
* Updated : Event and Video type css update.
|
60 |
+
* Fixed : Do not display when the search query is empty.
|
61 |
+
|
62 |
= 4.1.0 (2017-07-03) =
|
63 |
* Added : If there is no feature image setting, set the first image of the post.
|
64 |
+
* Updated : Organization Image recommended.(Article / NewsArticle / BlogPosting)
|
65 |
* Fixed : Events and videos of custom posts should not appear in choices.
|
66 |
* Fixed : Organization type Notice Error.
|
67 |
|
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.1.
|
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.1.
|
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.1.
|
30 |
* @since 1.3.0
|
31 |
*/
|
32 |
-
private $version = '4.1.
|
33 |
|
34 |
/**
|
35 |
* Variable definition Text Domain.
|
@@ -42,7 +42,7 @@ class Structuring_Markup {
|
|
42 |
/**
|
43 |
* Constructor Define.
|
44 |
*
|
45 |
-
* @version 4.
|
46 |
* @since 1.0.0
|
47 |
*/
|
48 |
public function __construct() {
|
@@ -56,6 +56,7 @@ class Structuring_Markup {
|
|
56 |
if ( is_admin() ) {
|
57 |
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
58 |
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
|
|
59 |
} else {
|
60 |
add_action( 'wp_head', array( $this, 'wp_head' ) );
|
61 |
add_filter( 'amp_post_template_metadata', array( $this, 'amp_post_template_metadata' ), 9 );
|
@@ -122,7 +123,7 @@ class Structuring_Markup {
|
|
122 |
/**
|
123 |
* admin init.
|
124 |
*
|
125 |
-
* @version
|
126 |
* @since 1.3.1
|
127 |
*/
|
128 |
public function admin_init () {
|
@@ -133,12 +134,13 @@ class Structuring_Markup {
|
|
133 |
}
|
134 |
|
135 |
wp_register_style( 'wp-structuring-markup-admin-style', plugins_url( 'css/style.css', __FILE__ ), array(), $this->version );
|
|
|
136 |
}
|
137 |
|
138 |
/**
|
139 |
* Add Menu to the Admin Screen.
|
140 |
*
|
141 |
-
* @version
|
142 |
* @since 1.0.0
|
143 |
*/
|
144 |
public function admin_menu () {
|
@@ -159,11 +161,37 @@ class Structuring_Markup {
|
|
159 |
);
|
160 |
|
161 |
/** Using registered $page handle to hook stylesheet loading */
|
|
|
162 |
add_action( 'admin_print_styles-' . $list_page, array( $this, 'add_style' ) );
|
163 |
add_action( 'admin_print_styles-' . $post_page, array( $this, 'add_style' ) );
|
164 |
add_action( 'admin_print_scripts-' . $post_page, array( $this, 'admin_scripts' ) );
|
165 |
}
|
166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
/**
|
168 |
* CSS admin add.
|
169 |
*
|
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.1.1
|
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.1.1
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
class Structuring_Markup {
|
26 |
/**
|
27 |
* Variable definition version.
|
28 |
*
|
29 |
+
* @version 4.1.1
|
30 |
* @since 1.3.0
|
31 |
*/
|
32 |
+
private $version = '4.1.1';
|
33 |
|
34 |
/**
|
35 |
* Variable definition Text Domain.
|
42 |
/**
|
43 |
* Constructor Define.
|
44 |
*
|
45 |
+
* @version 4.1.1
|
46 |
* @since 1.0.0
|
47 |
*/
|
48 |
public function __construct() {
|
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 );
|
123 |
/**
|
124 |
* admin init.
|
125 |
*
|
126 |
+
* @version 4.1.1
|
127 |
* @since 1.3.1
|
128 |
*/
|
129 |
public function admin_init () {
|
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.1.1
|
144 |
* @since 1.0.0
|
145 |
*/
|
146 |
public function admin_menu () {
|
161 |
);
|
162 |
|
163 |
/** Using registered $page handle to hook stylesheet loading */
|
164 |
+
add_action( 'admin_print_styles-post.php', array( $this, 'add_style_post' ) );
|
165 |
add_action( 'admin_print_styles-' . $list_page, array( $this, 'add_style' ) );
|
166 |
add_action( 'admin_print_styles-' . $post_page, array( $this, 'add_style' ) );
|
167 |
add_action( 'admin_print_scripts-' . $post_page, array( $this, 'admin_scripts' ) );
|
168 |
}
|
169 |
|
170 |
+
/**
|
171 |
+
* Add Menu to the Admin Screen.
|
172 |
+
*
|
173 |
+
* @version 4.1.1
|
174 |
+
* @since 4.1.1
|
175 |
+
* @param array $links
|
176 |
+
* @return array $links
|
177 |
+
*/
|
178 |
+
public function plugin_action_links( $links ) {
|
179 |
+
$url = admin_url( 'admin.php?page=' . $this->text_domain . '/' . $this->text_domain . '.php' );
|
180 |
+
$url = '<a href="' . esc_url( $url ) . '">' . __( 'Settings' ) . '</a>';
|
181 |
+
array_unshift( $links, $url );
|
182 |
+
return $links;
|
183 |
+
}
|
184 |
+
|
185 |
+
/**
|
186 |
+
* CSS admin add. (Custom Post)
|
187 |
+
*
|
188 |
+
* @version 4.1.1
|
189 |
+
* @since 4.1.1
|
190 |
+
*/
|
191 |
+
public function add_style_post () {
|
192 |
+
wp_enqueue_style( 'wp-structuring-markup-admin-post' );
|
193 |
+
}
|
194 |
+
|
195 |
/**
|
196 |
* CSS admin add.
|
197 |
*
|