colibri.php
4 years ago
contact-form.php
4 years ago
entity.php
4 years ago
get-body-class.php
4 years ago
get-classic-page-template.php
4 years ago
get-page-query.php
4 years ago
get-page-title.php
4 years ago
get-post-content.php
4 years ago
get-post-styles.php
4 years ago
index.php
3 years ago
page-templates.php
4 years ago
save-template-parts-filter.php
4 years ago
subscribe-form.php
4 years ago
typekit.php
4 years ago
update-ui-version.php
3 years ago
get-post-content.php
32 lines
| 1 | <?php |
| 2 | |
| 3 | use IlluminateAgnostic\Arr\Support\Arr; |
| 4 | use Kubio\Core\Utils; |
| 5 | |
| 6 | add_action( |
| 7 | 'template_redirect', |
| 8 | function () { |
| 9 | if ( Arr::has( $_REQUEST, '__kubio-rendered-content' ) && Utils::canEdit() ) { |
| 10 | |
| 11 | $content = apply_filters( 'kubio/editor/rendered-content', do_blocks( '<!-- wp:post-content /-->' ) ); |
| 12 | |
| 13 | $stripped_content = strip_tags( $content ); |
| 14 | |
| 15 | if ( ! trim( $stripped_content ) ) { |
| 16 | $content = sprintf( |
| 17 | '<p>%s</p>' . |
| 18 | '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p>', |
| 19 | __( 'Current post content is empty. A placeholder text is displayed in editor', 'kubio' ) |
| 20 | ); |
| 21 | } |
| 22 | |
| 23 | return wp_send_json_success( |
| 24 | array( |
| 25 | 'content' => $content, |
| 26 | ) |
| 27 | ); |
| 28 | } |
| 29 | }, |
| 30 | PHP_INT_MAX |
| 31 | ); |
| 32 |