Skip to content

Commit faae0f0

Browse files
authored
Merge pull request #706 from 10up/fix/701
Fix fatal error in the PDF text extraction from the media row actions.
2 parents 3be8d28 + b154e1b commit faae0f0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

includes/Classifai/Admin/BulkActions.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,8 @@ function ( $feature ) {
446446
break;
447447

448448
case PDFTextExtraction::ID:
449-
if ( attachment_is_pdf( $attachment_id ) ) {
449+
$attachment = get_post( $attachment_id );
450+
if ( attachment_is_pdf( $attachment ) ) {
450451
( new PDFTextExtraction() )->run( $attachment_id, 'read_pdf' );
451452
}
452453
break;

includes/Classifai/Features/PDFTextExtraction.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function register_endpoints() {
7373
'required' => true,
7474
'type' => 'integer',
7575
'sanitize_callback' => 'absint',
76-
'description' => esc_html__( 'Image ID to generate alt text for.', 'classifai' ),
76+
'description' => esc_html__( 'Attachment ID to extact text from the PDF file.', 'classifai' ),
7777
],
7878
],
7979
'permission_callback' => [ $this, 'read_pdf_permissions_check' ],

0 commit comments

Comments
 (0)