| @@ -36,9 +36,9 @@ | ||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public static function traverse_post_elements( string $post_id, callable $callback ): void { |
| 39 | 39 | $documents = Plugin::$instance->documents; |
| 40 | - $document = Plugin::$instance->preview->is_editor_or_preview() ? $documents->get_doc_or_auto_save( $post_id, get_current_user_id() ) : $documents->get( $post_id ); | |
| 40 | + $document = is_preview() ? $documents->get_doc_or_auto_save( $post_id, get_current_user_id() ) : $documents->get( $post_id ); | |
| 41 | 41 | |
| 42 | 42 | if ( ! $document ) { |
| 43 | 43 | return; |
| 44 | 44 | } |