Skip to content

Commit

Permalink
Add filter to the entries Export status (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-mendonca authored May 16, 2024
1 parent 8a4a120 commit 5f49923
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion inc/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,19 @@ public function __construct( GP_Translation_Set $translation_set ) {
* @return array<string,string> List of files with names as key and temporary file location as value.
*/
public function export_strings(): ?array {
$entries = GP::$translation->for_export( $this->project->get_project(), $this->translation_set, [ 'status' => 'current' ] );

/**
* Filters the status of the entries to export.
*
* @since 4.0.0
*
* @param string $export_status The status of the entries to export. Default is 'current'.
* @param \GP_Translation_Set $translation_set Translation set the language pack is for.
* @param \Required\Traduttore\Project $project The project that was updated.
*/
$export_status = apply_filters( 'traduttore.export_status', 'current', $this->translation_set, $this->project );

$entries = GP::$translation->for_export( $this->project->get_project(), $this->translation_set, [ 'status' => $export_status ] );

if ( ! $entries ) {
return null;
Expand Down

0 comments on commit 5f49923

Please sign in to comment.