| @@ -1,6 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | - $post_id = get_the_ID(); | |
| 2 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical. | |
| 3 | + | |
| 4 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 5 | + exit; | |
| 6 | +} | |
| 7 | +$post_id = get_the_ID(); | |
| 3 | 8 | $est_reading_text = ! empty( get_post_meta( $post_id, '_betterdocs_est_reading_text', true ) ) ? get_post_meta( $post_id, '_betterdocs_est_reading_text', true ) : ''; |
| 4 | 9 | ?> |
| 5 | 10 | <div class="est-reading-box-wrapper"> |
| 6 | 11 | <p>You can add estimated reading time to this documentation so visitors can know how much time they need to read this.</p> |