Changeset 2618479
- Timestamp:
- 10/22/2021 04:49:21 PM (4 years ago)
- Location:
- schema-app-structured-data-for-schemaorg/tags/1.17.9
- Files:
-
- 5 edited
-
lib/HunchSchema/Thing.php (modified) (1 diff)
-
lib/SchemaEditor.php (modified) (2 diffs)
-
lib/SchemaFront.php (modified) (5 diffs)
-
lib/SchemaServer.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
schema-app-structured-data-for-schemaorg/tags/1.17.9/lib/HunchSchema/Thing.php
r2611195 r2618479 485 485 if ( isset( $array ) ) { 486 486 if ( $pretty && strnatcmp( phpversion(), '5.4.0' ) >= 0 ) { 487 $jsonLd = json_encode( $array, JSON_PRETTY_PRINT );487 $jsonLd = wp_json_encode( $array, JSON_PRETTY_PRINT ); 488 488 } else { 489 $jsonLd = json_encode( $array );489 $jsonLd = wp_json_encode( $array ); 490 490 } 491 491 -
schema-app-structured-data-for-schemaorg/tags/1.17.9/lib/SchemaEditor.php
r2611195 r2618479 337 337 update_post_meta( sanitize_key( $_POST['Id'] ), '_HunchSchemaMarkup', sanitize_textarea_field( $_POST['Data'] ) ); 338 338 339 print json_encode( array( 'Status' => 'Ok' ) );339 print wp_json_encode( array( 'Status' => 'Ok' ) ); 340 340 } 341 341 else 342 342 { 343 print json_encode( array( 'Status' => 'Error', 'Message' => 'Invalid JSON format' ) );343 print wp_json_encode( array( 'Status' => 'Error', 'Message' => 'Invalid JSON format' ) ); 344 344 } 345 345 } … … 348 348 delete_post_meta( sanitize_key ($_POST['Id'] ), '_HunchSchemaMarkup' ); 349 349 350 print json_encode( array( 'Status' => 'Ok', 'Delete' => true ) );350 print wp_json_encode( array( 'Status' => 'Ok', 'Delete' => true ) ); 351 351 } 352 352 } 353 353 else 354 354 { 355 print json_encode( array( 'Status' => 'Error', 'Message' => 'Required parameter missing' ) );355 print wp_json_encode( array( 'Status' => 'Error', 'Message' => 'Required parameter missing' ) ); 356 356 } 357 357 -
schema-app-structured-data-for-schemaorg/tags/1.17.9/lib/SchemaFront.php
r2611195 r2618479 166 166 // First delete then set; set method only updates expiry time if transient already exists 167 167 delete_transient( $transient_id ); 168 set_transient( $transient_id, json_encode( $request_data->{"@graph"} ), 86400 );168 set_transient( $transient_id, wp_json_encode( $request_data->{"@graph"} ), 86400 ); 169 169 170 170 if ( ! empty( $this->Settings['Debug'] ) ) { … … 275 275 } 276 276 277 printf( '<script type="application/ld+json" data-schema="%s-%s-%s">%s</script>' . "\n", esc_attr( $post->ID ), esc_attr( $PostType ), esc_attr( $SchemaMarkupType ), $SchemaMarkup);277 printf( '<script type="application/ld+json" data-schema="%s-%s-%s">%s</script>' . "\n", esc_attr( $post->ID ), esc_attr( $PostType ), esc_attr( $SchemaMarkupType ), wp_json_encode( json_decode( $SchemaMarkup ) ) ); 278 278 } 279 279 } … … 291 291 else 292 292 { 293 printf( '<script type="application/ld+json" data-schema="Website">%s</script>' . "\n", $SchemaMarkupWebSite);293 printf( '<script type="application/ld+json" data-schema="Website">%s</script>' . "\n", wp_json_encode( json_decode( $SchemaMarkupWebSite ) ) ); 294 294 } 295 295 } … … 308 308 else 309 309 { 310 printf( '<script type="application/ld+json" data-schema="Breadcrumb">%s</script>' . "\n", $SchemaMarkupBreadcrumb);310 printf( '<script type="application/ld+json" data-schema="Breadcrumb">%s</script>' . "\n", wp_json_encode( json_decode( $SchemaMarkupBreadcrumb ) ) ); 311 311 } 312 312 } … … 319 319 $JSONSchemaMarkup = reset( $JSONSchemaMarkup ); 320 320 321 print json_encode( $JSONSchemaMarkup );321 print wp_json_encode( $JSONSchemaMarkup ); 322 322 } 323 323 else 324 324 { 325 print json_encode( $JSONSchemaMarkup );325 print wp_json_encode( $JSONSchemaMarkup ); 326 326 } 327 327 } -
schema-app-structured-data-for-schemaorg/tags/1.17.9/lib/SchemaServer.php
r2611195 r2618479 79 79 80 80 if ( $pretty && ! empty( $transient ) && version_compare( phpversion(), '5.4.0', '>=' ) ) { 81 $transient = json_encode( json_decode( $transient ), JSON_PRETTY_PRINT );81 $transient = wp_json_encode( json_decode( $transient ), JSON_PRETTY_PRINT ); 82 82 } 83 83 … … 179 179 'sslverify' => false, 180 180 'headers' => array( 'Content-Type' => 'application/json' ), 181 'body' => json_encode( $params ),181 'body' => wp_json_encode( $params ), 182 182 )); 183 183 -
schema-app-structured-data-for-schemaorg/tags/1.17.9/readme.txt
r2611195 r2618479 6 6 Author URI: https://www.hunchmanifest.com 7 7 Author: Mark van Berkel (vberkel) 8 Requires at least: 3.78 Requires at least: 4.1 9 9 Requires PHP: 5.4 10 10 Tested up to: 5.8
Note: See TracChangeset
for help on using the changeset viewer.