Skip to content

Commit a4eca64

Browse files
Running add_action only if the function exists so it does not run early.
1 parent 2d15cc9 commit a4eca64

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

voce-post-pdfs.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,7 @@ public static function save_pdf( $post, $overwrite = true ) {
196196
return file_put_contents( $file, $dompdf->output() );
197197
}
198198
}
199-
add_action( 'init', array( 'Voce_Post_PDFS', 'initialize' ) );
199+
200+
if ( function_exists( 'add_action' ) ) {
201+
add_action( 'init', array( 'Voce_Post_PDFS', 'initialize' ) );
202+
}

0 commit comments

Comments
 (0)