Impact of recent code changes
-
With the recent code changes to the plugin, I’m having problems hooking this into the Schema plugin, to create schema markup in Posts. This is the function I have in functions.php – before I dive into this, can you see any obvious changes needed to reflect the new structure?
Thanks in advance!
Azfunction schema_wp_extend_output_987345256( $schema ) { global $post; global $readingTimeWP; if ( empty($schema) ) return; // Modify NewType to present the actual schema.org type if ( $schema['@type'] == 'Article' && $post->post_type == 'post') { $reading_time = $readingTimeWP->rt_calculate_reading_time($post->ID, get_option('rt_reading_time_options') ); //Check for articles less than a minute read. if ($reading_time == '< 1') $reading_time = '1'; // Create the Schema duration as per the ISO format: https://en.wikipedia.org/wiki/ISO_8601#Durations $schema['timeRequired'] = 'PT' . strval($reading_time) . 'M'; // Debug - will only be presented when a post/page is edited and saved, forcing the schema to be regenerated. //echo '<pre>'; print_r($schema); echo '</pre>'; } else { // Debug - will only be presented when a post/page is edited and saved, forcing the schema to be regenerated. //echo '<pre>'; print_r($schema); echo '</pre>'; return $schema; } return $schema; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Impact of recent code changes’ is closed to new replies.