Changeset 5826
- Timestamp:
- 08/21/2017 02:08:26 PM (7 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/phpunit-test-reporter.php
r5805 r5826 25 25 add_action( 'init', array( 'PTR\Content_Model', 'action_init_register_role' ) ); 26 26 add_action( 'init', array( 'PTR\Display', 'action_init_register_shortcode' ) ); 27 add_action( 'get_post_metadata', array( 'PTR\Display', 'filter_get_post_metadata' ), 10, 4 ); 28 add_action( 'body_class', array( 'PTR\Display', 'filter_body_class' ) ); 27 29 add_action( 'post_class', array( 'PTR\Display', 'filter_post_class' ) ); 28 30 add_action( 'the_content', array( 'PTR\Display', 'filter_the_content' ) ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-display.php
r5823 r5826 12 12 public static function action_init_register_shortcode() { 13 13 add_shortcode( 'ptr-results', array( __CLASS__, 'render_results' ) ); 14 } 15 16 /** 17 * Use the full width template by default when available 18 */ 19 public static function filter_get_post_metadata( $check, $object_id, $meta_key, $single ) { 20 if ( 'result' !== get_post_type( $object_id ) 21 || '_wp_page_template' !== $meta_key ) { 22 return $check; 23 } 24 $template = 'page-templates/full-width.php'; 25 $full_width = get_stylesheet_directory() . '/' . $template; 26 if ( ! file_exists( $full_width ) ) { 27 return $check; 28 } 29 return $single ? $template : array( $template ); 30 } 31 32 /** 33 * Filter body classes 34 */ 35 public static function filter_body_class( $classes ) { 36 if ( in_array( 'result-template-full-width', $classes, true ) ) { 37 $classes[] = 'page-template-full-width'; 38 } 39 return $classes; 14 40 } 15 41
Note: See TracChangeset
for help on using the changeset viewer.