├── README.md ├── assets ├── banner-1554x500.jpg ├── banner-772x250.jpg ├── icon-128x128.png └── icon-256x256.png ├── css ├── schema-custom-post.css └── style.css ├── includes ├── admin │ ├── wp-structuring-admin-config.php │ ├── wp-structuring-admin-db.php │ ├── wp-structuring-admin-list.php │ ├── wp-structuring-admin-post.php │ ├── wp-structuring-admin-type-article.php │ ├── wp-structuring-admin-type-blog-posting.php │ ├── wp-structuring-admin-type-breadcrumb.php │ ├── wp-structuring-admin-type-event.php │ ├── wp-structuring-admin-type-local-business.php │ ├── wp-structuring-admin-type-news-article.php │ ├── wp-structuring-admin-type-organization.php │ ├── wp-structuring-admin-type-person.php │ ├── wp-structuring-admin-type-site-navigation.php │ ├── wp-structuring-admin-type-video.php │ └── wp-structuring-admin-type-website.php ├── custom │ ├── wp-structuring-custom-post-event.php │ └── wp-structuring-custom-post-video.php ├── meta │ ├── wp-structuring-meta-article.php │ ├── wp-structuring-meta-blog-posting.php │ ├── wp-structuring-meta-breadcrumb.php │ ├── wp-structuring-meta-event.php │ ├── wp-structuring-meta-local-business.php │ ├── wp-structuring-meta-news-article.php │ ├── wp-structuring-meta-organization.php │ ├── wp-structuring-meta-person.php │ ├── wp-structuring-meta-site-navigation.php │ ├── wp-structuring-meta-video.php │ └── wp-structuring-meta-website.php ├── wp-structuring-display-amp.php ├── wp-structuring-display.php ├── wp-structuring-opening-hours.php ├── wp-structuring-short-code-breadcrumb.php └── wp-structuring-utility.php ├── js ├── main.js ├── main.min.js └── media-uploader-main.js ├── languages ├── wp-structuring-markup-ja.mo ├── wp-structuring-markup-ja.po ├── wp-structuring-markup-tr_TR.mo ├── wp-structuring-markup-tr_TR.po └── wp-structuring-markup.pot ├── materials └── ImageDesign.psd ├── readme.txt ├── uninstall.php └── wp-structuring-markup.php /assets/banner-1554x500.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miiitaka/wp-structuring-markup/bc651600de3d81a749805ad5bc0450a6bbbad0c2/assets/banner-1554x500.jpg -------------------------------------------------------------------------------- /assets/banner-772x250.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miiitaka/wp-structuring-markup/bc651600de3d81a749805ad5bc0450a6bbbad0c2/assets/banner-772x250.jpg -------------------------------------------------------------------------------- /assets/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miiitaka/wp-structuring-markup/bc651600de3d81a749805ad5bc0450a6bbbad0c2/assets/icon-128x128.png -------------------------------------------------------------------------------- /assets/icon-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miiitaka/wp-structuring-markup/bc651600de3d81a749805ad5bc0450a6bbbad0c2/assets/icon-256x256.png -------------------------------------------------------------------------------- /css/schema-custom-post.css: -------------------------------------------------------------------------------- 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 | } -------------------------------------------------------------------------------- /css/style.css: -------------------------------------------------------------------------------- 1 | /** List Setting */ 2 | .schema-admin-table-list { 3 | border-collapse: collapse; 4 | } 5 | .schema-admin-table-list .schema-admin-table-list-type { 6 | width: 15%; 7 | } 8 | 9 | .schema-admin-table-list .schema-admin-table-list-output { 10 | width: 30%; 11 | } 12 | 13 | .schema-admin-table-list tr { 14 | border-bottom: solid 1px #ddd; 15 | } 16 | 17 | .schema-admin-table-list tr:last-child { 18 | border-bottom: none; 19 | } 20 | 21 | .schema-admin-table-list td { 22 | vertical-align: middle; 23 | } 24 | 25 | .schema-admin-table-list td:nth-child(1) > span { 26 | float: left; 27 | height: 2em; 28 | } 29 | 30 | .schema-admin-table-list td:nth-child(1) > span span { 31 | display: inline-block; 32 | margin: 0 10px 0 0; 33 | padding: 0 1em 0 1em; 34 | text-align: center; 35 | width: 8em; 36 | } 37 | 38 | .schema-admin-table-list td:nth-child(1) > span span.active { 39 | background: #00a0d2; 40 | color: #fff; 41 | } 42 | 43 | .schema-admin-table-list tr.active { 44 | background: #ffffff; 45 | } 46 | 47 | .schema-admin-table-list tr.stop { 48 | background: #efefef; 49 | } 50 | 51 | .schema-admin-table-list td:nth-child(1) > span span.stop { 52 | background: #ddd; 53 | } 54 | 55 | /** Posts page */ 56 | .schema-admin-h1-span { 57 | display: inline-block; 58 | font-size: 80%; 59 | margin: 0 0 0 10px; 60 | } 61 | 62 | .schema-admin-require::before { 63 | color: #a00; 64 | content: "*"; 65 | margin: 0 3px 0 0; 66 | } 67 | 68 | .schema-admin-table { 69 | margin: 15px 0 15px 0; 70 | } 71 | 72 | .schema-admin-table caption { 73 | border-left: solid 4px #00a0d2; 74 | margin: 0 0 5px 0; 75 | padding: 3px 0 3px 7px; 76 | text-align: left; 77 | } 78 | 79 | .schema-admin-table th { 80 | height: 2em; 81 | padding: 0 5px 0 0; 82 | text-align: right; 83 | vertical-align: middle; 84 | width: 200px; 85 | } 86 | 87 | .schema-admin-table th.require::before { 88 | color: #a00; 89 | content: "*"; 90 | margin: 0 3px 0 0; 91 | } 92 | 93 | .schema-admin-table td { 94 | vertical-align: middle; 95 | } 96 | 97 | .schema-admin-table td label { 98 | margin: 0 10px 0 0; 99 | } 100 | 101 | .schema-admin-table small { 102 | display: block; 103 | margin: 2px 0 2px 1px; 104 | background: #ddd; 105 | padding: 0 5px; 106 | } 107 | 108 | .schema-admin-table input[type="checkbox"] { 109 | margin: 0 5px 0 0; 110 | } 111 | 112 | .schema-admin-table input:invalid { 113 | border: solid 1px #d8000c; 114 | background: #ffbaba; 115 | } 116 | 117 | /** LocalBusiness */ 118 | .markup-time { 119 | color: #999; 120 | cursor: pointer; 121 | width: 18px; 122 | height: 18px; 123 | line-height: 20px; 124 | font-size: 14px; 125 | border: solid 1px #bbb; 126 | background-color: #fff; 127 | border-radius: 100%; 128 | margin-top: 5px; 129 | } 130 | 131 | .markup-time:hover { 132 | color: #fff; 133 | border-color: transparent; 134 | } 135 | 136 | .markup-time .plus:hover { 137 | background-color: #00a0d2; 138 | } 139 | 140 | .markup-time .minus { 141 | line-height: 18px; 142 | } 143 | 144 | .markup-time .minus:hover { 145 | background-color: #f55e4f; 146 | } 147 | 148 | /** Media Uploader */ 149 | .schema-admin-media-button { 150 | border: 0; 151 | font-size: 12px; 152 | padding: 6px 8px 2px 8px; 153 | } 154 | 155 | .schema-admin-media-button:before { 156 | font-size: 16px; 157 | height: 16px; 158 | width: 16px; 159 | } 160 | 161 | .schema-admin-media-button:hover { 162 | cursor: pointer; 163 | } -------------------------------------------------------------------------------- /includes/admin/wp-structuring-admin-config.php: -------------------------------------------------------------------------------- 1 | text_domain = $text_domain; 37 | $this->nonce_name = "_wpnonce_" . $text_domain; 38 | $this->nonce_action = "config-" . $text_domain; 39 | 40 | /** 41 | * Update Status 42 | * 43 | * "ok" : Successful update 44 | * "output" : Output No Check 45 | */ 46 | $status = ""; 47 | 48 | /** DataBase Update & Insert Mode */ 49 | if ( ! empty( $_POST ) && check_admin_referer( $this->nonce_action, $this->nonce_name ) ) { 50 | $db = new Structuring_Markup_Admin_Db(); 51 | if ( $db->update_config( $_POST, $this->text_domain ) ) { 52 | $status = "ok"; 53 | } else { 54 | $status = "error"; 55 | } 56 | } 57 | $options = get_option( $text_domain ); 58 | if ( !$options ) { 59 | $options = array(); 60 | } 61 | 62 | $this->page_render( $options, $status ); 63 | } 64 | 65 | /** 66 | * Setting Page of the Admin Screen. 67 | * 68 | * @version 4.5.0 69 | * @since 4.5.0 70 | * @param array $options 71 | * @param string $status 72 | */ 73 | private function page_render ( array $options, $status ) { 74 | $html = ''; 75 | $html .= '
'; 76 | $html .= '

' . esc_html__( 'Schema.org Config', $this->text_domain ) . '

'; 77 | switch ( $status ) { 78 | case "ok": 79 | $html .= $this->information_render(); 80 | break; 81 | case "error": 82 | $html .= $this->error_render(); 83 | break; 84 | default: 85 | break; 86 | } 87 | echo $html; 88 | 89 | /** Output Page Select */ 90 | $html = '
'; 91 | $html .= '
'; 92 | echo $html; 93 | 94 | wp_nonce_field( $this->nonce_action, $this->nonce_name ); 95 | 96 | $html = ''; 97 | 98 | $html .= ''; 99 | $html .= ''; 102 | 103 | $html .= ''; 104 | $html .= ''; 107 | 108 | $html .= '
' . esc_html__( 'Plug-in version' ) . ' : '; 100 | $html .= isset( $options['version'] ) ? esc_html( $options['version'] ) : ''; 101 | $html .= '
'; 109 | 110 | echo $html; 111 | 112 | submit_button(); 113 | 114 | $html = '
'; 115 | $html .= '
'; 116 | echo $html; 117 | } 118 | 119 | /** 120 | * Information Message Render 121 | * 122 | * @version 4.5.0 123 | * @since 4.5.0 124 | * @return string $html 125 | */ 126 | private function information_render () { 127 | $html = '
'; 128 | $html .= '

Schema.org Config Update.

'; 129 | $html .= ''; 132 | $html .= '
'; 133 | 134 | return (string) $html; 135 | } 136 | 137 | /** 138 | * Error Message Render 139 | * 140 | * @version 4.5.0 141 | * @since 4.5.0 142 | * @return string $html 143 | */ 144 | private function error_render () { 145 | $html = '
'; 146 | $html .= '

Update Error.

'; 147 | $html .= ''; 150 | $html .= '
'; 151 | 152 | return (string) $html; 153 | } 154 | } -------------------------------------------------------------------------------- /includes/admin/wp-structuring-admin-db.php: -------------------------------------------------------------------------------- 1 | "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 | } -------------------------------------------------------------------------------- /includes/admin/wp-structuring-admin-list.php: -------------------------------------------------------------------------------- 1 | text_domain = $text_domain; 29 | $this->page_render(); 30 | } 31 | 32 | /** 33 | * LIST Page HTML Render. 34 | * 35 | * @version 4.1.4 36 | * @since 1.0.0 37 | */ 38 | private function page_render () { 39 | $post_url = 'admin.php?page=' . $this->text_domain . '-post'; 40 | 41 | $html = ''; 42 | $html .= '
'; 43 | $html .= '

' . esc_html__( 'Schema.org Settings List', $this->text_domain ); 44 | $html .= '

'; 45 | echo $html; 46 | 47 | $html = '
'; 48 | $html .= ''; 49 | $html .= ''; 50 | $html .= ''; 51 | $html .= ''; 52 | $html .= ''; 53 | echo $html; 54 | 55 | $db = new Structuring_Markup_Admin_Db(); 56 | $results = $db->get_list_options(); 57 | $type_array = $db->type_array; 58 | 59 | if ( $results ) { 60 | foreach ( $results as $row ) { 61 | if ( $row->activate === 'on' ) { 62 | $html = ''; 75 | $html .= ''; 76 | $html .= ''; 77 | echo $html; 78 | } 79 | } else { 80 | echo ''; 81 | } 82 | $html = '
' . esc_html__( 'Status', $this->text_domain ) . '  /  ' . esc_html__( 'Schema.org Type', $this->text_domain ) . '' . esc_html__( 'Output On', $this->text_domain ) . '
Enabled'; 63 | } else { 64 | $html = '
Disabled'; 65 | } 66 | $html .= ''; 67 | $html .= '' . $type_array[esc_html( $row->type )]; 69 | $html .= ''; 70 | $html .= ''; 73 | $html .= ''; 74 | $html .= '' . $this->unserialize_output( $row->output ) . '
' . esc_html__( 'Without registration.', $this->text_domain ) . '
'; 83 | $html .= '
'; 84 | echo $html; 85 | } 86 | 87 | /** 88 | * LIST Page HTML Render. 89 | * 90 | * @version 2.0.0 91 | * @since 1.0.0 92 | * @param string $obj 93 | * @return string $output 94 | */ 95 | private function unserialize_output ( $obj ) { 96 | $output = implode( ",", unserialize( $obj ) ); 97 | return (string) $output; 98 | } 99 | } -------------------------------------------------------------------------------- /includes/admin/wp-structuring-admin-type-article.php: -------------------------------------------------------------------------------- 1 | get_default_options(); 26 | 27 | if ( !empty( $option ) ) { 28 | $option_array = array_merge( $option_array, $option ); 29 | } 30 | 31 | $this->page_render( $option_array ); 32 | } 33 | 34 | /** 35 | * Form Layout Render 36 | * 37 | * @version 4.8.1 38 | * @since 1.1.0 39 | * @param array $option 40 | */ 41 | private function page_render ( array $option ) { 42 | $html = ''; 43 | $html .= ''; 44 | $html .= ''; 45 | $html .= ''; 46 | $html .= ''; 47 | $html .= ''; 48 | $html .= '
Basic Setting
headline :Default : post_title
datePublished :Default : get_the_time( DATE_ISO8601, ID )
dateModified :Default : get_the_modified_time( DATE_ISO8601, false, ID )
description :Default : post_excerpt
'; 49 | echo $html; 50 | 51 | $html = ''; 52 | $html .= ''; 53 | $html .= ''; 54 | $html .= ''; 55 | $html .= '
mainEntityOfPage
@type :"WebPage"
@id :Default : get_permalink( ID )
'; 56 | echo $html; 57 | 58 | $html = ''; 59 | $html .= ''; 60 | $html .= ''; 61 | $html .= ''; 62 | $html .= ''; 63 | $html .= ''; 64 | $html .= ''; 76 | $html .= '
image
@type :"ImageObject"
url :Default : Featured Image
height :Auto : The height of the image, in pixels.
width :Auto : The width of the image, in pixels. Images should be at least 696 pixels wide.
'; 65 | $html .= ''; 73 | $html .= '
'; 74 | $html .= 'Image output when feature image or content image check is not set.'; 75 | $html .= '
'; 77 | echo $html; 78 | 79 | $html = ''; 80 | $html .= ''; 81 | $html .= ''; 82 | $html .= ''; 84 | $html .= '
author
@type :"Person"
name :Default : get_the_author_meta( "display_name", author )'; 83 | $html .= '
'; 85 | echo $html; 86 | 87 | $html = ''; 88 | $html .= ''; 89 | $html .= ''; 90 | $html .= ''; 93 | $html .= '
publisher
@type :"Organization"
'; 91 | $html .= ''; 92 | $html .= '
'; 94 | echo $html; 95 | 96 | $html = ''; 97 | $html .= ''; 98 | $html .= ''; 99 | $html .= ''; 103 | $html .= ''; 106 | $html .= ''; 109 | $html .= '
publisher.logo
@type :"ImageObject"
'; 100 | $html .= ''; 101 | $html .= ''; 102 | $html .= '
'; 104 | $html .= 'px'; 105 | $html .= '
'; 107 | $html .= 'px'; 108 | $html .= '
'; 110 | echo $html; 111 | 112 | $html = ''; 113 | $html .= ''; 114 | $html .= ''; 135 | $html .= ''; 138 | $html .= ''; 141 | $html .= '
Speakable
'; 115 | $html .= ''; 133 | $html .= ''; 134 | $html .= '
'; 136 | $html .= ''; 137 | $html .= '
'; 139 | $html .= ''; 140 | $html .= '
'; 142 | echo $html; 143 | 144 | $html = ''; 145 | $html .= ''; 146 | $html .= ''; 147 | $html .= ''; 148 | $html .= ''; 149 | $html .= ''; 150 | $html .= ''; 151 | $html .= ''; 152 | $html .= ''; 153 | $html .= ''; 154 | $html .= '
Setting Knowledge
schema.org Article :https://schema.org/Article
pending.schema.org Speakable :https://pending.schema.org/speakable
Google Search Article :https://developers.google.com/search/docs/data-types/articles
Google Search Speakable (BETA) :https://developers.google.com/search/docs/data-types/speakable
'; 155 | echo $html; 156 | 157 | submit_button(); 158 | } 159 | 160 | /** 161 | * Return the default options array 162 | * 163 | * @since 4.5.0 164 | * @version 2.2.0 165 | * @return array $args 166 | */ 167 | private function get_default_options () { 168 | $args['name'] = ''; 169 | $args['content_image'] = ''; 170 | $args['default_image'] = ''; 171 | $args['logo'] = ''; 172 | $args['logo-height'] = 0; 173 | $args['logo-width'] = 0; 174 | $args['speakable_action'] = ''; 175 | $args['speakable_type'] = ''; 176 | $args['speakable_headline'] = ''; 177 | $args['speakable_summary'] = ''; 178 | 179 | return (array) $args; 180 | } 181 | } -------------------------------------------------------------------------------- /includes/admin/wp-structuring-admin-type-blog-posting.php: -------------------------------------------------------------------------------- 1 | get_default_options(); 26 | 27 | if ( !empty( $option ) ) { 28 | $option_array = array_merge( $option_array, $option ); 29 | } 30 | 31 | $this->page_render( $option_array ); 32 | } 33 | 34 | /** 35 | * Form Layout Render 36 | * 37 | * @version 4.8.1 38 | * @since 1.2.0 39 | * @param array $option 40 | */ 41 | private function page_render ( array $option ) { 42 | $html = ''; 43 | $html .= ''; 44 | $html .= ''; 45 | $html .= ''; 46 | $html .= ''; 47 | $html .= ''; 48 | $html .= '
Basic Setting
headline :Default : post_title
datePublished :Default : get_the_time( DATE_ISO8601, ID )
dateModified :Default : get_the_modified_time( DATE_ISO8601, false, ID )
description :Default : post_excerpt
'; 49 | echo $html; 50 | 51 | $html = ''; 52 | $html .= ''; 53 | $html .= ''; 54 | $html .= ''; 55 | $html .= '
mainEntityOfPage
@type :"WebPage"
@id :Default : get_permalink( ID )
'; 56 | echo $html; 57 | 58 | $html = ''; 59 | $html .= ''; 60 | $html .= ''; 61 | $html .= ''; 62 | $html .= ''; 63 | $html .= ''; 64 | $html .= ''; 76 | $html .= '
image
@type :"ImageObject"
url :Default : Featured Image
height :Auto : The height of the image, in pixels.
width :Auto : The width of the image, in pixels. Images should be at least 696 pixels wide.
'; 65 | $html .= ''; 73 | $html .= '
'; 74 | $html .= 'Image output when feature image or content image check is not set.'; 75 | $html .= '
'; 77 | echo $html; 78 | 79 | $html = ''; 80 | $html .= ''; 81 | $html .= ''; 82 | $html .= ''; 84 | $html .= '
author
@type :"Person"
name :Default : get_the_author_meta( "display_name", author )'; 83 | $html .= '
'; 85 | echo $html; 86 | 87 | $html = ''; 88 | $html .= ''; 89 | $html .= ''; 90 | $html .= ''; 93 | $html .= '
publisher
@type :"Organization"
'; 91 | $html .= ''; 92 | $html .= '
'; 94 | echo $html; 95 | 96 | $html = ''; 97 | $html .= ''; 98 | $html .= ''; 99 | $html .= ''; 103 | $html .= ''; 106 | $html .= ''; 109 | $html .= '
publisher.logo
@type :"ImageObject"
'; 100 | $html .= ''; 101 | $html .= ''; 102 | $html .= '
'; 104 | $html .= 'px'; 105 | $html .= '
'; 107 | $html .= 'px'; 108 | $html .= '
'; 110 | echo $html; 111 | 112 | $html = ''; 113 | $html .= ''; 114 | $html .= ''; 135 | $html .= ''; 138 | $html .= ''; 141 | $html .= '
Speakable
'; 115 | $html .= ''; 133 | $html .= ''; 134 | $html .= '
'; 136 | $html .= ''; 137 | $html .= '
'; 139 | $html .= ''; 140 | $html .= '
'; 142 | echo $html; 143 | 144 | $html = ''; 145 | $html .= ''; 146 | $html .= ''; 147 | $html .= ''; 148 | $html .= ''; 149 | $html .= ''; 150 | $html .= ''; 151 | $html .= ''; 152 | $html .= ''; 153 | $html .= ''; 154 | $html .= '
Setting Knowledge
schema.org BlogPosting :https://schema.org/BlogPosting
pending.schema.org Speakable :https://pending.schema.org/speakable
Google Search Article :https://developers.google.com/search/docs/data-types/articles
Google Search Speakable (BETA) :https://developers.google.com/search/docs/data-types/speakable
'; 155 | echo $html; 156 | 157 | submit_button(); 158 | } 159 | 160 | /** 161 | * Return the default options array 162 | * 163 | * @version 4.5.3 164 | * @since 2.2.0 165 | * @return array $args 166 | */ 167 | private function get_default_options () { 168 | $args['name'] = ''; 169 | $args['content_image'] = ''; 170 | $args['default_image'] = ''; 171 | $args['logo'] = ''; 172 | $args['logo-height'] = 0; 173 | $args['logo-width'] = 0; 174 | $args['speakable_action'] = ''; 175 | $args['speakable_type'] = ''; 176 | $args['speakable_headline'] = ''; 177 | $args['speakable_summary'] = ''; 178 | 179 | return (array) $args; 180 | } 181 | } -------------------------------------------------------------------------------- /includes/admin/wp-structuring-admin-type-breadcrumb.php: -------------------------------------------------------------------------------- 1 | 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.7.0 36 | * @since 2.3.3 37 | * @param array $option 38 | */ 39 | private function page_render ( array $option ) { 40 | $html = ''; 41 | $html .= ''; 42 | $html .= ''; 54 | $html .= ''; 71 | $html .= ''; 217 | 218 | return (string) sprintf( $format, $id, $display, $id, $id, $note ); 219 | } 220 | 221 | /** 222 | * Return the default options array 223 | * 224 | * @version 4.6.0 225 | * @since 1.0.0 226 | * @return array $args 227 | */ 228 | private function get_default_options () { 229 | $args['organization_type'] = 'Organization'; 230 | $args['name'] = ''; 231 | $args['url'] = ''; 232 | $args['logo'] = ''; 233 | $args['contact_point'] = ''; 234 | $args['telephone'] = ''; 235 | $args['contact_type'] = 'customer service'; 236 | $args['email'] = ''; 237 | $args['area_served'] = 'US'; 238 | $args['contact_option_1'] = ''; 239 | $args['contact_option_2'] = ''; 240 | $args['available_language'] = 'English'; 241 | 242 | foreach ( $this->social_array as $value ) { 243 | $args['social'][$value['type']] = ''; 244 | } 245 | 246 | return (array) $args; 247 | } 248 | } -------------------------------------------------------------------------------- /includes/admin/wp-structuring-admin-type-person.php: -------------------------------------------------------------------------------- 1 | "facebook", "display" => "Facebook"), 23 | array("type" => "twitter", "display" => "Twitter"), 24 | array("type" => "google", "display" => "Google+"), 25 | array("type" => "instagram", "display" => "Instagram"), 26 | array("type" => "youtube", "display" => "Youtube"), 27 | array("type" => "linkedin", "display" => "LinkedIn"), 28 | array("type" => "myspace", "display" => "Myspace"), 29 | array("type" => "pinterest", "display" => "Pinterest"), 30 | array("type" => "soundcloud", "display" => "SoundCloud"), 31 | array("type" => "tumblr", "display" => "Tumblr") 32 | ); 33 | 34 | /** 35 | * Constructor Define. 36 | * 37 | * @version 2.4.0 38 | * @since 2.4.0 39 | * @param array $option 40 | */ 41 | public function __construct ( array $option ) { 42 | /** Default Value Set */ 43 | $option_array = $this->get_default_options(); 44 | 45 | if ( !empty( $option ) ) { 46 | $option_array = array_merge( $option_array, $option ); 47 | } 48 | 49 | $this->page_render( $option_array ); 50 | } 51 | 52 | /** 53 | * Form Layout Render 54 | * 55 | * @version 4.5.3 56 | * @since 2.4.0 57 | * @param array $option 58 | */ 59 | private function page_render ( array $option ) { 60 | /** Basic Settings */ 61 | $html = '
Basic Setting
'; 43 | $html .= ''; 52 | $html .= 'Default : bloginfo("name")
* In the case of the pattern set for the static page on the front page its title is the default value.
'; 53 | $html .= '
'; 55 | 56 | switch ( $option['home_url'] ) { 57 | case 'site_url': 58 | $checked['home_url'] = ''; 59 | $checked['site_url'] = ' checked'; 60 | break; 61 | default: 62 | $checked['home_url'] = ' checked'; 63 | $checked['site_url'] = ''; 64 | break; 65 | } 66 | 67 | $html .= ''; 68 | $html .= ''; 69 | $html .= 'Choose which function to set the home URL.'; 70 | $html .= '
'; 72 | $html .= 'page_render(); 23 | } 24 | 25 | /** 26 | * Form Layout Render 27 | * 28 | * @version 4.8.1 29 | * @since 2.1.0 30 | */ 31 | private function page_render () { 32 | $html = ''; 33 | $html .= ''; 34 | $html .= ''; 35 | $html .= ''; 36 | $html .= ''; 37 | $html .= ''; 38 | $html .= ''; 39 | $html .= ''; 40 | $html .= ''; 41 | $html .= '
Basic Setting
type :Select a event type: field name "schema_event_type"
name :Input a custom post: field name "schema_event_name"
description :Input a custom post: field name "schema_event_description"
image :Input a custom post: field name "schema_event_image"
startDate :Input a custom post: field name "schema_event_date" & "schema_event_time"
endtDate :Input a custom post: field name "schema_event_date_end" & "schema_event_time_end"
url :Input a custom post: field name "schema_event_url"
'; 42 | echo $html; 43 | 44 | $html = ''; 45 | $html .= ''; 46 | $html .= ''; 47 | $html .= ''; 48 | $html .= ''; 49 | $html .= '
Location Type "Place" Setting
name :Input a custom post: field name "schema_event_place_name"
url(sameAs) :Input a custom post: field name "schema_event_url"
address :Input a custom post: field name "schema_event_place_address"
'; 50 | echo $html; 51 | 52 | $html = ''; 53 | $html .= ''; 54 | $html .= ''; 55 | $html .= ''; 56 | $html .= ''; 57 | $html .= ''; 58 | $html .= '
Location Type "Offers" Setting
price :Input a custom post: field name "schema_event_offers_price"
priceCurrency :Input a custom post: field name "schema_event_offers_currency"
url :Input a custom post: field name "schema_event_place_url"
validFrom :Input a custom post: field name "schema_event_offers_date" & "schema_event_offers_time"
'; 59 | echo $html; 60 | 61 | $html = ''; 62 | $html .= ''; 63 | $html .= ''; 64 | $html .= '
Location Type "PerformingGroup" Setting
name :Input a custom post: field name "schema_event_performer_name"
'; 65 | echo $html; 66 | 67 | $html = ''; 68 | $html .= ''; 69 | $html .= ''; 70 | $html .= ''; 71 | $html .= ''; 72 | $html .= ''; 73 | $html .= ''; 74 | $html .= ''; 75 | $html .= ''; 76 | $html .= ''; 77 | $html .= ''; 78 | $html .= ''; 79 | $html .= ''; 80 | $html .= ''; 81 | $html .= '
Setting Knowledge
Custom post name :schema_event_post
Archive rewrite name :events
schema.org Event :https://schema.org/Event
schema.org Place :https://schema.org/Place
schema.org Offer :https://schema.org/Offer
Google Search Breadcrumb :https://developers.google.com/search/docs/data-types/events
'; 82 | echo $html; 83 | 84 | submit_button(); 85 | } 86 | } -------------------------------------------------------------------------------- /includes/admin/wp-structuring-admin-type-news-article.php: -------------------------------------------------------------------------------- 1 | get_default_options(); 25 | 26 | if ( !empty( $option ) ) { 27 | $option_array = array_merge( $option_array, $option ); 28 | } 29 | 30 | $this->page_render( $option_array ); 31 | } 32 | 33 | /** 34 | * Form Layout Render 35 | * 36 | * @version 4.8.1 37 | * @since 1.0.0 38 | * @param array $option 39 | */ 40 | private function page_render ( array $option ) { 41 | $html = ''; 42 | $html .= ''; 43 | $html .= ''; 44 | $html .= ''; 45 | $html .= ''; 46 | $html .= ''; 47 | $html .= '
Basic Setting
headline :Default : post_title
datePublished :Default : get_the_time( DATE_ISO8601, ID )
dateModified :Default : get_the_modified_time( DATE_ISO8601, false, ID )
description :Default : post_excerpt
'; 48 | echo $html; 49 | 50 | $html = ''; 51 | $html .= ''; 52 | $html .= ''; 53 | $html .= ''; 54 | $html .= '
mainEntityOfPage
@type :"WebPage"
@id :Default : get_permalink( ID )
'; 55 | echo $html; 56 | 57 | $html = ''; 58 | $html .= ''; 59 | $html .= ''; 60 | $html .= ''; 61 | $html .= ''; 62 | $html .= ''; 63 | $html .= ''; 75 | $html .= '
image
@type :"ImageObject"
url :Default : thumbnail
height :Auto : The height of the image, in pixels.
width :Auto : The width of the image, in pixels. Images should be at least 696 pixels wide.
'; 64 | $html .= ''; 72 | $html .= '
'; 73 | $html .= 'Image output when feature image or content image check is not set.'; 74 | $html .= '
'; 76 | echo $html; 77 | 78 | $html = ''; 79 | $html .= ''; 80 | $html .= ''; 81 | $html .= ''; 83 | $html .= '
author
@type :"Person"
name :Default : get_the_author_meta( "display_name", author )'; 82 | $html .= '
'; 84 | echo $html; 85 | 86 | $html = ''; 87 | $html .= ''; 88 | $html .= ''; 89 | $html .= ''; 92 | $html .= '
publisher
@type :"Organization"
'; 90 | $html .= ''; 91 | $html .= '
'; 93 | echo $html; 94 | 95 | $html = ''; 96 | $html .= ''; 97 | $html .= ''; 98 | $html .= ''; 102 | $html .= ''; 105 | $html .= ''; 108 | $html .= '
publisher.logo
@type :"ImageObject"
'; 99 | $html .= ''; 100 | $html .= ''; 101 | $html .= '
'; 103 | $html .= 'px'; 104 | $html .= '
'; 106 | $html .= 'px'; 107 | $html .= '
'; 109 | echo $html; 110 | 111 | $html = ''; 112 | $html .= ''; 113 | $html .= ''; 134 | $html .= ''; 137 | $html .= ''; 140 | $html .= '
Speakable
'; 114 | $html .= ''; 132 | $html .= ''; 133 | $html .= '
'; 135 | $html .= ''; 136 | $html .= '
'; 138 | $html .= ''; 139 | $html .= '
'; 141 | echo $html; 142 | 143 | $html = ''; 144 | $html .= ''; 145 | $html .= ''; 146 | $html .= ''; 147 | $html .= ''; 148 | $html .= ''; 149 | $html .= ''; 150 | $html .= ''; 151 | $html .= ''; 152 | $html .= ''; 153 | $html .= '
Setting Knowledge
schema.org NewsArticle :https://schema.org/NewsArticle
pending.schema.org Speakable :https://pending.schema.org/speakable
Google Search Article :https://developers.google.com/search/docs/data-types/articles
Google Search Speakable (BETA) :https://developers.google.com/search/docs/data-types/speakable
'; 154 | echo $html; 155 | 156 | submit_button(); 157 | } 158 | 159 | /** 160 | * Return the default options array 161 | * 162 | * @since 4.5.3 163 | * @version 2.2.0 164 | * @return array $args 165 | */ 166 | private function get_default_options () { 167 | $args['name'] = ''; 168 | $args['content_image'] = ''; 169 | $args['default_image'] = ''; 170 | $args['logo'] = ''; 171 | $args['logo-height'] = 0; 172 | $args['logo-width'] = 0; 173 | $args['speakable_action'] = ''; 174 | $args['speakable_type'] = ''; 175 | $args['speakable_headline'] = ''; 176 | $args['speakable_summary'] = ''; 177 | 178 | return (array) $args; 179 | } 180 | } -------------------------------------------------------------------------------- /includes/admin/wp-structuring-admin-type-organization.php: -------------------------------------------------------------------------------- 1 | 'Organization', 'display' => 'Organization'), 25 | array('type' => 'Airline', 'display' => '- Airline'), 26 | array('type' => 'Consortium', 'display' => '- Consortium'), 27 | array('type' => 'Corporation', 'display' => '- Corporation'), 28 | array('type' => 'EducationalOrganization', 'display' => '- EducationalOrganization'), 29 | array('type' => 'GovernmentOrganization', 'display' => '- GovernmentOrganization'), 30 | array('type' => 'LibrarySystem', 'display' => '- LibrarySystem'), 31 | array('type' => 'LocalBusiness', 'display' => '- LocalBusiness'), 32 | array('type' => 'MedicalOrganization', 'display' => '- MedicalOrganization'), 33 | array('type' => 'NewsMediaOrganization', 'display' => '- NewsMediaOrganization'), 34 | array('type' => 'NGO', 'display' => '- NGO'), 35 | array('type' => 'PerformingGroup', 'display' => '- PerformingGroup'), 36 | array('type' => 'SportsOrganization', 'display' => '- SportsOrganization'), 37 | array('type' => 'WorkersUnion', 'display' => '- WorkersUnion') 38 | ); 39 | /** contactType defined. */ 40 | private $contact_type_array = array( 41 | array('type' => 'customer service', 'display' => 'customer service'), 42 | array('type' => 'technical support', 'display' => 'technical support'), 43 | array('type' => 'billing support', 'display' => 'billing support'), 44 | array('type' => 'bill payment', 'display' => 'bill payment'), 45 | array('type' => 'sales', 'display' => 'sales'), 46 | array('type' => 'reservations', 'display' => 'reservations'), 47 | array('type' => 'credit card_support', 'display' => 'credit card support'), 48 | array('type' => 'emergency', 'display' => 'emergency'), 49 | array('type' => 'baggage tracking', 'display' => 'baggage tracking'), 50 | array('type' => 'roadside assistance', 'display' => 'roadside assistance'), 51 | array('type' => 'package tracking', 'display' => 'package tracking') 52 | ); 53 | /** Social Profile */ 54 | private $social_array = array( 55 | array('type' => 'facebook', 'display' => 'Facebook'), 56 | array('type' => 'twitter', 'display' => 'Twitter'), 57 | array('type' => 'google', 'display' => 'Google+'), 58 | array('type' => 'instagram', 'display' => 'Instagram'), 59 | array('type' => 'youtube', 'display' => 'Youtube'), 60 | array('type' => 'linkedin', 'display' => 'LinkedIn'), 61 | array('type' => 'myspace', 'display' => 'Myspace'), 62 | array('type' => 'pinterest', 'display' => 'Pinterest'), 63 | array('type' => 'soundcloud', 'display' => 'SoundCloud'), 64 | array('type' => 'tumblr', 'display' => 'Tumblr') 65 | ); 66 | 67 | /** 68 | * Constructor Define. 69 | * 70 | * @version 4.1.0 71 | * @since 1.0.0 72 | * @param array $option 73 | */ 74 | public function __construct ( array $option ) { 75 | /** Default Value Set */ 76 | $option_array = $this->get_default_options(); 77 | 78 | if ( !empty( $option ) ) { 79 | $option_array = array_merge( $option_array, $option ); 80 | } 81 | $this->page_render( $option_array ); 82 | } 83 | 84 | /** 85 | * Form Layout Render 86 | * 87 | * @version 4.6.0 88 | * @since 1.0.0 89 | * @param array $option 90 | */ 91 | private function page_render ( array $option ) { 92 | /** Organization Type */ 93 | $html = ''; 94 | $html .= ''; 95 | $html .= $this->set_form_select( 'organization_type', 'Organization Type', $option['organization_type'] ); 96 | $html .= '
Organization
'; 97 | echo $html; 98 | 99 | /** Logos */ 100 | $html = ''; 101 | $html .= ''; 102 | $html .= ''; 105 | $html .= ''; 108 | $html .= ''; 112 | $html .= '
Logos
'; 103 | $html .= ''; 104 | $html .= '
'; 106 | $html .= ''; 107 | $html .= '
'; 109 | $html .= ''; 110 | $html .= ''; 111 | $html .= '
'; 113 | echo $html; 114 | 115 | /** Corporate Contact */ 116 | $html = ''; 117 | $html .= ''; 118 | $html .= ''; 128 | $html .= ''; 139 | $html .= ''; 142 | $html .= ''; 146 | $html .= ''; 162 | $html .= '
Corporate Contact
'; 119 | $html .= ''; 127 | $html .= '
'; 129 | $html .= ''; 138 | $html .= '
'; 140 | $html .= ''; 141 | $html .= '
'; 143 | $html .= ''; 144 | $html .= 'Default : "US"  Multiple : "US,CA"'; 145 | $html .= '
contactOption :'; 147 | $html .= '
'; 163 | echo $html; 164 | 165 | /** Social Profiles */ 166 | $html = ''; 167 | $html .= ''; 168 | foreach ( $this->social_array as $value ) { 169 | $html .= ''; 172 | } 173 | $html .= '
Social Profiles
'; 170 | $html .= ''; 171 | $html .= '
'; 174 | echo $html; 175 | 176 | $html = ''; 177 | $html .= ''; 178 | $html .= ''; 179 | $html .= ''; 180 | $html .= ''; 181 | $html .= ''; 182 | $html .= ''; 183 | $html .= ''; 184 | $html .= ''; 185 | $html .= ''; 186 | $html .= '
Setting Knowledge
schema.org Organization :https://schema.org/Organization
Google Search Logos :https://developers.google.com/search/docs/data-types/logo
Google Search Corporate Contact :https://developers.google.com/search/docs/data-types/corporate-contact
Google Search Social Profile :https://developers.google.com/search/docs/data-types/social-profile
'; 187 | echo $html; 188 | 189 | submit_button(); 190 | } 191 | 192 | /** 193 | * Return the form select 194 | * 195 | * @version 4.6.0 196 | * @since 4.6.0 197 | * @param string $id 198 | * @param string $display 199 | * @param string $value 200 | * @param string $note 201 | * @return string $html 202 | */ 203 | private function set_form_select ( $id, $display, $value = "", $note = "" ) { 204 | $value = esc_attr( $value ); 205 | 206 | $format = '
'; 207 | $format .= ''; 216 | $format .= '%s
'; 62 | $html .= ''; 63 | $html .= ''; 66 | $html .= ''; 69 | $html .= '
Basic Settings
'; 64 | $html .= ''; 65 | $html .= '
'; 67 | $html .= ''; 68 | $html .= '
'; 70 | echo $html; 71 | 72 | /** Place Settings */ 73 | $html = ''; 74 | $html .= ''; 75 | $html .= ''; 78 | $html .= '
Place Settings
'; 76 | $html .= ''; 77 | $html .= '
'; 79 | echo $html; 80 | 81 | /** Social Profiles */ 82 | $html = ''; 83 | $html .= ''; 84 | foreach ( $this->social_array as $value ) { 85 | $html .= ''; 88 | } 89 | $html .= '
Social Profiles
'; 86 | $html .= ''; 87 | $html .= '
'; 90 | echo $html; 91 | 92 | $html = ''; 93 | $html .= ''; 94 | $html .= ''; 95 | $html .= ''; 96 | $html .= ''; 97 | $html .= ''; 98 | $html .= '
Setting Knowledge
schema.org Person :https://schema.org/Person
Google Search Social Profile :https://developers.google.com/search/docs/data-types/social-profile
'; 99 | echo $html; 100 | 101 | submit_button(); 102 | } 103 | 104 | /** 105 | * Return the default options array 106 | * 107 | * @since 4.1.3 108 | * @version 2.4.0 109 | * @return array $args 110 | */ 111 | private function get_default_options () { 112 | $args['name'] = ''; 113 | $args['url'] = ''; 114 | $args['addressCountry'] = ''; 115 | 116 | foreach ( $this->social_array as $value ) { 117 | $args['social'][$value['type']] = ''; 118 | } 119 | 120 | return (array) $args; 121 | } 122 | } -------------------------------------------------------------------------------- /includes/admin/wp-structuring-admin-type-site-navigation.php: -------------------------------------------------------------------------------- 1 | get_default_options( $option ); 24 | } 25 | $this->page_render( $option ); 26 | } 27 | 28 | /** 29 | * Form Layout Render 30 | * 31 | * @version 4.5.3 32 | * @since 3.1.0 33 | * @param array $option 34 | */ 35 | private function page_render ( array $option ) { 36 | $html = ''; 37 | $html .= ''; 38 | $html .= ''; 59 | $html .= '
Basic Setting
'; 39 | 40 | $nav_menus = wp_get_nav_menus(); 41 | 42 | if ( count( $nav_menus ) > 0 ) { 43 | $html .= ''; 56 | } 57 | 58 | $html .= '
'; 60 | echo $html; 61 | 62 | $html = ''; 63 | $html .= ''; 64 | $html .= ''; 65 | $html .= ''; 66 | $html .= '
Setting Knowledge
schema.org SiteNavigationElement :https://schema.org/SiteNavigationElement
'; 67 | echo $html; 68 | 69 | submit_button(); 70 | } 71 | 72 | /** 73 | * Return the default options array 74 | * 75 | * @version 3.1.0 76 | * @since 3.1.0 77 | * @param array $args 78 | * @return array $args 79 | */ 80 | private function get_default_options ( array $args ) { 81 | $args['menu_name'] = ''; 82 | 83 | return (array) $args; 84 | } 85 | } -------------------------------------------------------------------------------- /includes/admin/wp-structuring-admin-type-video.php: -------------------------------------------------------------------------------- 1 | page_render(); 21 | } 22 | 23 | /** 24 | * Form Layout Render 25 | * 26 | * @version 3.0.5 27 | * @since 3.0.0 28 | */ 29 | private function page_render () { 30 | $html = ''; 31 | $html .= ''; 32 | $html .= ''; 33 | $html .= ''; 34 | $html .= ''; 35 | $html .= ''; 36 | $html .= ''; 37 | $html .= ''; 38 | $html .= ''; 39 | $html .= ''; 40 | $html .= ''; 41 | $html .= '
Basic Setting
name :Post Title
Description :Post Description
thumbnailUrl :Featured Image URL
uploadDate :Update Date
duration :Input a custom post: field name "schema_video_duration"
contentUrl :Input a custom post: field name "schema_video_content_url"
embedUrl :Input a custom post: field name "schema_video_embed_url"
interactionCount :Input a custom post: field name "schema_video_interaction_count"
expires :Input a custom post: field name "schema_video_expires_date" & "schema_video_expires_time"
'; 42 | echo $html; 43 | 44 | $html = ''; 45 | $html .= ''; 46 | $html .= ''; 47 | $html .= ''; 48 | $html .= ''; 49 | $html .= ''; 50 | $html .= ''; 51 | $html .= ''; 52 | $html .= ''; 53 | $html .= ''; 54 | $html .= '
Setting Knowledge
Custom post name :schema_video_post
Archive rewrite name :videos
schema.org VideoObject :https://schema.org/VideoObject
Google Search Video :https://developers.google.com/search/docs/data-types/video
'; 55 | echo $html; 56 | 57 | submit_button(); 58 | } 59 | } -------------------------------------------------------------------------------- /includes/admin/wp-structuring-admin-type-website.php: -------------------------------------------------------------------------------- 1 | get_default_options(); 25 | 26 | if ( !empty( $option ) ) { 27 | $option_array = array_merge( $option_array, $option ); 28 | } 29 | 30 | $this->page_render( $option_array ); 31 | } 32 | 33 | /** 34 | * Form Layout Render 35 | * 36 | * @version 4.5.3 37 | * @since 2.3.3 38 | * @param array $option 39 | */ 40 | private function page_render ( array $option ) { 41 | $html = ''; 42 | $html .= ''; 43 | $html .= ''; 46 | $html .= ''; 49 | $html .= ''; 52 | $html .= '
Basic Setting
'; 44 | $html .= ''; 45 | $html .= '
'; 47 | $html .= ''; 48 | $html .= '
'; 50 | $html .= ''; 51 | $html .= '
'; 53 | echo $html; 54 | 55 | $html = ''; 56 | $html .= ''; 57 | $html .= ''; 67 | $html .= '
Sitelink Search Box [ Site ]
'; 58 | $html .= '
'; 68 | echo $html; 69 | 70 | $html = ''; 71 | $html .= ''; 72 | $html .= ''; 82 | $html .= '
Sitelink Search Box [ App ] *required Sitelink Search Box [ Site ]
'; 73 | $html .= '
'; 83 | echo $html; 84 | 85 | $html = ''; 86 | $html .= ''; 87 | $html .= ''; 88 | $html .= ''; 89 | $html .= ''; 90 | $html .= ''; 91 | $html .= ''; 92 | $html .= ''; 93 | $html .= '
Setting Knowledge
schema.org SearchAction :https://schema.org/WebSite
schema.org WebSite :https://schema.org/SearchAction
Google Search Sitelinks Searchbox :https://developers.google.com/search/docs/data-types/sitelinks-searchbox
'; 94 | echo $html; 95 | 96 | submit_button(); 97 | } 98 | 99 | /** 100 | * Return the default options array 101 | * 102 | * @version 4.5.0 103 | * @since 1.0.0 104 | * @return array $args 105 | */ 106 | private function get_default_options () { 107 | $args = array(); 108 | 109 | $args['name'] = ''; 110 | $args['alternateName'] = ''; 111 | $args['url'] = ''; 112 | $args['potential_action'] = ''; 113 | $args['target'] = ''; 114 | $args['potential_action_app'] = ''; 115 | $args['target_app'] = ''; 116 | 117 | return (array) $args; 118 | } 119 | } -------------------------------------------------------------------------------- /includes/custom/wp-structuring-custom-post-event.php: -------------------------------------------------------------------------------- 1 | text_domain = $text_domain; 71 | 72 | /** Custom post menu controls */ 73 | $show_flag = __return_false(); 74 | if ( isset( $_POST['type'] ) && $_POST['type'] === 'event' ) { 75 | if ( isset( $_POST['activate'] ) && $_POST['activate'] === 'on' ) { 76 | $show_flag = __return_true(); 77 | } 78 | } else { 79 | /** DB Connect */ 80 | $db = new Structuring_Markup_Admin_Db(); 81 | $results = $db->get_type_options('event'); 82 | 83 | if ( isset( $results['activate'] ) && $results['activate'] == 'on' ) { 84 | $show_flag = __return_true(); 85 | } 86 | } 87 | 88 | register_post_type( 89 | $this->custom_type, 90 | array( 91 | 'labels' => array( 92 | 'name' => esc_html__( 'Event Posts', $this->text_domain ), 93 | 'singular_name' => esc_html__( 'Event Posts', $this->text_domain ), 94 | 'all_items' => esc_html__( 'All Event Posts', $this->text_domain ) 95 | ), 96 | 'capability_type' => 'post', 97 | 'has_archive' => true, 98 | 'hierarchical' => false, 99 | 'menu_position' => 5, 100 | 'public' => $show_flag, 101 | 'query_var' => false, 102 | 'rewrite' => array( 'with_front' => true, 'slug' => 'events' ), 103 | 'show_in_menu' => $show_flag, 104 | 'show_ui' => $show_flag, 105 | 'supports' => array( 'title', 'editor', 'author', 'thumbnail' ) 106 | ) 107 | ); 108 | 109 | register_taxonomy( 110 | $this->custom_type . '_cat', 111 | $this->custom_type, 112 | array( 113 | 'hierarchical' => true, 114 | 'label' => esc_html__( 'Categories' ), 115 | 'public' => true, 116 | 'show_ui' => true, 117 | 'update_count_callback' => '_update_post_term_count' 118 | ) 119 | ); 120 | 121 | register_taxonomy( 122 | $this->custom_type . '_tag', 123 | $this->custom_type, 124 | array( 125 | 'hierarchical' => false, 126 | 'label' => esc_html__( 'Tags' ), 127 | 'public' => true, 128 | 'show_ui' => true, 129 | 'update_count_callback' => '_update_post_term_count' 130 | ) 131 | ); 132 | 133 | if ( is_admin() ) { 134 | add_action( 'admin_init', array( $this, 'admin_init' ) ); 135 | add_action( 'admin_menu', array( $this, 'admin_menu' ) ); 136 | } 137 | } 138 | 139 | /** 140 | * admin init. 141 | * 142 | * @version 2.1.0 143 | * @since 2.1.0 144 | */ 145 | public function admin_init () { 146 | add_action( 'save_post_' . $this->custom_type, array( $this, 'save_post' ) ); 147 | } 148 | 149 | /** 150 | * admin meta boxes. 151 | * 152 | * @version 2.1.0 153 | * @since 2.1.0 154 | */ 155 | public function admin_menu () { 156 | $custom_field_title = esc_html__( 'Schema.org Type Event', $this->text_domain ); 157 | add_meta_box( $this->custom_type, $custom_field_title, array( $this, 'set_custom_fields' ), $this->custom_type, 'normal' ); 158 | } 159 | 160 | /** 161 | * Set custom fields. 162 | * 163 | * @version 4.1.1 164 | * @since 2.1.0 165 | */ 166 | public function set_custom_fields () { 167 | $custom_array = get_post_meta( get_the_ID(), $this->custom_type, false ); 168 | $custom_array = isset( $custom_array[0] ) ? unserialize( $custom_array[0] ) : array(); 169 | 170 | /** Default Value Set */ 171 | $args = $this->get_default_options(); 172 | 173 | if ( !empty( $args ) ) { 174 | $args = array_merge( $args, $custom_array ); 175 | } 176 | 177 | $html = ''; 178 | $html .= ''; 179 | $html .= ''; 192 | $html .= ''; 197 | $html .= ''; 202 | $html .= ''; 207 | $html .= ''; 213 | $html .= ''; 219 | $html .= ''; 224 | $html .= ''; 229 | $html .= ''; 234 | $html .= ''; 239 | $html .= ''; 252 | $html .= ''; 257 | $html .= ''; 263 | $html .= ''; 269 | $html .= ''; 274 | $html .= '
'; 182 | $html .= ''; 191 | $html .= '
'; 195 | $html .= ''; 196 | $html .= '
'; 200 | $html .= ''; 201 | $html .= '
'; 205 | $html .= ''; 206 | $html .= '
'; 210 | $html .= ''; 211 | $html .= ''; 212 | $html .= '
'; 216 | $html .= ''; 217 | $html .= ''; 218 | $html .= '
'; 222 | $html .= ''; 223 | $html .= '
'; 227 | $html .= ''; 228 | $html .= '
'; 232 | $html .= ''; 233 | $html .= '
'; 237 | $html .= ''; 238 | $html .= '
'; 242 | $html .= ''; 251 | $html .= '
'; 255 | $html .= ''; 256 | $html .= '
'; 260 | $html .= ''; 261 | $html .= '  ( with ISO 4217 codes e.g. "USD" )'; 262 | $html .= '
'; 266 | $html .= ''; 267 | $html .= ''; 268 | $html .= '
'; 272 | $html .= ''; 273 | $html .= '
'; 275 | 276 | echo $html; 277 | } 278 | 279 | /** 280 | * Save custom post. 281 | * 282 | * @version 2.1.0 283 | * @since 2.1.0 284 | * @param integer $post_id The post ID. 285 | */ 286 | public function save_post ( $post_id ) { 287 | if ( isset( $_POST['option'] ) ) { 288 | update_post_meta( $post_id, $this->custom_type, serialize( $_POST['option'] ) ); 289 | } 290 | } 291 | 292 | /** 293 | * Return the default options array 294 | * 295 | * @version 4.0.2 296 | * @since 3.2.3 297 | * @return array $args 298 | */ 299 | private function get_default_options () { 300 | $args = array( 301 | 'schema_event_type' => 'Event', 302 | 'schema_event_name' => '', 303 | 'schema_event_description' => '', 304 | 'schema_event_image' => '', 305 | 'schema_event_date' => date( 'Y-m-d' ), 306 | 'schema_event_time' => date( 'h:i' ), 307 | 'schema_event_date_end' => '', 308 | 'schema_event_time_end' => '', 309 | 'schema_event_url' => '', 310 | 'schema_event_place_name' => '', 311 | 'schema_event_place_url' => '', 312 | 'schema_event_place_address' => '', 313 | 'schema_event_offers_availability' => 'InStock', 314 | 'schema_event_offers_price' => 0, 315 | 'schema_event_offers_currency' => esc_html__( 'USD', $this->text_domain ), 316 | 'schema_event_offers_date' => '', 317 | 'schema_event_offers_time' => '', 318 | 'schema_event_performer_name' => '' 319 | ); 320 | 321 | return (array) $args; 322 | } 323 | } -------------------------------------------------------------------------------- /includes/custom/wp-structuring-custom-post-video.php: -------------------------------------------------------------------------------- 1 | text_domain = $text_domain; 31 | 32 | /** Custom post menu controls */ 33 | $show_flag = __return_false(); 34 | if ( isset( $_POST['type'] ) && $_POST['type'] === 'video' ) { 35 | if ( isset( $_POST['activate'] ) && $_POST['activate'] === 'on' ) { 36 | $show_flag = __return_true(); 37 | } 38 | } else { 39 | /** DB Connect */ 40 | $db = new Structuring_Markup_Admin_Db(); 41 | $results = $db->get_type_options('video'); 42 | 43 | if ( isset( $results['activate'] ) && $results['activate'] == 'on' ) { 44 | $show_flag = __return_true(); 45 | } 46 | } 47 | 48 | register_post_type( 49 | $this->custom_type, 50 | array( 51 | 'labels' => array( 52 | 'name' => esc_html__( 'Video Posts', $this->text_domain ), 53 | 'singular_name' => esc_html__( 'Video Posts', $this->text_domain ), 54 | 'all_items' => esc_html__( 'All Video Posts', $this->text_domain ) 55 | ), 56 | 'capability_type' => 'post', 57 | 'has_archive' => true, 58 | 'hierarchical' => false, 59 | 'menu_position' => 5, 60 | 'public' => $show_flag, 61 | 'query_var' => false, 62 | 'rewrite' => array( 'with_front' => true, 'slug' => 'videos' ), 63 | 'show_in_menu' => $show_flag, 64 | 'show_ui' => $show_flag, 65 | 'supports' => array( 'title', 'editor', 'author', 'thumbnail' ) 66 | ) 67 | ); 68 | 69 | register_taxonomy( 70 | $this->custom_type . '_cat', 71 | $this->custom_type, 72 | array( 73 | 'hierarchical' => true, 74 | 'label' => esc_html__( 'Categories' ), 75 | 'public' => true, 76 | 'show_ui' => true, 77 | 'update_count_callback' => '_update_post_term_count' 78 | ) 79 | ); 80 | 81 | register_taxonomy( 82 | $this->custom_type . '_tag', 83 | $this->custom_type, 84 | array( 85 | 'hierarchical' => false, 86 | 'label' => esc_html__( 'Tags' ), 87 | 'public' => true, 88 | 'show_ui' => true, 89 | 'update_count_callback' => '_update_post_term_count' 90 | ) 91 | ); 92 | 93 | if ( is_admin() ) { 94 | add_action( 'admin_init', array( $this, 'admin_init' ) ); 95 | add_action( 'admin_menu', array( $this, 'admin_menu' ) ); 96 | } 97 | } 98 | 99 | /** 100 | * admin init. 101 | * 102 | * @version 3.0.0 103 | * @since 3.0.0 104 | */ 105 | public function admin_init () { 106 | add_action( 'save_post_' . $this->custom_type, array( $this, 'save_post' ) ); 107 | } 108 | 109 | /** 110 | * admin meta boxes. 111 | * 112 | * @version 3.0.0 113 | * @since 3.0.0 114 | */ 115 | public function admin_menu () { 116 | $custom_field_title = esc_html__( 'Schema.org Type Video', $this->text_domain ); 117 | add_meta_box( $this->custom_type, $custom_field_title, array( $this, 'set_custom_fields' ), $this->custom_type, 'normal' ); 118 | } 119 | 120 | /** 121 | * Set custom fields. 122 | * 123 | * @version 4.1.1 124 | * @since 3.0.0 125 | */ 126 | public function set_custom_fields () { 127 | $custom_array = get_post_meta( get_the_ID(), $this->custom_type, false ); 128 | $custom_array = isset( $custom_array[0] ) ? unserialize( $custom_array[0] ) : array(); 129 | 130 | /** Default Value Set */ 131 | $args = $this->get_default_options(); 132 | 133 | if ( !empty( $args ) ) { 134 | $args = array_merge( $args, $custom_array ); 135 | } 136 | 137 | $html = ''; 138 | $html .= ''; 139 | $html .= ''; 144 | $html .= ''; 149 | $html .= ''; 154 | $html .= ''; 160 | $html .= ''; 165 | $html .= ''; 170 | $html .= ''; 175 | $html .= ''; 180 | $html .= ''; 186 | $html .= '
'; 142 | $html .= ''; 143 | $html .= '
'; 147 | $html .= ''; 148 | $html .= '
'; 152 | $html .= ''; 153 | $html .= '
'; 157 | $html .= ''; 158 | $html .= ''; 159 | $html .= '
'; 163 | $html .= ''; 164 | $html .= '
'; 168 | $html .= ''; 169 | $html .= '
'; 173 | $html .= ''; 174 | $html .= '
'; 178 | $html .= ''; 179 | $html .= '
'; 183 | $html .= ''; 184 | $html .= ''; 185 | $html .= '
'; 187 | 188 | echo $html; 189 | } 190 | 191 | /** 192 | * Save custom post. 193 | * 194 | * @version 3.0.0 195 | * @since 3.0.0 196 | * @param integer $post_id The post ID. 197 | */ 198 | public function save_post ( $post_id ) { 199 | if ( isset( $_POST['option'] ) ) { 200 | update_post_meta( $post_id, $this->custom_type, serialize( $_POST['option'] ) ); 201 | } 202 | } 203 | 204 | /** 205 | * Return the default options array 206 | * 207 | * @version 3.2.3 208 | * @since 3.2.3 209 | * @return array $args 210 | */ 211 | private function get_default_options () { 212 | $args = array( 213 | 'schema_video_name' => '', 214 | 'schema_video_description' => '', 215 | 'schema_video_thumbnail_url' => '', 216 | 'schema_video_upload_date' => '', 217 | 'schema_video_upload_time' => '', 218 | 'schema_video_duration' => '', 219 | 'schema_video_content_url' => '', 220 | 'schema_video_embed_url' => '', 221 | 'schema_video_interaction_count' => '', 222 | 'schema_video_expires_date' => '', 223 | 'schema_video_expires_time' => '', 224 | ); 225 | 226 | return (array) $args; 227 | } 228 | } -------------------------------------------------------------------------------- /includes/meta/wp-structuring-meta-article.php: -------------------------------------------------------------------------------- 1 | utility = $utility; 31 | } 32 | 33 | /** 34 | * Setting schema.org Article 35 | * 36 | * @version 4.8.1 37 | * @since 4.0.0 38 | * @param array $options 39 | * @return array $args 40 | */ 41 | public function set_meta ( array $options ) { 42 | global $post; 43 | 44 | $excerpt = $this->utility->escape_text( $post->post_excerpt ); 45 | $content = $excerpt === "" ? mb_substr( $this->utility->escape_text( $post->post_content ), 0, 110 ) : $excerpt; 46 | 47 | $args = array( 48 | "@context" => "https://schema.org", 49 | "@type" => "Article", 50 | "mainEntityOfPage" => array( 51 | "@type" => "WebPage", 52 | "@id" => get_permalink( $post->ID ) 53 | ), 54 | "headline" => mb_substr( $this->utility->escape_text( $post->post_title ), 0, 110 ), 55 | "datePublished" => get_the_time( DATE_ISO8601, $post->ID ), 56 | "dateModified" => get_the_modified_time( DATE_ISO8601, $post->ID ), 57 | "author" => array( 58 | "@type" => "Person", 59 | "name" => esc_html( get_the_author_meta( 'display_name', $post->post_author ) ) 60 | ), 61 | "description" => $content 62 | ); 63 | 64 | if ( has_post_thumbnail( $post->ID ) ) { 65 | $images = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); 66 | $images_args = array( 67 | "image" => $this->set_image_object( $images[0], $images[1], $images[2] ) 68 | ); 69 | $args = array_merge( $args, $images_args ); 70 | } elseif ( isset( $options['content_image'] ) && $options['content_image'] === 'on' ) { 71 | if ( $images = $this->utility->get_content_image( $post->post_content ) ) { 72 | if ( $size = $this->utility->get_image_dimensions( $images ) ) { 73 | $images_args = array( 74 | "image" => $this->set_image_object( $images, $size['width'], $size['height'] ) 75 | ); 76 | $args = array_merge( $args, $images_args ); 77 | } 78 | } elseif ( isset( $options['default_image'] ) ) { 79 | if ($size = $this->utility->get_image_dimensions( $options['default_image'] ) ) { 80 | $images_args = array( 81 | "image" => $this->set_image_object( esc_html( $options['default_image'] ), $size['width'], $size['height'] ) 82 | ); 83 | $args = array_merge( $args, $images_args ); 84 | } 85 | } 86 | } elseif ( isset( $options['default_image'] ) ) { 87 | if ( $size = $this->utility->get_image_dimensions( $options['default_image'] ) ) { 88 | $images_args = array( 89 | "image" => $this->set_image_object( esc_html( $options['default_image'] ), $size['width'], $size['height'] ) 90 | ); 91 | $args = array_merge( $args, $images_args ); 92 | } 93 | } 94 | 95 | if ( isset( $options['name'] ) && !empty( $options['name'] ) ) { 96 | $publisher_args = array( 97 | "publisher" => array( 98 | "@type" => "Organization", 99 | "name" => esc_html( $options['name'] ), 100 | ) 101 | ); 102 | 103 | $options['logo'] = isset( $options['logo'] ) ? esc_html( $options['logo'] ) : ""; 104 | 105 | if ( $logo = $this->utility->get_image_dimensions( $options['logo'] ) ) { 106 | $publisher_args['publisher']['logo'] = $this->set_image_object( $options['logo'], $logo['width'], $logo['height'] ); 107 | } else if ( !empty( $options['logo'] ) ) { 108 | $publisher_args['publisher']['logo'] = $this->set_image_object( 109 | $options['logo'], 110 | isset( $options['logo-width'] ) ? ( int ) $options['logo-width'] : 0, 111 | isset( $options['logo-height'] ) ? ( int ) $options['logo-height'] : 0 112 | ); 113 | } 114 | $args = array_merge( $args, $publisher_args ); 115 | } 116 | 117 | if ( isset( $options['speakable_action'] ) && $options['speakable_action'] === 'on' ) { 118 | $speakable_type = isset( $options['speakable_type'] ) ? $options['speakable_type'] : ''; 119 | 120 | if ( !empty( $speakable_type ) ) { 121 | $action_array = array( 122 | "@type" => "SpeakableSpecification" 123 | ); 124 | $action_array[$speakable_type] = array( 125 | isset( $options['speakable_headline'] ) ? stripslashes( $options['speakable_headline'] ) : '', 126 | isset( $options['speakable_summary'] ) ? stripslashes( $options['speakable_summary'] ) : '' 127 | ); 128 | $args['speakable'] = $action_array; 129 | } 130 | } 131 | 132 | return ( array ) $args; 133 | } 134 | 135 | /** 136 | * Setting ImageObject 137 | * 138 | * @version 4.7.0 139 | * @since 4.7.0 140 | * @param string $url 141 | * @param integer $width 142 | * @param integer $height 143 | * @return array $args 144 | */ 145 | public function set_image_object ( $url, $width, $height ) { 146 | $args = array( 147 | "@type" => "ImageObject", 148 | "url" => $url, 149 | "width" => $width, 150 | "height" => $height 151 | ); 152 | 153 | return ( array ) $args; 154 | } 155 | } -------------------------------------------------------------------------------- /includes/meta/wp-structuring-meta-blog-posting.php: -------------------------------------------------------------------------------- 1 | utility = $utility; 31 | } 32 | 33 | /** 34 | * Setting schema.org BlogPosting 35 | * 36 | * @version 4.8.1 37 | * @since 4.0.0 38 | * @param array $options 39 | * @return array $args 40 | */ 41 | public function set_meta ( array $options ) { 42 | global $post; 43 | 44 | $excerpt = $this->utility->escape_text( $post->post_excerpt ); 45 | $content = $excerpt === "" ? mb_substr( $this->utility->escape_text( $post->post_content ), 0, 110 ) : $excerpt; 46 | 47 | $args = array( 48 | "@context" => "https://schema.org", 49 | "@type" => "BlogPosting", 50 | "mainEntityOfPage" => array( 51 | "@type" => "WebPage", 52 | "@id" => get_permalink( $post->ID ) 53 | ), 54 | "headline" => mb_substr( $this->utility->escape_text( $post->post_title ), 0, 110 ), 55 | "datePublished" => get_the_time( DATE_ISO8601, $post->ID ), "dateModified" => get_the_modified_time( DATE_ISO8601, $post->ID ), 56 | "author" => array( 57 | "@type" => "Person", 58 | "name" => esc_html( get_the_author_meta( 'display_name', $post->post_author ) ) 59 | ), 60 | "description" => $content 61 | ); 62 | 63 | if ( has_post_thumbnail( $post->ID ) ) { 64 | $images = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); 65 | $images_args = array( 66 | "image" => $this->set_image_object( $images[0], $images[1], $images[2] ) 67 | ); 68 | $args = array_merge( $args, $images_args ); 69 | } elseif ( isset( $options['content_image'] ) && $options['content_image'] === 'on' ) { 70 | if ( $images = $this->utility->get_content_image( $post->post_content ) ) { 71 | if ( $size = $this->utility->get_image_dimensions( $images ) ) { 72 | $images_args = array( 73 | "image" => $this->set_image_object( $images, $size['width'], $size['height'] ) 74 | ); 75 | $args = array_merge( $args, $images_args ); 76 | } 77 | } elseif ( isset( $options['default_image'] ) ) { 78 | if ($size = $this->utility->get_image_dimensions( $options['default_image'] ) ) { 79 | $images_args = array( 80 | "image" => $this->set_image_object( esc_html( $options['default_image'] ), $size['width'], $size['height'] ) 81 | ); 82 | $args = array_merge( $args, $images_args ); 83 | } 84 | } 85 | } elseif ( isset( $options['default_image'] ) ) { 86 | if ( $size = $this->utility->get_image_dimensions( $options['default_image'] ) ) { 87 | $images_args = array( 88 | "image" => $this->set_image_object( esc_html( $options['default_image'] ), $size['width'], $size['height'] ) 89 | ); 90 | $args = array_merge( $args, $images_args ); 91 | } 92 | } 93 | 94 | if ( isset( $options['name'] ) && !empty( $options['name'] ) ) { 95 | $publisher_args = array( 96 | "publisher" => array( 97 | "@type" => "Organization", 98 | "name" => esc_html( $options['name'] ), 99 | ) 100 | ); 101 | 102 | $options['logo'] = isset( $options['logo'] ) ? esc_html( $options['logo'] ) : ""; 103 | 104 | if ( $logo = $this->utility->get_image_dimensions( $options['logo'] ) ) { 105 | $publisher_args['publisher']['logo'] = $this->set_image_object( $options['logo'], $logo['width'], $logo['height'] ); 106 | } else if ( !empty( $options['logo'] ) ) { 107 | $publisher_args['publisher']['logo'] = $this->set_image_object( 108 | $options['logo'], 109 | isset( $options['logo-width'] ) ? ( int ) $options['logo-width'] : 0, 110 | isset( $options['logo-height'] ) ? ( int ) $options['logo-height'] : 0 111 | ); 112 | } 113 | $args = array_merge( $args, $publisher_args ); 114 | } 115 | 116 | if ( isset( $options['speakable_action'] ) && $options['speakable_action'] === 'on' ) { 117 | $speakable_type = isset( $options['speakable_type'] ) ? $options['speakable_type'] : ''; 118 | 119 | if ( !empty( $speakable_type ) ) { 120 | $action_array = array( 121 | "@type" => "SpeakableSpecification" 122 | ); 123 | $action_array[$speakable_type] = array( 124 | isset( $options['speakable_headline'] ) ? stripslashes( $options['speakable_headline'] ) : '', 125 | isset( $options['speakable_summary'] ) ? stripslashes( $options['speakable_summary'] ) : '' 126 | ); 127 | $args['speakable'] = $action_array; 128 | } 129 | } 130 | 131 | return ( array ) $args; 132 | } 133 | 134 | /** 135 | * Setting ImageObject 136 | * 137 | * @version 4.7.0 138 | * @since 4.7.0 139 | * @param string $url 140 | * @param integer $width 141 | * @param integer $height 142 | * @return array $args 143 | */ 144 | public function set_image_object ( $url, $width, $height ) { 145 | $args = array( 146 | "@type" => "ImageObject", 147 | "url" => $url, 148 | "width" => $width, 149 | "height" => $height 150 | ); 151 | 152 | return ( array ) $args; 153 | } 154 | } -------------------------------------------------------------------------------- /includes/meta/wp-structuring-meta-breadcrumb.php: -------------------------------------------------------------------------------- 1 | breadcrumb_array_setting( $options ); 25 | 26 | if ( $item_array ) { 27 | /** itemListElement build */ 28 | $item_list_element = array(); 29 | $position = 1; 30 | foreach ($item_array as $item) { 31 | $item_list_element[] = array( 32 | "@type" => "ListItem", 33 | "position" => $position, 34 | "item" => $item 35 | ); 36 | $position++; 37 | } 38 | 39 | /** Breadcrumb Schema build */ 40 | $args = array( 41 | "@context" => "https://schema.org", 42 | "@type" => "BreadcrumbList", 43 | "itemListElement" => $item_list_element 44 | ); 45 | 46 | return (array) $args; 47 | } 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /includes/meta/wp-structuring-meta-event.php: -------------------------------------------------------------------------------- 1 | ID, 'schema_event_post', false ); 25 | 26 | if ( isset( $meta[0] ) ) { 27 | $meta = unserialize( $meta[0] ); 28 | 29 | // @type: Event 30 | if ( !isset( $meta['schema_event_type']) ) $meta['schema_event_type'] = 'Event'; 31 | if ( !isset( $meta['schema_event_name']) ) $meta['schema_event_name'] = ''; 32 | if ( !isset( $meta['schema_event_date']) ) $meta['schema_event_date'] = date('Y-m-d'); 33 | if ( !isset( $meta['schema_event_time']) ) $meta['schema_event_time'] = date('h:i'); 34 | if ( !isset( $meta['schema_event_url']) ) $meta['schema_event_url'] = ''; 35 | if ( !isset( $meta['schema_event_place_name'] ) ) $meta['schema_event_place_name'] = ''; 36 | if ( !isset( $meta['schema_event_place_url'] ) ) $meta['schema_event_place_url'] = ''; 37 | if ( !isset( $meta['schema_event_place_address'] ) ) $meta['schema_event_place_address'] = ''; 38 | if ( !isset( $meta['schema_event_offers_price'] ) ) $meta['schema_event_offers_price'] = 0; 39 | if ( !isset( $meta['schema_event_offers_currency'] ) ) $meta['schema_event_offers_currency'] = ''; 40 | 41 | $args = array( 42 | "@context" => "https://schema.org", 43 | "@type" => esc_html( $meta['schema_event_type'] ), 44 | "name" => esc_html( $meta['schema_event_name'] ), 45 | "startDate" => esc_html( $meta['schema_event_date'] ) . 'T' . esc_html( $meta['schema_event_time'] ), 46 | "url" => esc_url( $meta['schema_event_url'] ), 47 | "location" => array( 48 | "@type" => "Place", 49 | "sameAs" => esc_url( $meta['schema_event_place_url'] ), 50 | "name" => esc_html( $meta['schema_event_place_name'] ), 51 | "address" => esc_html( $meta['schema_event_place_address'] ) 52 | ) 53 | ); 54 | 55 | // @type: Event recommended items 56 | if ( isset( $meta['schema_event_description'] ) && $meta['schema_event_description'] !== '' ) { 57 | $args['description'] = esc_html( $meta['schema_event_description'] ); 58 | } 59 | if ( isset( $meta['schema_event_image'] ) && $meta['schema_event_image'] !== '' ) { 60 | $args['image'] = esc_html( $meta['schema_event_image'] ); 61 | } 62 | if ( isset( $meta['schema_event_date_end'] ) && $meta['schema_event_date_end'] !== '' && isset( $meta['schema_event_time_end'] ) && $meta['schema_event_time_end'] !== '' ) { 63 | $args['endDate'] = esc_html( $meta['schema_event_date_end'] ) . 'T' . esc_html( $meta['schema_event_time_end'] ); 64 | } 65 | 66 | // @type: Offer 67 | $offer = array( 68 | "@type" => "Offer", 69 | "price" => esc_html( $meta['schema_event_offers_price'] ), 70 | "priceCurrency" => esc_html( $meta['schema_event_offers_currency'] ), 71 | "url" => esc_url( $meta['schema_event_url'] ) 72 | ); 73 | 74 | // @type: Offer recommended items 75 | if ( isset( $meta['schema_event_offers_availability'] ) && $meta['schema_event_offers_availability'] !== '' ) { 76 | $offer['availability'] = "https://schema.org/" . esc_html( $meta['schema_event_offers_availability'] ); 77 | } 78 | if ( isset( $meta['schema_event_offers_date'] ) && $meta['schema_event_offers_date'] !== '' && isset( $meta['schema_event_offers_time'] ) && $meta['schema_event_offers_time'] !== '' ) { 79 | $offer['validFrom'] = esc_html( $meta['schema_event_offers_date'] ) . 'T' . esc_html( $meta['schema_event_offers_time'] ); 80 | } 81 | 82 | $args['offers'] = $offer; 83 | 84 | // @type: PerformingGroup recommended items 85 | if ( isset( $meta['schema_event_performer_name'] ) && $meta['schema_event_performer_name'] !== '' ) { 86 | $args['performer'] = array( 87 | "@type" => "PerformingGroup", 88 | "name" => esc_html( $meta['schema_event_performer_name'] ) 89 | ); 90 | } 91 | 92 | return (array) $args; 93 | } 94 | } 95 | } -------------------------------------------------------------------------------- /includes/meta/wp-structuring-meta-local-business.php: -------------------------------------------------------------------------------- 1 | 'Mo', 'display' => 'Monday' ), 28 | array( 'type' => 'Tu', 'display' => 'Tuesday' ), 29 | array( 'type' => 'We', 'display' => 'Wednesday' ), 30 | array( 'type' => 'Th', 'display' => 'Thursday' ), 31 | array( 'type' => 'Fr', 'display' => 'Friday' ), 32 | array( 'type' => 'Sa', 'display' => 'Saturday' ), 33 | array( 'type' => 'Su', 'display' => 'Sunday' ) 34 | ); 35 | 36 | $args = array( 37 | '@context' => 'https://schema.org', 38 | '@type' => isset( $options['business_type'] ) ? esc_html( $options['business_type'] ) : 'LocalBusiness', 39 | 'name' => isset( $options['name'] ) ? esc_html( $options['name'] ) : '', 40 | 'image' => isset( $options['image'] ) ? esc_html( $options['image'] ) : '', 41 | 'url' => isset( $options['url'] ) ? esc_url( $options['url'] ) : '' 42 | ); 43 | 44 | if ( isset( $options['telephone'] ) && !empty( $options['telephone'] ) ) { 45 | $args['telephone'] = esc_html( $options['telephone'] ); 46 | } 47 | 48 | if ( isset( $options['food_active'] ) && $options['food_active'] === 'on' ) { 49 | if ( isset( $options['menu'] ) && $options['menu'] !== '' ) { 50 | $args['menu'] = esc_url( $options['menu'] ); 51 | } 52 | if ( isset( $options['accepts_reservations'] ) && $options['accepts_reservations'] === 'on' ) { 53 | $args['acceptsReservations'] = 'True'; 54 | } else { 55 | $args['acceptsReservations'] = 'False'; 56 | } 57 | if ( isset( $options['serves_cuisine'] ) && $options['serves_cuisine'] !== '' ) { 58 | $args['servesCuisine'] = esc_html( $options['serves_cuisine'] ); 59 | } 60 | } 61 | 62 | $address_array['address'] = array( 63 | '@type' => 'PostalAddress', 64 | 'streetAddress' => isset( $options['street_address'] ) ? esc_html( $options['street_address'] ) : '', 65 | 'addressLocality' => isset( $options['address_locality'] ) ? esc_html( $options['address_locality'] ) : '', 66 | 'postalCode' => isset( $options['postal_code'] ) ? esc_html( $options['postal_code'] ) : '', 67 | 'addressCountry' => isset( $options['address_country'] ) ? esc_html( $options['address_country'] ) : '' 68 | ); 69 | 70 | if ( isset( $options['address_region'] ) && !empty( $options['address_region'] ) ) { 71 | $address_array['address']['addressRegion'] = esc_html( $options['address_region'] ); 72 | } 73 | 74 | $args = array_merge( $args, $address_array ); 75 | $geo_array = array(); 76 | 77 | if ( isset( $options['geo_active'] ) && $options['geo_active'] === 'on' ) { 78 | $geo_array['geo'] = array( 79 | '@type' => 'GeoCoordinates', 80 | 'latitude' => isset( $options['latitude'] ) ? esc_html(floatval($options['latitude'])) : '', 81 | 'longitude' => isset( $options['longitude'] ) ? esc_html(floatval($options['longitude'])) : '' 82 | ); 83 | } 84 | 85 | if ( isset( $options['geo_circle_active'] ) && $options['geo_circle_active'] === 'on' ) { 86 | $place_array['location'] = array( '@type' => 'Place' ); 87 | $place_array['location']['geo'] = array( 88 | '@type' => 'GeoCircle', 89 | 'geoRadius' => isset( $options['geo_circle_radius'] ) ? esc_html( floatval( $options['geo_circle_radius'] ) ) : '' 90 | ); 91 | if ( isset( $options['geo_active'] ) && $options['geo_active'] === 'on' ) { 92 | $place_array['location']['geo']['geoMidpoint'] = $geo_array['geo']; 93 | } 94 | $args = array_merge( $args, $place_array ); 95 | } else { 96 | if ( isset( $options['geo_active'] ) && $options['geo_active'] === 'on' ) { 97 | $args = array_merge( $args, $geo_array ); 98 | } 99 | } 100 | 101 | /* openingHours */ 102 | $active_days = array(); 103 | foreach ( $week_array as $value ) { 104 | if ( isset( $options[$value['type']] ) && $options[$value['type']] === 'on' ) { 105 | $active_days[$value['type']] = $options['week'][$value['type']]; 106 | } 107 | } 108 | 109 | if( !empty( $active_days ) ) { 110 | 111 | $obj = new Structuring_Markup_Opening_Hours( $active_days ); 112 | $opening_hours = $obj->display(); 113 | 114 | $opening_array['openingHours'] = array(); 115 | 116 | foreach( $opening_hours as $value ) { 117 | $opening_array['openingHours'][] = $value; 118 | } 119 | 120 | $args = array_merge( $args, $opening_array ); 121 | 122 | } 123 | 124 | if ( isset( $options['holiday_active'] ) && $options['holiday_active'] === 'on' ) { 125 | $holiday_array['openingHoursSpecification'] = array( 126 | '@type' => 'OpeningHoursSpecification', 127 | 'opens' => isset( $options['holiday_open'] ) ? esc_html( $options['holiday_open'] ) : '', 128 | 'closes' => isset( $options['holiday_close'] ) ? esc_html( $options['holiday_close'] ) : '', 129 | 'validFrom' => isset( $options['holiday_valid_from'] ) ? esc_html( $options['holiday_valid_from'] ) : '', 130 | 'validThrough' => isset( $options['holiday_valid_through'] ) ? esc_html( $options['holiday_valid_through'] ) : '' 131 | ); 132 | $args = array_merge( $args, $holiday_array ); 133 | } 134 | 135 | if ( isset( $options['price_range'] ) && !empty( $options['price_range'] ) ) { 136 | $price_array['priceRange'] = $options['price_range']; 137 | $args = array_merge( $args, $price_array ); 138 | } 139 | 140 | return (array) $args; 141 | } 142 | 143 | } -------------------------------------------------------------------------------- /includes/meta/wp-structuring-meta-news-article.php: -------------------------------------------------------------------------------- 1 | utility = $utility; 31 | } 32 | 33 | /** 34 | * Setting schema.org NewsArticle 35 | * 36 | * @version 4.7.0 37 | * @since 4.0.0 38 | * @param array $options 39 | * @return array $args 40 | */ 41 | public function set_meta ( array $options ) { 42 | global $post; 43 | 44 | $excerpt = $this->utility->escape_text( $post->post_excerpt ); 45 | $content = $excerpt === "" ? mb_substr( $this->utility->escape_text( $post->post_content ), 0, 110 ) : $excerpt; 46 | 47 | $args = array( 48 | "@context" => "https://schema.org", 49 | "@type" => "NewsArticle", 50 | "mainEntityOfPage" => array( 51 | "@type" => "WebPage", 52 | "@id" => get_permalink( $post->ID ) 53 | ), 54 | "headline" => mb_substr( $this->utility->escape_text( $post->post_title ), 0, 110 ), 55 | "datePublished" => get_the_time( DATE_ISO8601, $post->ID ), 56 | "dateModified" => get_the_modified_time( DATE_ISO8601, $post->ID ), 57 | "author" => array( 58 | "@type" => "Person", 59 | "name" => esc_html( get_the_author_meta( 'display_name', $post->post_author ) ) 60 | ), 61 | "description" => $content 62 | ); 63 | 64 | if ( has_post_thumbnail( $post->ID ) ) { 65 | $images = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); 66 | $images_args = array( 67 | "image" => $this->set_image_object( $images[0], $images[1], $images[2] ) 68 | ); 69 | $args = array_merge( $args, $images_args ); 70 | } elseif ( isset( $options['content_image'] ) && $options['content_image'] === 'on' ) { 71 | if ( $images = $this->utility->get_content_image( $post->post_content ) ) { 72 | if ( $size = $this->utility->get_image_dimensions( $images ) ) { 73 | $images_args = array( 74 | "image" => $this->set_image_object( $images, $size['width'], $size['height'] ) 75 | ); 76 | $args = array_merge( $args, $images_args ); 77 | } 78 | } elseif ( isset( $options['default_image'] ) ) { 79 | if ($size = $this->utility->get_image_dimensions( $options['default_image'] ) ) { 80 | $images_args = array( 81 | "image" => $this->set_image_object( esc_html( $options['default_image'] ), $size['width'], $size['height'] ) 82 | ); 83 | $args = array_merge( $args, $images_args ); 84 | } 85 | } 86 | } elseif ( isset( $options['default_image'] ) ) { 87 | if ( $size = $this->utility->get_image_dimensions( $options['default_image'] ) ) { 88 | $images_args = array( 89 | "image" => $this->set_image_object( esc_html( $options['default_image'] ), $size['width'], $size['height'] ) 90 | ); 91 | $args = array_merge( $args, $images_args ); 92 | } 93 | } 94 | 95 | if ( isset( $options['name'] ) && !empty( $options['name'] ) ) { 96 | $publisher_args = array( 97 | "publisher" => array( 98 | "@type" => "Organization", 99 | "name" => esc_html( $options['name'] ), 100 | ) 101 | ); 102 | 103 | $options['logo'] = isset( $options['logo'] ) ? esc_html( $options['logo'] ) : ""; 104 | 105 | if ( $logo = $this->utility->get_image_dimensions( $options['logo'] ) ) { 106 | $publisher_args['publisher']['logo'] = $this->set_image_object( $options['logo'], $logo['width'], $logo['height'] ); 107 | } else if ( !empty( $options['logo'] ) ) { 108 | $publisher_args['publisher']['logo'] = $this->set_image_object( 109 | $options['logo'], 110 | isset( $options['logo-width'] ) ? ( int ) $options['logo-width'] : 0, 111 | isset( $options['logo-height'] ) ? ( int ) $options['logo-height'] : 0 112 | ); 113 | } 114 | $args = array_merge( $args, $publisher_args ); 115 | } 116 | 117 | if ( isset( $options['speakable_action'] ) && $options['speakable_action'] === 'on' ) { 118 | $speakable_type = isset( $options['speakable_type'] ) ? $options['speakable_type'] : ''; 119 | 120 | if ( !empty( $speakable_type ) ) { 121 | $action_array = array( 122 | "@type" => "SpeakableSpecification" 123 | ); 124 | $action_array[$speakable_type] = array( 125 | isset( $options['speakable_headline'] ) ? stripslashes( $options['speakable_headline'] ) : '', 126 | isset( $options['speakable_summary'] ) ? stripslashes( $options['speakable_summary'] ) : '' 127 | ); 128 | $args['speakable'] = $action_array; 129 | } 130 | } 131 | 132 | return ( array ) $args; 133 | } 134 | 135 | /** 136 | * Setting ImageObject 137 | * 138 | * @version 4.7.0 139 | * @since 4.7.0 140 | * @param string $url 141 | * @param integer $width 142 | * @param integer $height 143 | * @return array $args 144 | */ 145 | public function set_image_object ( $url, $width, $height ) { 146 | $args = array( 147 | "@type" => "ImageObject", 148 | "url" => $url, 149 | "width" => $width, 150 | "height" => $height 151 | ); 152 | 153 | return ( array ) $args; 154 | } 155 | } -------------------------------------------------------------------------------- /includes/meta/wp-structuring-meta-organization.php: -------------------------------------------------------------------------------- 1 | 'https://schema.org', 25 | '@type' => isset( $options['organization_type'] ) ? esc_html( $options['organization_type'] ) : 'Organization', 26 | 'name' => isset( $options['name'] ) ? esc_html( $options['name'] ) : '', 27 | 'url' => isset( $options['url'] ) ? esc_url( $options['url'] ) : '', 28 | 'logo' => isset( $options['logo'] ) ? esc_url( $options['logo'] ) : '' 29 | ); 30 | 31 | /** Corporate Contact */ 32 | if ( isset( $options['contact_point'] ) && $options['contact_point'] === 'on' ) { 33 | $contact_point_data = array( 34 | '@type' => 'ContactPoint', 35 | 'telephone' => isset( $options['telephone'] ) ? esc_html( $options['telephone'] ) : '', 36 | 'contactType' => isset( $options['contact_type'] ) ? esc_html( $options['contact_type'] ) : '' 37 | ); 38 | 39 | if ( !empty( $options['email'] ) ) { 40 | $contact_point_data['email'] = isset( $options['email'] ) ? esc_html( $options['email'] ) : ''; 41 | } 42 | if ( !empty( $options['area_served'] ) ) { 43 | $array = explode( ',', esc_html( $options['area_served'] ) ); 44 | for ( $i = 0; $i < count( $array ); $i++ ) { 45 | $contact_point_data['areaServed'][] = isset( $options['area_served'] ) ? $array[$i] : ''; 46 | } 47 | } 48 | if ( isset( $options['contact_point_1'] ) && $options['contact_point_1'] === 'on' ) { 49 | $contact_point_data['contactOption'][] = 'HearingImpairedSupported'; 50 | } 51 | if ( isset( $options['contact_point_2'] ) && $options['contact_point_2'] === 'on' ) { 52 | $contact_point_data['contactOption'][] = 'TollFree'; 53 | } 54 | if ( !empty( $options['available_language'] ) ) { 55 | $array = explode( ',', esc_html( $options['available_language'] ) ); 56 | for ( $i = 0; $i < count( $array ); $i++ ) { 57 | $contact_point_data['availableLanguage'][] = isset( $options['available_language'] ) ? $array[$i] : ''; 58 | } 59 | } 60 | 61 | $contact_point['contactPoint'] = array( $contact_point_data ); 62 | $args = array_merge( $args, $contact_point ); 63 | } 64 | 65 | /** Social Profiles */ 66 | if ( isset( $options['social'] ) ) { 67 | $socials['sameAs'] = array(); 68 | 69 | foreach ( $options['social'] as $value ) { 70 | if ( $value ) { 71 | $socials['sameAs'][] = esc_url( $value ); 72 | } 73 | } 74 | if ( count( $socials['sameAs'] ) > 0 ) { 75 | $args = array_merge( $args, $socials ); 76 | } 77 | } 78 | return (array) $args; 79 | } 80 | } -------------------------------------------------------------------------------- /includes/meta/wp-structuring-meta-person.php: -------------------------------------------------------------------------------- 1 | "https://schema.org", 25 | "@type" => "Person", 26 | "name" => isset( $options['name'] ) ? esc_html( $options['name'] ) : "", 27 | "url" => isset( $options['url'] ) ? esc_url( $options['url'] ) : "" 28 | ); 29 | 30 | /** Place */ 31 | if ( isset( $options['addressCountry'] ) ) { 32 | $place["homeLocation"] = array( 33 | "@type" => "Place", 34 | "address" => array( 35 | "@type" => "PostalAddress", 36 | "addressCountry" => $options['addressCountry'] 37 | ) 38 | ); 39 | $args = array_merge( $args, $place ); 40 | } 41 | 42 | /** Social Profiles */ 43 | if ( isset( $options['social'] ) ) { 44 | $socials["sameAs"] = array(); 45 | 46 | foreach ( $options['social'] as $value ) { 47 | if ( !empty( $value ) ) { 48 | $socials["sameAs"][] = esc_html( $value ); 49 | } 50 | } 51 | if ( count( $socials["sameAs"] ) > 0 ) { 52 | $args = array_merge( $args, $socials ); 53 | } 54 | } 55 | return (array) $args; 56 | } 57 | } -------------------------------------------------------------------------------- /includes/meta/wp-structuring-meta-site-navigation.php: -------------------------------------------------------------------------------- 1 | $menu_item ) { 27 | $url_array[] = $menu_item->url; 28 | $name_array[] = $menu_item->title; 29 | } 30 | 31 | if ( count( $items_array ) > 0 ) { 32 | $args = array( 33 | "@context" => "https://schema.org", 34 | "@type" => "SiteNavigationElement", 35 | "name" => $name_array, 36 | "url" => $url_array 37 | ); 38 | return (array) $args; 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /includes/meta/wp-structuring-meta-video.php: -------------------------------------------------------------------------------- 1 | utility = $utility; 30 | } 31 | 32 | /** 33 | * Setting schema.org Video 34 | * 35 | * @version 4.8.1 36 | * @since 4.0.0 37 | * @return array $args 38 | */ 39 | public function set_meta () { 40 | global $post; 41 | $meta = get_post_meta( $post->ID, 'schema_video_post', false ); 42 | 43 | if ( isset( $meta[0] ) ) { 44 | $meta = unserialize( $meta[0] ); 45 | 46 | if ( has_post_thumbnail( $post->ID ) ) { 47 | $images = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); 48 | $excerpt = $this->utility->escape_text( $post->post_excerpt ); 49 | $content = $excerpt === "" ? mb_substr( $this->utility->escape_text( $post->post_content ), 0, 110 ) : $excerpt; 50 | } else { 51 | $images[0] = ''; 52 | $content = ''; 53 | } 54 | 55 | /* required items */ 56 | if ( !isset( $meta['schema_video_name']) ) $meta['schema_video_name'] = esc_html( $post->post_title ); 57 | if ( !isset( $meta['schema_video_description'] ) ) $meta['schema_video_description'] = esc_html( $content ); 58 | if ( !isset( $meta['schema_video_thumbnail_url'] ) ) $meta['schema_video_description'] = esc_html( $images[0] ); 59 | if ( !isset( $meta['schema_video_upload_date'] ) ) $meta['schema_video_upload_date'] = get_post_modified_time( 'Y-m-d', __return_false(), $post->ID ); 60 | if ( !isset( $meta['schema_video_upload_time'] ) ) $meta['schema_video_upload_time'] = get_post_modified_time( 'H:i:s', __return_false(), $post->ID ); 61 | 62 | $args = array( 63 | "@context" => "https://schema.org", 64 | "@type" => "VideoObject", 65 | "name" => esc_html( $meta['schema_video_name'] ), 66 | "description" => esc_html( $meta['schema_video_description'] ), 67 | "thumbnailUrl" => esc_html( $meta['schema_video_thumbnail_url'] ), 68 | "uploadDate" => esc_html( $meta['schema_video_upload_date'] ) . 'T' . esc_html( $meta['schema_video_upload_time'] ) 69 | ); 70 | 71 | /* recommended items */ 72 | if ( isset( $meta['schema_video_duration'] ) && $meta['schema_video_duration'] !== '' ) { 73 | $args["duration"] = esc_html( $meta['schema_video_duration'] ); 74 | } 75 | if ( isset( $meta['schema_video_content_url'] ) && $meta['schema_video_content_url'] !== '' ) { 76 | $args["contentUrl"] = esc_url( $meta['schema_video_content_url'] ); 77 | } 78 | if ( isset( $meta['schema_video_embed_url'] ) && $meta['schema_video_embed_url'] !== '' ) { 79 | $args["embedUrl"] = esc_url( $meta['schema_video_embed_url'] ); 80 | } 81 | if ( isset( $meta['schema_video_interaction_count'] ) && $meta['schema_video_interaction_count'] !== '' ) { 82 | $args["interactionCount"] = esc_html( $meta['schema_video_interaction_count'] ); 83 | } 84 | if ( isset( $meta['schema_video_expires_date'] ) && $meta['schema_video_expires_date'] !== '' && isset( $meta['schema_video_expires_time'] ) && $meta['schema_video_expires_time'] !== '' ) { 85 | $args["expires"] = esc_html( $meta['schema_video_expires_date'] ) . 'T' . esc_html( $meta['schema_video_expires_time'] ); 86 | } 87 | return (array) $args; 88 | } 89 | } 90 | } -------------------------------------------------------------------------------- /includes/meta/wp-structuring-meta-website.php: -------------------------------------------------------------------------------- 1 | "https://schema.org", 25 | "@type" => "WebSite", 26 | "name" => isset( $options['name'] ) ? esc_html( $options['name'] ) : '', 27 | "alternateName" => isset( $options['alternateName'] ) ? esc_html( $options['alternateName'] ) : '', 28 | "url" => isset( $options['url'] ) ? esc_url( $options['url'] ) : '' 29 | ); 30 | 31 | $search_array = array(); 32 | 33 | if ( isset( $options['potential_action'] ) && $options['potential_action'] === 'on' ) { 34 | $action_array = array( 35 | "@type" => "SearchAction", 36 | "target" => isset( $options['target'] ) ? esc_url( $options['target'] ) . "{search_term_string}" : '', 37 | "query-input" => isset( $options['target'] ) ? "required name=search_term_string" : '' 38 | ); 39 | $search_array[] = $action_array; 40 | } 41 | 42 | if ( count( $search_array ) > 0 ) { 43 | if ( isset( $options['potential_action_app'] ) && $options['potential_action_app'] === 'on' ) { 44 | $action_array = array( 45 | "@type" => "SearchAction", 46 | "target" => isset( $options['target_app'] ) ? $options['target_app'] . "{search_term_string}" : '', 47 | "query-input" => isset( $options['target_app'] ) ? "required name=search_term_string" : '' 48 | ); 49 | $search_array[] = $action_array; 50 | } 51 | 52 | $potential_action["potentialAction"] = $search_array; 53 | $args = array_merge( $args, $potential_action ); 54 | } 55 | 56 | return (array) $args; 57 | } 58 | } -------------------------------------------------------------------------------- /includes/wp-structuring-display-amp.php: -------------------------------------------------------------------------------- 1 | utility = new Structuring_Markup_Utility(); 36 | 37 | $db = new Structuring_Markup_Admin_Db(); 38 | $this->set_schema( $db ); 39 | } 40 | 41 | /** 42 | * Setting schema.org 43 | * 44 | * @version 4.0.0 45 | * @since 4.0.0 46 | * @param Structuring_Markup_Admin_Db $db 47 | */ 48 | private function set_schema ( Structuring_Markup_Admin_Db $db ) { 49 | $structuring_markup_args = $db->get_list_options(); 50 | 51 | if ( is_single() && get_post_type() === 'post' ) { 52 | $this->get_schema_data( 'amp', $structuring_markup_args ); 53 | } 54 | } 55 | 56 | /** 57 | * Setting JSON-LD Template 58 | * 59 | * @version 4.0.0 60 | * @since 4.0.0 61 | * @param string $output 62 | * @param array $structuring_markup_args 63 | */ 64 | private function get_schema_data ( $output, array $structuring_markup_args ) { 65 | 66 | foreach ( $structuring_markup_args as $row ) { 67 | /** Output page check. */ 68 | $output_args = unserialize( $row->output ); 69 | if ( array_key_exists( $output, $output_args ) ) { 70 | 71 | /** Activate check. */ 72 | if ( isset( $row->type ) && isset( $row->activate ) && $row->activate === 'on' ) { 73 | switch ( $row->type ) { 74 | case 'article': 75 | if ( isset( $row->options ) && $row->options ) { 76 | require_once( plugin_dir_path( __FILE__ ) . 'meta/wp-structuring-meta-article.php' ); 77 | $obj = new Structuring_Markup_Meta_Article( $this->utility ); 78 | $this->json_ld = $obj->set_meta( unserialize( $row->options ) ); 79 | } 80 | break; 81 | case 'blog_posting': 82 | if ( isset( $row->options ) && $row->options ) { 83 | require_once( plugin_dir_path( __FILE__ ) . 'meta/wp-structuring-meta-blog-posting.php' ); 84 | $obj = new Structuring_Markup_Meta_Blog_Posting( $this->utility ); 85 | $this->json_ld = $obj->set_meta( unserialize( $row->options ) ); 86 | } 87 | break; 88 | case 'news_article': 89 | if ( isset( $row->options ) && $row->options ) { 90 | require_once( plugin_dir_path( __FILE__ ) . 'meta/wp-structuring-meta-news-article.php' ); 91 | $obj = new Structuring_Markup_Meta_NewsArticle( $this->utility ); 92 | $this->json_ld = $obj->set_meta( unserialize( $row->options ) ); 93 | } 94 | break; 95 | } 96 | } 97 | } 98 | } 99 | } 100 | } -------------------------------------------------------------------------------- /includes/wp-structuring-display.php: -------------------------------------------------------------------------------- 1 | utility = new Structuring_Markup_Utility(); 39 | 40 | $this->options = get_option( $text_domain ); 41 | 42 | $db = new Structuring_Markup_Admin_Db(); 43 | $this->set_schema( $db, $version ); 44 | } 45 | 46 | /** 47 | * Setting schema.org 48 | * 49 | * @version 4.5.0 50 | * @since 1.0.0 51 | * @param Structuring_Markup_Admin_Db $db 52 | * @param string $version 53 | */ 54 | private function set_schema ( Structuring_Markup_Admin_Db $db, $version ) { 55 | $structuring_markup_args = $db->get_list_options(); 56 | 57 | if ( !isset( $this->options['compress'] ) || $this->options['compress'] !== 'on' ) { 58 | echo '' . PHP_EOL; 59 | } 60 | 61 | $this->get_schema_data( 'all', $structuring_markup_args ); 62 | if ( is_home() || is_front_page() ) { 63 | $this->get_schema_data( 'home', $structuring_markup_args ); 64 | } 65 | if ( is_single() && get_post_type() === 'post' ) { 66 | $this->get_schema_data( 'post', $structuring_markup_args ); 67 | } 68 | if ( is_singular( 'schema_event_post' ) ) { 69 | $this->get_schema_data( 'event', $structuring_markup_args ); 70 | } 71 | if ( is_singular( 'schema_video_post' ) ) { 72 | $this->get_schema_data( 'video', $structuring_markup_args ); 73 | } 74 | if ( is_page() ) { 75 | $this->get_schema_data( 'page', $structuring_markup_args ); 76 | } 77 | $args = array( 78 | 'public' => true, 79 | '_builtin' => false 80 | ); 81 | $post_types = get_post_types( $args, 'objects' ); 82 | 83 | unset( $post_types['schema_event_post'] ); 84 | unset( $post_types['schema_video_post'] ); 85 | 86 | foreach ( $post_types as $post_type ) { 87 | if ( is_singular( $post_type->name ) ) { 88 | $this->get_schema_data( $post_type->name, $structuring_markup_args ); 89 | } 90 | } 91 | 92 | if ( !isset( $this->options['compress'] ) || $this->options['compress'] !== 'on' ) { 93 | echo '' . PHP_EOL; 94 | } 95 | } 96 | 97 | /** 98 | * Setting JSON-LD Template 99 | * 100 | * @version 4.6.3 101 | * @since 1.0.0 102 | * @param string $output 103 | * @param array $structuring_markup_args 104 | */ 105 | private function get_schema_data ( $output, array $structuring_markup_args ) { 106 | 107 | foreach ( $structuring_markup_args as $row ) { 108 | /** Output page check. */ 109 | $output_args = unserialize( $row->output ); 110 | if ( array_key_exists( $output, $output_args ) ) { 111 | 112 | /** Activate check. */ 113 | if ( isset( $row->type ) && isset( $row->activate ) && $row->activate === 'on' ) { 114 | switch ( $row->type ) { 115 | case 'article': 116 | if ( isset( $row->options ) && $row->options ) { 117 | require_once( plugin_dir_path( __FILE__ ) . 'meta/wp-structuring-meta-article.php' ); 118 | $obj = new Structuring_Markup_Meta_Article( $this->utility ); 119 | $out = $obj->set_meta( unserialize( $row->options ) ); 120 | $out = apply_filters( 'structuring_markup_meta_article', $out ); 121 | $this->set_schema_json( $out ); 122 | } 123 | break; 124 | case 'blog_posting': 125 | if ( isset( $row->options ) && $row->options ) { 126 | require_once( plugin_dir_path( __FILE__ ) . 'meta/wp-structuring-meta-blog-posting.php' ); 127 | $obj = new Structuring_Markup_Meta_Blog_Posting( $this->utility ); 128 | $out = $obj->set_meta( unserialize( $row->options ) ); 129 | $out = apply_filters( 'structuring_markup_meta_blog_posting', $out ); 130 | $this->set_schema_json( $out ); 131 | } 132 | break; 133 | case 'breadcrumb': 134 | if ( isset( $row->options ) && $row->options ) { 135 | require_once( plugin_dir_path( __FILE__ ) . 'meta/wp-structuring-meta-breadcrumb.php' ); 136 | require_once( plugin_dir_path( __FILE__ ) . 'wp-structuring-short-code-breadcrumb.php' ); 137 | $obj = new Structuring_Markup_Meta_Breadcrumb(); 138 | $out = $obj->set_meta( unserialize( $row->options ) ); 139 | $out = apply_filters( 'structuring_markup_meta_breadcrumb', $out ); 140 | $this->set_schema_json( $out ); 141 | } 142 | break; 143 | case 'event': 144 | require_once( plugin_dir_path( __FILE__ ) . 'meta/wp-structuring-meta-event.php' ); 145 | $obj = new Structuring_Markup_Meta_Event(); 146 | $out = $obj->set_meta(); 147 | $out = apply_filters( 'structuring_markup_meta_event', $out ); 148 | $this->set_schema_json( $out ); 149 | break; 150 | case 'local_business': 151 | if ( isset( $row->options ) && $row->options ) { 152 | require_once( plugin_dir_path( __FILE__ ) . 'meta/wp-structuring-meta-local-business.php' ); 153 | require_once( plugin_dir_path( __FILE__ ) . 'wp-structuring-opening-hours.php' ); 154 | $obj = new Structuring_Markup_Meta_LocalBusiness(); 155 | $out = $obj->set_meta( unserialize( $row->options ) ); 156 | $out = apply_filters( 'structuring_markup_meta_local_business', $out ); 157 | $this->set_schema_json( $out ); 158 | } 159 | break; 160 | case 'news_article': 161 | if ( isset( $row->options ) && $row->options ) { 162 | require_once( plugin_dir_path( __FILE__ ) . 'meta/wp-structuring-meta-news-article.php' ); 163 | $obj = new Structuring_Markup_Meta_NewsArticle( $this->utility ); 164 | $out = $obj->set_meta( unserialize( $row->options ) ); 165 | $out = apply_filters( 'structuring_markup_meta_news_article', $out ); 166 | $this->set_schema_json( $out ); 167 | } 168 | break; 169 | case 'organization': 170 | if ( isset( $row->options ) && $row->options ) { 171 | require_once( plugin_dir_path( __FILE__ ) . 'meta/wp-structuring-meta-organization.php' ); 172 | $obj = new Structuring_Markup_Meta_Organization(); 173 | $out = $obj->set_meta( unserialize( $row->options ) ); 174 | $out = apply_filters( 'structuring_markup_meta_organization', $out ); 175 | $this->set_schema_json( $out ); 176 | } 177 | break; 178 | case 'person': 179 | if ( isset( $row->options ) && $row->options ) { 180 | require_once( plugin_dir_path( __FILE__ ) . 'meta/wp-structuring-meta-person.php' ); 181 | $obj = new Structuring_Markup_Meta_Person(); 182 | $out = $obj->set_meta( unserialize( $row->options ) ); 183 | $out = apply_filters( 'structuring_markup_meta_person', $out ); 184 | $this->set_schema_json( $out ); 185 | } 186 | break; 187 | case 'site_navigation': 188 | if ( isset( $row->options ) && $row->options ) { 189 | require_once( plugin_dir_path( __FILE__ ) . 'meta/wp-structuring-meta-site-navigation.php' ); 190 | $obj = new Structuring_Markup_Meta_Site_Navigation(); 191 | $out = $obj->set_meta( unserialize( $row->options ) ); 192 | $out = apply_filters( 'structuring_markup_meta_site_navigation', $out ); 193 | $this->set_schema_json( $out ); 194 | } 195 | break; 196 | case 'video': 197 | require_once( plugin_dir_path( __FILE__ ) . 'meta/wp-structuring-meta-video.php' ); 198 | $obj = new Structuring_Markup_Meta_Video( $this->utility ); 199 | $out = $obj->set_meta(); 200 | $out = apply_filters( 'structuring_markup_meta_video', $out ); 201 | $this->set_schema_json( $out ); 202 | break; 203 | case 'website': 204 | if ( isset( $row->options ) && $row->options ) { 205 | require_once( plugin_dir_path( __FILE__ ) . 'meta/wp-structuring-meta-website.php' ); 206 | $obj = new Structuring_Markup_Meta_WebSite(); 207 | $out = $obj->set_meta( unserialize( $row->options ) ); 208 | $out = apply_filters( 'structuring_markup_meta_website', $out ); 209 | $this->set_schema_json( $out ); 210 | } 211 | break; 212 | } 213 | } 214 | } 215 | } 216 | } 217 | 218 | /** 219 | * Setting JSON-LD Template 220 | * 221 | * @since 4.6.4 222 | * @since 1.0.0 223 | * @param array $args 224 | * @param boolean $error 225 | */ 226 | private function set_schema_json ( $args, $error = false ) { 227 | if ( $error ) { 228 | /** Error Display */ 229 | if ( isset( $args["@type"] ) ) { 230 | foreach ( $args["message"] as $message ) { 231 | echo "", PHP_EOL; 232 | } 233 | } 234 | } else { 235 | $output = ''; 236 | if ( is_array( $args ) ) { 237 | if ( isset( $this->options['compress'] ) && $this->options['compress'] === 'on' ) { 238 | $output .= ''; 241 | } else { 242 | $output .= '' . PHP_EOL; 245 | } 246 | } 247 | echo apply_filters( 'structuring_markup_output', $output ); 248 | } 249 | } 250 | } 251 | -------------------------------------------------------------------------------- /includes/wp-structuring-opening-hours.php: -------------------------------------------------------------------------------- 1 | opening_hours = $opening_hours; 64 | $this->init(); 65 | } 66 | } 67 | 68 | /** 69 | * Initialize the class 70 | * 71 | * @since 2.4.0 72 | */ 73 | public function init () { 74 | $this->days = array_keys( $this->opening_hours ); 75 | $this->periods = $this->group_periods(); 76 | $this->grouped_days = $this->group_periods_with_days(); 77 | $this->weekly_hours = $this->group_weekly_hours(); 78 | } 79 | 80 | /** 81 | * Groups unique open and closed hour periods 82 | * 83 | * @since 2.4.0 84 | * @return array 85 | */ 86 | public function group_periods () { 87 | $periods = array(); 88 | foreach( $this->opening_hours as $day ) { 89 | foreach( $day as $group ) { 90 | if( !in_array( $group, $periods ) ) { 91 | if( !empty( $group['open'] ) && !empty( $group['close'] ) ) { 92 | $periods[] = $group; 93 | } 94 | } 95 | } 96 | } 97 | 98 | return (array) $periods; 99 | } 100 | 101 | /** 102 | * Groups day ranges with their opening hours 103 | * 104 | * @since 2.4.0 105 | * @return array 106 | */ 107 | public function group_periods_with_days () { 108 | $periods = $this->periods; 109 | 110 | foreach( $periods as $key => $group ) { 111 | $days = array(); 112 | 113 | foreach( $this->opening_hours as $day => $grouped_days ) { 114 | if( in_array( $group, $grouped_days) ) { 115 | $days[] = $day; 116 | } 117 | } 118 | 119 | $periods[$key]['days'] = $days; 120 | } 121 | 122 | return (array) $periods; 123 | } 124 | 125 | /** 126 | * Group weekly group ranges with their opening hours 127 | * 128 | * @since 2.4.0 129 | * @return array 130 | */ 131 | public function group_weekly_hours () { 132 | $grouped_days = $this->grouped_days; 133 | $days = $this->days; 134 | $object = $this; 135 | 136 | return (array) array_reduce( $grouped_days, function($result, $group) use ( $days, $object ) { 137 | return array_merge( $result, $object->group_periods_to_day_range( $group ) ); 138 | }, array() ); 139 | } 140 | 141 | /** 142 | * Groups days of the week with their opening hours 143 | * 144 | * @since 2.4.0 145 | * @param array $group 146 | * @return array 147 | */ 148 | public function group_periods_to_day_range ( array $group ) { 149 | $starting_day = null; 150 | $ending_day = null; 151 | 152 | $consecutive_days = array(); 153 | 154 | foreach( $this->days as $i => $day ) { 155 | $has_day = in_array( $day, $group['days'] ); 156 | 157 | if( $has_day ) { 158 | $starting_day = $starting_day ? $starting_day : $day; 159 | $ending_day = $day; 160 | } 161 | 162 | if( $starting_day && (!$has_day || $i == count($this->days) - 1) ) { 163 | $consecutive_days[] = array( 164 | 'start' => $starting_day, 165 | 'end' => $ending_day, 166 | 'open' => $group['open'], 167 | 'close' => $group['close'] 168 | ); 169 | 170 | $starting_day = null; 171 | } 172 | } 173 | 174 | return (array) $this->sort_by_day_of_the_week( $consecutive_days ); 175 | } 176 | 177 | /** 178 | * Sorts our days in the proper weekly hour 179 | * 180 | * @version 4.8.0 181 | * @since 2.4.0 182 | * @param array $consecutive_days 183 | * @return array 184 | */ 185 | public function sort_by_day_of_the_week ( array $consecutive_days ) { 186 | $days = $this->days; 187 | 188 | arsort( $consecutive_days ); 189 | 190 | $sort_by_day_func = function( $a, $b ) use ( $days ) { 191 | $aKey = array_search( $a['start'], $days ); 192 | $bKey = array_search( $b['start'], $days ); 193 | 194 | if ( $aKey < $bKey ) { 195 | return -1; 196 | } else { 197 | return 1; 198 | } 199 | }; 200 | 201 | usort( $consecutive_days, $sort_by_day_func ); 202 | 203 | return (array) $consecutive_days; 204 | } 205 | 206 | /** 207 | * Displays formatted opening hours 208 | * 209 | * @since 2.4.0 210 | * @return array 211 | */ 212 | public function display () { 213 | $opening_hours = array(); 214 | 215 | foreach( $this->weekly_hours as $key => $group ) { 216 | if( $group['start'] != $group['end'] ) { 217 | $hours = $group['start'].'-'.$group['end']; 218 | } else { 219 | $hours = $group['start']; 220 | } 221 | 222 | $hours .= ' ' . $group['open'] . '-' . $group['close']; 223 | 224 | $opening_hours[] = $hours; 225 | } 226 | 227 | return (array) $opening_hours; 228 | } 229 | 230 | } -------------------------------------------------------------------------------- /includes/wp-structuring-short-code-breadcrumb.php: -------------------------------------------------------------------------------- 1 | "", 24 | 'class' => "" 25 | ), $args ) ); 26 | 27 | $instance = array( 28 | 'id' => esc_attr( $id ), 29 | 'class' => esc_attr( $class ) 30 | ); 31 | 32 | $item_array = $this->breadcrumb_array_setting( $options ); 33 | $html = ''; 34 | 35 | if ( isset( $item_array ) && count( $item_array ) > 0 ) { 36 | $html .= '' . PHP_EOL; 37 | 38 | if ( $id !== '' && $class !== '' ) { 39 | $html .= '
    '; 40 | } else if ( $id !== '' && $class === '' ) { 41 | $html .= '
      '; 42 | } else if ( $id === '' && $class !== '' ) { 43 | $html .= '
        '; 44 | } else { 45 | $html .= '
          '; 46 | } 47 | $html .= PHP_EOL; 48 | 49 | $count = 1; 50 | $length = count( $item_array ); 51 | foreach ( $item_array as $item ) { 52 | $html .= '
        1. '; 53 | if ( $count === $length && ( !isset( $options['current_link'] ) || $options['current_link'] !== 'on' ) ) { 54 | $html .= $item['name']; 55 | } else { 56 | $html .= ''; 57 | $html .= $item['name']; 58 | $html .= ''; 59 | } 60 | $html .= '
        2. ' . PHP_EOL; 61 | $count++; 62 | } 63 | $html .= '
        ' . PHP_EOL; 64 | $html .= '' . PHP_EOL; 65 | } 66 | 67 | return (string) $html; 68 | } 69 | 70 | /** 71 | * Breadcrumb array setting. 72 | * 73 | * @version 4.7.0 74 | * @since 2.0.0 75 | * @access public 76 | * @param array $options 77 | * @return array $item_array 78 | */ 79 | public function breadcrumb_array_setting ( array $options ) { 80 | global $post; 81 | 82 | /** item build */ 83 | $item_array = array(); 84 | 85 | if ( isset( $options['home_url'] ) ) { 86 | switch ( $options['home_url'] ) { 87 | case 'site_url': 88 | $current_url = esc_url( site_url() . $_SERVER['REQUEST_URI'] ); 89 | break; 90 | default: 91 | $current_url = esc_url( home_url() . $_SERVER['REQUEST_URI'] ); 92 | break; 93 | } 94 | } else { 95 | $current_url = esc_url( home_url() . $_SERVER['REQUEST_URI'] ); 96 | } 97 | 98 | if ( get_option( 'show_on_front' ) === 'page' ) { 99 | $front_page_id = get_option( 'page_on_front' ); 100 | } else { 101 | $front_page_id = null; 102 | } 103 | 104 | if ( isset( $options['home_on'] ) && $options['home_on'] === 'on' ) { 105 | if ( isset( $options['home_name'] ) && $options['home_name'] !== '' ) { 106 | $item_array[] = $this->set_schema_breadcrumb_item( home_url(), $options['home_name'] ); 107 | } else { 108 | if ( is_null( $front_page_id ) ) { 109 | $item_array[] = $this->set_schema_breadcrumb_item( home_url(), get_bloginfo( 'name' ) ); 110 | } else { 111 | $front_page = get_post( $front_page_id ); 112 | $item_array[] = $this->set_schema_breadcrumb_item( home_url(), $front_page->post_title ); 113 | } 114 | } 115 | } 116 | 117 | if ( is_search() ) { 118 | $search_query = get_search_query(); 119 | if ( $search_query !== '' ) { 120 | $item_array[] = $this->set_schema_breadcrumb_item( $current_url, get_search_query() ); 121 | } 122 | } elseif ( is_tag() ) { 123 | $item_array[] = $this->set_schema_breadcrumb_item( $current_url, single_tag_title( '', false ) ); 124 | } elseif ( is_date() ) { 125 | $item_array[] = $this->set_schema_breadcrumb_item( get_year_link( get_query_var( 'year' ) ), get_query_var( 'year' ) ); 126 | if ( get_query_var( 'day' ) !== 0 ) { 127 | $item_array[] = $this->set_schema_breadcrumb_item( get_month_link( get_query_var( 'year' ), get_query_var( 'monthnum' ) ), get_query_var( 'monthnum' ) ); 128 | $item_array[] = $this->set_schema_breadcrumb_item( get_day_link( get_query_var( 'year' ), get_query_var( 'monthnum' ), get_query_var( 'day' ) ), get_query_var( 'day' ) ); 129 | } elseif ( get_query_var( 'monthnum' ) !== 0 ) { 130 | $item_array[] = $this->set_schema_breadcrumb_item( get_month_link( get_query_var( 'year' ), get_query_var( 'monthnum' ) ), get_query_var( 'monthnum' ) ); 131 | } 132 | } elseif ( is_category() ) { 133 | $categories = get_queried_object(); 134 | if( $categories->parent !== 0 ) { 135 | $ancestors = array_reverse( get_ancestors( $categories->cat_ID, 'category' ) ); 136 | foreach( $ancestors as $ancestor ) { 137 | $item_array[] = $this->set_schema_breadcrumb_item( get_category_link( $ancestor ), get_cat_name( $ancestor ) ); 138 | } 139 | } 140 | $item_array[] = $this->set_schema_breadcrumb_item( get_category_link( $categories->term_id ), $categories->name ); 141 | } elseif ( is_author() ) { 142 | $item_array[] = $this->set_schema_breadcrumb_item( $current_url, get_the_author_meta( 'display_name', get_query_var( 'author' ) ) ); 143 | } elseif ( is_page() && (int) $front_page_id !== $post->ID ) { 144 | if( $post->post_parent !== 0 ) { 145 | $ancestors = array_reverse( get_post_ancestors( $post->ID ) ); 146 | foreach( $ancestors as $ancestor ) { 147 | if ( (int) $front_page_id !== $ancestor ) { 148 | $item_array[] = $this->set_schema_breadcrumb_item( get_permalink( $ancestor ), get_the_title( $ancestor ) ); 149 | } 150 | } 151 | } 152 | $item_array[] = $this->set_schema_breadcrumb_item( $current_url, $post->post_title ); 153 | } elseif ( is_attachment() ) { 154 | if ( $post->post_parent !== 0 ) { 155 | $item_array[] = $this->set_schema_breadcrumb_item( get_permalink( $post->post_parent ), get_the_title( $post->post_parent ) ); 156 | } 157 | $item_array[] = $this->set_schema_breadcrumb_item( $current_url, $post->post_title ); 158 | } elseif ( is_404() ) { 159 | $item_array[] = $this->set_schema_breadcrumb_item( $current_url, wp_get_document_title() ); 160 | } elseif ( is_post_type_archive() ) { 161 | if ( get_post_type_archive_link( get_post_type() ) ) { 162 | $item_array[] = $this->set_schema_breadcrumb_item( get_post_type_archive_link( get_post_type() ), post_type_archive_title( '', false) ); 163 | } 164 | } elseif ( is_archive() ) { 165 | if ( get_post_type_archive_link( get_post_type() ) ) { 166 | $item_array[] = $this->set_schema_breadcrumb_item( get_post_type_archive_link( get_post_type() ), get_post_type_object( get_post_type() )->label ); 167 | } 168 | if( is_tax() ){ 169 | $tax_slug = get_query_var( 'taxonomy' ); 170 | $term_slug = get_query_var( 'term' ); 171 | $term = get_term_by( "slug", $term_slug, $tax_slug ); 172 | 173 | if( $term->parent !== 0 ) { 174 | $ancestors = array_reverse( get_ancestors( $term->term_taxonomy_id, $tax_slug ) ); 175 | foreach( $ancestors as $ancestor ) { 176 | $ancestor_term = get_term( $ancestor, $tax_slug ); 177 | $item_array[] = $this->set_schema_breadcrumb_item( get_term_link( $ancestor ), $ancestor_term->name ); 178 | } 179 | } 180 | $item_array[] = $this->set_schema_breadcrumb_item( get_term_link( $term_slug, $tax_slug ), $term->name ); 181 | } 182 | } elseif ( is_singular( 'post' ) ) { 183 | $args = $this->set_taxonomy_item( $post->ID, 'category' ); 184 | if ( count( $args ) > 0 ) { 185 | $item_array = array_merge( $item_array, $args ); 186 | } 187 | $item_array[] = $this->set_schema_breadcrumb_item( $current_url, $post->post_title ); 188 | } elseif ( is_single() ) { 189 | if ( get_post_type_archive_link( get_post_type() ) ) { 190 | $item_array[] = $this->set_schema_breadcrumb_item( get_post_type_archive_link( get_post_type() ), get_post_type_object( get_post_type() )->label ); 191 | } 192 | $taxonomy_names = get_post_taxonomies(); 193 | if ( count( $taxonomy_names ) > 0 ) { 194 | $args = $this->set_taxonomy_item( $post->ID, $taxonomy_names[0] ); 195 | if ( count( $args ) > 0 ) { 196 | $item_array = array_merge( $item_array, $args ); 197 | } 198 | } 199 | $item_array[] = $this->set_schema_breadcrumb_item( $current_url, $post->post_title ); 200 | } 201 | 202 | if ( !isset( $options['current_on'] ) || $options['current_on'] !== 'on' ) { 203 | array_pop( $item_array ); 204 | } 205 | 206 | return (array) $item_array; 207 | } 208 | 209 | /** 210 | * taxonomy item settings 211 | * 212 | * @version 4.7.0 213 | * @since 4.0.0 214 | * @param int $id 215 | * @param string $taxonomy 216 | * @return array $args 217 | */ 218 | private function set_taxonomy_item ( $id, $taxonomy ) { 219 | $terms = get_the_terms( $id, $taxonomy ); 220 | $term_bottom = array(); 221 | $args = array(); 222 | 223 | if ( $terms && ! is_wp_error( $terms ) ) { 224 | $parent_ids = array(); 225 | 226 | foreach ( $terms as $term ) { 227 | if ( $term->parent != 0 ) { 228 | $parent_ids[] = $term->parent; 229 | } 230 | } 231 | foreach ( $terms as $term ) { 232 | if ( !in_array( $term->term_id, $parent_ids ) ) { 233 | $term_bottom[] = $term->term_id; 234 | } 235 | } 236 | } 237 | 238 | if ( count( $term_bottom ) > 0 ) { 239 | $ancestors = array_reverse( get_ancestors( $term_bottom[0], $taxonomy ) ); 240 | $ancestors[] = $term_bottom[0]; 241 | 242 | foreach ( $ancestors as $ancestor ) { 243 | $term = get_term( $ancestor, $taxonomy ); 244 | $args[] = $this->set_schema_breadcrumb_item( get_term_link( $ancestor ), $term->name ); 245 | } 246 | } 247 | return (array) $args; 248 | } 249 | 250 | /** 251 | * Breadcrumb item settings 252 | * 253 | * @version 4.7.0 254 | * @since 2.0.0 255 | * @param string $id 256 | * @param string $name 257 | * @return array $args 258 | */ 259 | private function set_schema_breadcrumb_item ( $id, $name ) { 260 | $args = array( 261 | "@id" => esc_url( $id ), 262 | "name" => strip_tags( $name ) 263 | ); 264 | return (array) $args; 265 | } 266 | } -------------------------------------------------------------------------------- /includes/wp-structuring-utility.php: -------------------------------------------------------------------------------- 1 | get_size(); 41 | } else { 42 | return __return_false(); 43 | } 44 | } 45 | 46 | /** 47 | * Return image dimensions 48 | * 49 | * @version 4.1.0 50 | * @since 4.1.0 51 | * @author Kazuya Takami 52 | * @param string $content 53 | * @return array | boolean $images 54 | */ 55 | public function get_content_image ( $content ) { 56 | $pattern = '//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 | } 64 | } else { 65 | return __return_false(); 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /js/main.js: -------------------------------------------------------------------------------- 1 | /* Markup (JSON-LD) structured in schema.org */ 2 | jQuery(document).ready(function ($) { 3 | 'use strict'; 4 | 5 | // add row 6 | $('.schema-admin-table').on('click', '.markup-time.plus', function () { 7 | var newRow = $(this).closest('tr.opening-hours').clone(); 8 | $(this).closest('tr.opening-hours').after(newRow); 9 | newRow.find('input').val(''); 10 | newRow.find('.minus').show(); 11 | newRow.find('input').each(function () { 12 | var 13 | name = $(this).prop('name'), 14 | currentIndex = parseInt(name.split('][')[2], 10), 15 | nextIndex = currentIndex + 1; 16 | 17 | if (currentIndex === 0) { 18 | $(this).parent().find('.plus:last-child').after(''); 19 | } 20 | $(this).prop('name', name.replace(currentIndex, nextIndex)); 21 | }); 22 | }); 23 | 24 | // remove row 25 | $('.schema-admin-table').on('click', '.markup-time.minus', function () { 26 | $(this).closest('tr.opening-hours').fadeOut('normal', function () { 27 | $(this).remove(); 28 | }); 29 | }); 30 | }); -------------------------------------------------------------------------------- /js/main.min.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function(n){"use strict";n(".schema-admin-table").on("click",".markup-time.plus",function(){var i=n(this).closest("tr.opening-hours").clone();n(this).closest("tr.opening-hours").after(i),i.find("input").val(""),i.find(".minus").show(),i.find("input").each(function(){var i=n(this).prop("name"),s=parseInt(i.split("][")[2],10),t=s+1;0===s&&n(this).parent().find(".plus:last-child").after(''),n(this).prop("name",i.replace(s,t))})}),n(".schema-admin-table").on("click",".markup-time.minus",function(){n(this).closest("tr.opening-hours").fadeOut("normal",function(){n(this).remove()})})}); -------------------------------------------------------------------------------- /js/media-uploader-main.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | $(function() { 3 | var 4 | custom_uploader = wp.media({ 5 | title: "Choose Image", 6 | library: { 7 | type: "image" 8 | }, 9 | button: { 10 | text: "Choose Image" 11 | }, 12 | multiple: false 13 | }), 14 | media_id = ""; 15 | 16 | custom_uploader.on("select", function () { 17 | var images = custom_uploader.state().get("selection"); 18 | 19 | images.each(function(file) { 20 | switch (media_id) { 21 | case "media-upload": 22 | $("#logo").val(file.toJSON().url); 23 | $("#logo-width").val(file.toJSON().width); 24 | $("#logo-height").val(file.toJSON().height); 25 | break; 26 | case "media-upload-default": 27 | $("#default_image").val(file.toJSON().url); 28 | break; 29 | } 30 | }); 31 | }); 32 | 33 | $("#media-upload, #media-upload-default").on("click", function(e) { 34 | media_id = e.target.id; 35 | e.preventDefault(); 36 | custom_uploader.open(); 37 | }); 38 | }); 39 | })(jQuery); -------------------------------------------------------------------------------- /languages/wp-structuring-markup-ja.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miiitaka/wp-structuring-markup/bc651600de3d81a749805ad5bc0450a6bbbad0c2/languages/wp-structuring-markup-ja.mo -------------------------------------------------------------------------------- /languages/wp-structuring-markup-ja.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Markup (JSON-LD) structured in schema.org 2 | # This file is distributed under the same license as the Markup (JSON-LD) structured in schema.org package. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: Markup (JSON-LD) structured in schema.org 3.0.0\n" 6 | "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-structuring-" 7 | "markup\n" 8 | "POT-Creation-Date: 2016-06-20 10:36:01+00:00\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: Kazuya Takami \n" 14 | "Language-Team: LANGUAGE \n" 15 | 16 | #: includes/wp-structuring-admin-list.php:43 17 | msgid "Schema.org Settings List" 18 | msgstr "Schema.org 設定一覧" 19 | 20 | #: includes/wp-structuring-admin-list.php:50 21 | msgid "Status" 22 | msgstr "Status" 23 | 24 | #: includes/wp-structuring-admin-list.php:51 25 | msgid "Schema.org Type" 26 | msgstr "Schema.org タイプ" 27 | 28 | #: includes/wp-structuring-admin-list.php:52 29 | #: includes/wp-structuring-admin-post.php:142 30 | msgid "Output On" 31 | msgstr "出力ページ" 32 | 33 | #: includes/wp-structuring-admin-list.php:53 34 | msgid "ShortCode" 35 | msgstr "ショートコード" 36 | 37 | #: includes/wp-structuring-admin-list.php:81 wp-structuring-markup.php:159 38 | msgid "Edit" 39 | msgstr "編集" 40 | 41 | #: includes/wp-structuring-admin-list.php:87 42 | msgid "Without registration." 43 | msgstr "登録されていません。" 44 | 45 | #: includes/wp-structuring-admin-post.php:117 46 | msgid "Schema.org Register" 47 | msgstr "Schema.org 登録" 48 | 49 | #: includes/wp-structuring-admin-post.php:147 50 | #: includes/wp-structuring-admin-post.php:158 51 | #: includes/wp-structuring-admin-post.php:187 52 | #: includes/wp-structuring-admin-post.php:199 53 | #: includes/wp-structuring-admin-post.php:213 54 | #: includes/wp-structuring-admin-post.php:227 55 | #: includes/wp-structuring-admin-post.php:249 56 | msgid "Posts" 57 | msgstr "投稿ページ" 58 | 59 | #: includes/wp-structuring-admin-post.php:148 60 | #: includes/wp-structuring-admin-post.php:159 61 | #: includes/wp-structuring-admin-post.php:188 62 | #: includes/wp-structuring-admin-post.php:200 63 | #: includes/wp-structuring-admin-post.php:214 64 | #: includes/wp-structuring-admin-post.php:228 65 | #: includes/wp-structuring-admin-post.php:250 66 | msgid "Pages" 67 | msgstr "固定ページ" 68 | 69 | #: includes/wp-structuring-admin-post.php:169 70 | #: includes/wp-structuring-admin-post.php:185 71 | #: includes/wp-structuring-admin-post.php:211 72 | #: includes/wp-structuring-admin-post.php:225 73 | #: includes/wp-structuring-admin-post.php:247 74 | msgid "All Pages (In Header)" 75 | msgstr "全てのページ(ヘッダー)" 76 | 77 | #: includes/wp-structuring-admin-post.php:177 78 | msgid "Event Post Page" 79 | msgstr "イベント投稿ページ" 80 | 81 | #: includes/wp-structuring-admin-post.php:186 82 | #: includes/wp-structuring-admin-post.php:212 83 | #: includes/wp-structuring-admin-post.php:226 84 | #: includes/wp-structuring-admin-post.php:248 85 | msgid "Homepage" 86 | msgstr "ホームページ" 87 | 88 | #: includes/wp-structuring-admin-post.php:239 89 | msgid "Video Post Page" 90 | msgstr "ビデオ投稿ページ" 91 | 92 | #: includes/wp-structuring-admin-post.php:295 93 | msgid "Output On(Custom Posts)" 94 | msgstr "出力ページ(カスタム投稿)" 95 | 96 | #: includes/wp-structuring-custom-post-event.php:34 97 | #: includes/wp-structuring-custom-post-event.php:35 98 | msgid "Event Posts" 99 | msgstr "イベント投稿" 100 | 101 | #: includes/wp-structuring-custom-post-event.php:36 102 | msgid "All Event Posts" 103 | msgstr "イベント投稿一覧" 104 | 105 | #: includes/wp-structuring-custom-post-event.php:74 106 | msgid "Schema.org Type Event" 107 | msgstr "Schema.org Type Event" 108 | 109 | #: includes/wp-structuring-custom-post-event.php:96 110 | msgid "USD" 111 | msgstr "JPY" 112 | 113 | #: includes/wp-structuring-custom-post-event.php:101 114 | msgid "Event Name" 115 | msgstr "イベント名" 116 | 117 | #: includes/wp-structuring-custom-post-event.php:106 118 | msgid "Start Date" 119 | msgstr "開始日" 120 | 121 | #: includes/wp-structuring-custom-post-event.php:112 122 | msgid "Event URL" 123 | msgstr "イベントURL" 124 | 125 | #: includes/wp-structuring-custom-post-event.php:117 126 | msgid "Place Name" 127 | msgstr "場所名" 128 | 129 | #: includes/wp-structuring-custom-post-event.php:122 130 | msgid "Place URL" 131 | msgstr "会場URL" 132 | 133 | #: includes/wp-structuring-custom-post-event.php:127 134 | msgid "Place Address" 135 | msgstr "会場住所" 136 | 137 | #: includes/wp-structuring-custom-post-event.php:132 138 | msgid "Price" 139 | msgstr "参加費" 140 | 141 | #: includes/wp-structuring-custom-post-event.php:137 142 | msgid "Currency" 143 | msgstr "通貨" 144 | 145 | #: includes/wp-structuring-custom-post-video.php:34 146 | #: includes/wp-structuring-custom-post-video.php:35 147 | msgid "Video Posts" 148 | msgstr "ビデオ投稿" 149 | 150 | #: includes/wp-structuring-custom-post-video.php:36 151 | msgid "All Video Posts" 152 | msgstr "ビデオ投稿一覧" 153 | 154 | #: includes/wp-structuring-custom-post-video.php:74 155 | msgid "Schema.org Type Video" 156 | msgstr "Schema.org Type Video" 157 | 158 | #: includes/wp-structuring-custom-post-video.php:98 159 | msgid "duration" 160 | msgstr "所要時間" 161 | 162 | #: includes/wp-structuring-custom-post-video.php:103 163 | msgid "contentURL" 164 | msgstr "コンテンツURL" 165 | 166 | #: includes/wp-structuring-custom-post-video.php:108 167 | msgid "embedURL" 168 | msgstr "embedURL" 169 | 170 | #: includes/wp-structuring-custom-post-video.php:113 171 | msgid "interactionCount" 172 | msgstr "ビデオ視聴回数" 173 | 174 | #: includes/wp-structuring-custom-post-video.php:118 175 | msgid "expires" 176 | msgstr "有効期限" 177 | 178 | #: includes/wp-structuring-display.php:309 179 | #: includes/wp-structuring-display.php:373 180 | #: includes/wp-structuring-display.php:630 181 | #: includes/wp-structuring-display.php:767 182 | msgid "Featured Image not set." 183 | msgstr "アイキャッチ画像が設定されていません。" 184 | 185 | #: includes/wp-structuring-display.php:312 186 | #: includes/wp-structuring-display.php:376 187 | #: includes/wp-structuring-display.php:633 188 | msgid "Logo Image not set." 189 | msgstr "ロゴ画像が設定されていません。" 190 | 191 | #: wp-structuring-markup.php:150 wp-structuring-markup.php:151 192 | msgid "Schema.org Settings" 193 | msgstr "Schema.org 設定" 194 | 195 | #: wp-structuring-markup.php:158 196 | msgid "Schema.org Setting Edit" 197 | msgstr "Schema.org 設定編集" 198 | 199 | #. Plugin Name of the plugin/theme 200 | msgid "Markup (JSON-LD) structured in schema.org" 201 | msgstr "Markup (JSON-LD) structured in schema.org" 202 | 203 | #. Plugin URI of the plugin/theme 204 | msgid "https://wordpress.org/plugins/wp-structuring-markup/" 205 | msgstr "https://wordpress.org/plugins/wp-structuring-markup/" 206 | 207 | #. Description of the plugin/theme 208 | msgid "Allows you to include Schema.org JSON-LD syntax markup on your website" 209 | msgstr "ウェブサイト上でSchema.orgをJSON-LD構文で簡単に導入することができます" 210 | 211 | #. Author of the plugin/theme 212 | msgid "Kazuya Takami" 213 | msgstr "Kazuya Takami" 214 | 215 | #. Author URI of the plugin/theme 216 | msgid "https://terakoya.work/" 217 | msgstr "https://terakoya.work/" 218 | -------------------------------------------------------------------------------- /languages/wp-structuring-markup-tr_TR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miiitaka/wp-structuring-markup/bc651600de3d81a749805ad5bc0450a6bbbad0c2/languages/wp-structuring-markup-tr_TR.mo -------------------------------------------------------------------------------- /languages/wp-structuring-markup-tr_TR.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Markup (JSON-LD) structured in schema.org 2 | # This file is distributed under the same license as the Markup (JSON-LD) structured in schema.org package. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: Markup (JSON-LD) structured in schema.org 2.4.1\n" 6 | "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-structuring-" 7 | "markup\n" 8 | "POT-Creation-Date: 2016-03-01 08:58:28+00:00\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "PO-Revision-Date: 2016-03-08 03:21+0200\n" 13 | "Last-Translator: Keremcan Buyuktaskin \n" 14 | "Language-Team: Keremcan Buyuktaskin \n" 15 | "Plural-Forms: nplurals=1; plural=0;\n" 16 | "Language: tr_TR\n" 17 | "X-Generator: Poedit 1.6.6\n" 18 | "X-Poedit-Basepath: D:\\Google Drive\\Sites\\Tayland Gezi\\wp-content\\plugins" 19 | "\\wp-structuring-markup\n" 20 | 21 | #: includes/wp-structuring-admin-list.php:43 22 | msgid "Schema.org Settings List" 23 | msgstr "Schema.org Ayarları Listesi" 24 | 25 | #: includes/wp-structuring-admin-list.php:50 26 | msgid "Status" 27 | msgstr "Durum" 28 | 29 | #: includes/wp-structuring-admin-list.php:51 30 | msgid "Schema Type" 31 | msgstr "Şema Tipi" 32 | 33 | #: includes/wp-structuring-admin-list.php:52 34 | #: includes/wp-structuring-admin-post.php:115 35 | msgid "Output On" 36 | msgstr "Devredeki Çıktı" 37 | 38 | #: includes/wp-structuring-admin-list.php:53 39 | msgid "ShortCode" 40 | msgstr "Kısa Kod" 41 | 42 | #: includes/wp-structuring-admin-list.php:81 wp-structuring-markup.php:155 43 | msgid "Edit" 44 | msgstr "Düzenle" 45 | 46 | #: includes/wp-structuring-admin-list.php:87 47 | msgid "Without registration." 48 | msgstr "Kayıt olmadan." 49 | 50 | #: includes/wp-structuring-admin-post.php:90 51 | msgid "Schema.org Register" 52 | msgstr "Schema.org Kayıt" 53 | 54 | #: includes/wp-structuring-admin-post.php:120 55 | #: includes/wp-structuring-admin-post.php:128 56 | #: includes/wp-structuring-admin-post.php:154 57 | #: includes/wp-structuring-admin-post.php:163 58 | #: includes/wp-structuring-admin-post.php:173 59 | #: includes/wp-structuring-admin-post.php:184 60 | #: includes/wp-structuring-admin-post.php:195 61 | msgid "Posts" 62 | msgstr "Yazılar" 63 | 64 | #: includes/wp-structuring-admin-post.php:136 65 | #: includes/wp-structuring-admin-post.php:152 66 | #: includes/wp-structuring-admin-post.php:171 67 | #: includes/wp-structuring-admin-post.php:182 68 | #: includes/wp-structuring-admin-post.php:193 69 | msgid "All Pages (In Header)" 70 | msgstr "Tüm Sayfalar (Üst Kısımda)" 71 | 72 | #: includes/wp-structuring-admin-post.php:144 73 | msgid "Event Post Page" 74 | msgstr "Etkinlik Yazı Sayfası" 75 | 76 | #: includes/wp-structuring-admin-post.php:153 77 | #: includes/wp-structuring-admin-post.php:172 78 | #: includes/wp-structuring-admin-post.php:183 79 | #: includes/wp-structuring-admin-post.php:194 80 | msgid "Homepage" 81 | msgstr "Ana Sayfa" 82 | 83 | #: includes/wp-structuring-admin-post.php:155 84 | #: includes/wp-structuring-admin-post.php:174 85 | #: includes/wp-structuring-admin-post.php:185 86 | #: includes/wp-structuring-admin-post.php:196 87 | msgid "Pages" 88 | msgstr "Sayfalar" 89 | 90 | #: includes/wp-structuring-custom-post-event.php:34 91 | #: includes/wp-structuring-custom-post-event.php:35 92 | msgid "Event Posts" 93 | msgstr "Etkinlik Yazıları" 94 | 95 | #: includes/wp-structuring-custom-post-event.php:73 96 | msgid "Schema.org Type Event" 97 | msgstr "Schema.org Tip Etkinliği" 98 | 99 | #: includes/wp-structuring-custom-post-event.php:95 100 | msgid "USD" 101 | msgstr "USD" 102 | 103 | #: includes/wp-structuring-custom-post-event.php:100 104 | msgid "Event Name" 105 | msgstr "Etkinlik Adı" 106 | 107 | #: includes/wp-structuring-custom-post-event.php:105 108 | msgid "Start Date" 109 | msgstr "Başlangıç Tarihi" 110 | 111 | #: includes/wp-structuring-custom-post-event.php:111 112 | msgid "Event URL" 113 | msgstr "Etkinlik URL'si" 114 | 115 | #: includes/wp-structuring-custom-post-event.php:116 116 | msgid "Place Name" 117 | msgstr "Yer Adı" 118 | 119 | #: includes/wp-structuring-custom-post-event.php:121 120 | msgid "Place URL" 121 | msgstr "Yer URL'si" 122 | 123 | #: includes/wp-structuring-custom-post-event.php:126 124 | msgid "Place Address" 125 | msgstr "Yer Adresi" 126 | 127 | #: includes/wp-structuring-custom-post-event.php:131 128 | msgid "Price" 129 | msgstr "Fiyat" 130 | 131 | #: includes/wp-structuring-custom-post-event.php:136 132 | msgid "Currency" 133 | msgstr "Para Birimi" 134 | 135 | #: wp-structuring-markup.php:146 wp-structuring-markup.php:147 136 | msgid "Schema.org Settings" 137 | msgstr "Schema.org Ayarları" 138 | 139 | #: wp-structuring-markup.php:154 140 | msgid "Schema.org Setting Edit" 141 | msgstr "Schema.org Ayarları Düzenle" 142 | 143 | #. Plugin Name of the plugin/theme 144 | msgid "Markup (JSON-LD) structured in schema.org" 145 | msgstr "Markup (JSON-LD) structured in schema.org" 146 | 147 | #. Plugin URI of the plugin/theme 148 | msgid "https://wordpress.org/plugins/wp-structuring-markup/" 149 | msgstr "https://wordpress.org/plugins/wp-structuring-markup/" 150 | 151 | #. Description of the plugin/theme 152 | msgid "Allows you to include schema.org JSON-LD syntax markup on your website" 153 | msgstr "" 154 | "Web sitenizde schema.org JSON-LD sözdizimi biçimlendirmesini dahil etmenize " 155 | "izin verir" 156 | 157 | #. Author of the plugin/theme 158 | msgid "Kazuya Takami" 159 | msgstr "Kazuya Takami" 160 | 161 | #. Author URI of the plugin/theme 162 | msgid "https://terakoya.work/" 163 | msgstr "https://terakoya.work/" 164 | -------------------------------------------------------------------------------- /languages/wp-structuring-markup.pot: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Markup (JSON-LD) structured in schema.org 2 | # This file is distributed under the same license as the Markup (JSON-LD) structured in schema.org package. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: Markup (JSON-LD) structured in schema.org 3.0.0\n" 6 | "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-structuring-" 7 | "markup\n" 8 | "POT-Creation-Date: 2016-06-20 10:36:01+00:00\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: Kazuya Takami \n" 14 | "Language-Team: LANGUAGE \n" 15 | 16 | #: includes/wp-structuring-admin-list.php:43 17 | msgid "Schema.org Settings List" 18 | msgstr "" 19 | 20 | #: includes/wp-structuring-admin-list.php:50 21 | msgid "Status" 22 | msgstr "" 23 | 24 | #: includes/wp-structuring-admin-list.php:51 25 | msgid "Schema.org Type" 26 | msgstr "" 27 | 28 | #: includes/wp-structuring-admin-list.php:52 29 | #: includes/wp-structuring-admin-post.php:142 30 | msgid "Output On" 31 | msgstr "" 32 | 33 | #: includes/wp-structuring-admin-list.php:53 34 | msgid "ShortCode" 35 | msgstr "" 36 | 37 | #: includes/wp-structuring-admin-list.php:81 wp-structuring-markup.php:159 38 | msgid "Edit" 39 | msgstr "" 40 | 41 | #: includes/wp-structuring-admin-list.php:87 42 | msgid "Without registration." 43 | msgstr "" 44 | 45 | #: includes/wp-structuring-admin-post.php:117 46 | msgid "Schema.org Register" 47 | msgstr "" 48 | 49 | #: includes/wp-structuring-admin-post.php:147 50 | #: includes/wp-structuring-admin-post.php:158 51 | #: includes/wp-structuring-admin-post.php:187 52 | #: includes/wp-structuring-admin-post.php:199 53 | #: includes/wp-structuring-admin-post.php:213 54 | #: includes/wp-structuring-admin-post.php:227 55 | #: includes/wp-structuring-admin-post.php:249 56 | msgid "Posts" 57 | msgstr "" 58 | 59 | #: includes/wp-structuring-admin-post.php:148 60 | #: includes/wp-structuring-admin-post.php:159 61 | #: includes/wp-structuring-admin-post.php:188 62 | #: includes/wp-structuring-admin-post.php:200 63 | #: includes/wp-structuring-admin-post.php:214 64 | #: includes/wp-structuring-admin-post.php:228 65 | #: includes/wp-structuring-admin-post.php:250 66 | msgid "Pages" 67 | msgstr "" 68 | 69 | #: includes/wp-structuring-admin-post.php:169 70 | #: includes/wp-structuring-admin-post.php:185 71 | #: includes/wp-structuring-admin-post.php:211 72 | #: includes/wp-structuring-admin-post.php:225 73 | #: includes/wp-structuring-admin-post.php:247 74 | msgid "All Pages (In Header)" 75 | msgstr "" 76 | 77 | #: includes/wp-structuring-admin-post.php:177 78 | msgid "Event Post Page" 79 | msgstr "" 80 | 81 | #: includes/wp-structuring-admin-post.php:186 82 | #: includes/wp-structuring-admin-post.php:212 83 | #: includes/wp-structuring-admin-post.php:226 84 | #: includes/wp-structuring-admin-post.php:248 85 | msgid "Homepage" 86 | msgstr "" 87 | 88 | #: includes/wp-structuring-admin-post.php:239 89 | msgid "Video Post Page" 90 | msgstr "" 91 | 92 | #: includes/wp-structuring-admin-post.php:295 93 | msgid "Output On(Custom Posts)" 94 | msgstr "" 95 | 96 | #: includes/wp-structuring-custom-post-event.php:34 97 | #: includes/wp-structuring-custom-post-event.php:35 98 | msgid "Event Posts" 99 | msgstr "" 100 | 101 | #: includes/wp-structuring-custom-post-event.php:36 102 | msgid "All Event Posts" 103 | msgstr "" 104 | 105 | #: includes/wp-structuring-custom-post-event.php:74 106 | msgid "Schema.org Type Event" 107 | msgstr "" 108 | 109 | #: includes/wp-structuring-custom-post-event.php:96 110 | msgid "USD" 111 | msgstr "" 112 | 113 | #: includes/wp-structuring-custom-post-event.php:101 114 | msgid "Event Name" 115 | msgstr "" 116 | 117 | #: includes/wp-structuring-custom-post-event.php:106 118 | msgid "Start Date" 119 | msgstr "" 120 | 121 | #: includes/wp-structuring-custom-post-event.php:112 122 | msgid "Event URL" 123 | msgstr "" 124 | 125 | #: includes/wp-structuring-custom-post-event.php:117 126 | msgid "Place Name" 127 | msgstr "" 128 | 129 | #: includes/wp-structuring-custom-post-event.php:122 130 | msgid "Place URL" 131 | msgstr "" 132 | 133 | #: includes/wp-structuring-custom-post-event.php:127 134 | msgid "Place Address" 135 | msgstr "" 136 | 137 | #: includes/wp-structuring-custom-post-event.php:132 138 | msgid "Price" 139 | msgstr "" 140 | 141 | #: includes/wp-structuring-custom-post-event.php:137 142 | msgid "Currency" 143 | msgstr "" 144 | 145 | #: includes/wp-structuring-custom-post-video.php:34 146 | #: includes/wp-structuring-custom-post-video.php:35 147 | msgid "Video Posts" 148 | msgstr "" 149 | 150 | #: includes/wp-structuring-custom-post-video.php:36 151 | msgid "All Video Posts" 152 | msgstr "" 153 | 154 | #: includes/wp-structuring-custom-post-video.php:74 155 | msgid "Schema.org Type Video" 156 | msgstr "" 157 | 158 | #: includes/wp-structuring-custom-post-video.php:98 159 | msgid "duration" 160 | msgstr "" 161 | 162 | #: includes/wp-structuring-custom-post-video.php:103 163 | msgid "contentURL" 164 | msgstr "" 165 | 166 | #: includes/wp-structuring-custom-post-video.php:108 167 | msgid "embedURL" 168 | msgstr "" 169 | 170 | #: includes/wp-structuring-custom-post-video.php:113 171 | msgid "interactionCount" 172 | msgstr "" 173 | 174 | #: includes/wp-structuring-custom-post-video.php:118 175 | msgid "expires" 176 | msgstr "" 177 | 178 | #: includes/wp-structuring-display.php:309 179 | #: includes/wp-structuring-display.php:373 180 | #: includes/wp-structuring-display.php:630 181 | #: includes/wp-structuring-display.php:767 182 | msgid "Featured Image not set." 183 | msgstr "" 184 | 185 | #: includes/wp-structuring-display.php:312 186 | #: includes/wp-structuring-display.php:376 187 | #: includes/wp-structuring-display.php:633 188 | msgid "Logo Image not set." 189 | msgstr "" 190 | 191 | #: wp-structuring-markup.php:150 wp-structuring-markup.php:151 192 | msgid "Schema.org Settings" 193 | msgstr "" 194 | 195 | #: wp-structuring-markup.php:158 196 | msgid "Schema.org Setting Edit" 197 | msgstr "" 198 | 199 | #. Plugin Name of the plugin/theme 200 | msgid "Markup (JSON-LD) structured in schema.org" 201 | msgstr "" 202 | 203 | #. Plugin URI of the plugin/theme 204 | msgid "https://wordpress.org/plugins/wp-structuring-markup/" 205 | msgstr "" 206 | 207 | #. Description of the plugin/theme 208 | msgid "Allows you to include schema.org JSON-LD syntax markup on your website" 209 | msgstr "" 210 | 211 | #. Author of the plugin/theme 212 | msgid "Kazuya Takami" 213 | msgstr "" 214 | 215 | #. Author URI of the plugin/theme 216 | msgid "https://terakoya.work/" 217 | msgstr "" 218 | -------------------------------------------------------------------------------- /materials/ImageDesign.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miiitaka/wp-structuring-markup/bc651600de3d81a749805ad5bc0450a6bbbad0c2/materials/ImageDesign.psd -------------------------------------------------------------------------------- /uninstall.php: -------------------------------------------------------------------------------- 1 | drop_table( 'structuring_markup' ); 34 | $this->delete_custom_post( $this->custom_type_event ); 35 | $this->delete_post_meta( $this->custom_type_event ); 36 | $this->delete_custom_post( $this->custom_type_video ); 37 | $this->delete_post_meta( $this->custom_type_video ); 38 | delete_option( $this->text_domain ); 39 | } 40 | 41 | /** 42 | * Drop Table. 43 | * 44 | * @version 2.1.0 45 | * @since 1.0.0 46 | * @param string $table_name 47 | */ 48 | private function drop_table ( $table_name = null ) { 49 | global $wpdb; 50 | $table_name = $wpdb->prefix . $table_name; 51 | $wpdb->query( "DROP TABLE IF EXISTS " . $table_name ); 52 | } 53 | 54 | /** 55 | * Delete custom post. 56 | * 57 | * @version 2.1.0 58 | * @since 2.1.0 59 | * @param string $custom_type 60 | */ 61 | private function delete_custom_post ( $custom_type = null ) { 62 | global $wpdb; 63 | $table_name = $wpdb->prefix . "posts"; 64 | 65 | $key = array( 'post_type' => $custom_type ); 66 | $key_prepared = array( '%s' ); 67 | 68 | $wpdb->delete( $table_name, $key, $key_prepared ); 69 | } 70 | 71 | /** 72 | * Delete post meta. 73 | * 74 | * @version 2.1.0 75 | * @since 2.1.0 76 | * @param string $custom_type 77 | */ 78 | private function delete_post_meta ( $custom_type = null ) { 79 | global $wpdb; 80 | $table_name = $wpdb->prefix . "postmeta"; 81 | 82 | $key = array( 'meta_key' => $custom_type ); 83 | $key_prepared = array( '%s' ); 84 | 85 | $wpdb->delete( $table_name, $key, $key_prepared ); 86 | } 87 | } -------------------------------------------------------------------------------- /wp-structuring-markup.php: -------------------------------------------------------------------------------- 1 | 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 = '' . __( 'Settings' ) . ''; 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 | } --------------------------------------------------------------------------------