then( spreadArgs( [ $this, 'setSpinningIconOnPageList' ] ) ); Hooks::onFilter( 'wpml_tm_translation_queue_job_icon', 10, 2 ) ->then( spreadArgs( [ $this, 'setSpinningIconInTranslationQueue' ] ) ); } } private static function hasTranslatedStatusInAte() { return Lst::includes( (int) Obj::prop( 'ate_status', $_GET ), [ \WPML_TM_ATE_API::TRANSLATED, \WPML_TM_ATE_API::DELIVERING ] ); } public function setSpinningIconOnPageList( $default, $postId, $languageCode, $trid, $status ) { if ( ICL_TM_COMPLETE === $status ) { return $default; } if ( $this->alreadyFound ) { return $default; } else { return $this->getIcon( $default, Jobs::getTridJob( $trid, $languageCode ) ); } } public function setSpinningIconInTranslationQueue( $default, $job ) { return $this->getIcon( $default, $job ); } public function getIcon( $default, $job ) { if ( $job && (int) Obj::prop( 'editor_job_id', $job ) === (int) Obj::prop( 'ate_job_id', $_GET ) && Relation::propEq( 'editor', \WPML_TM_Editors::ATE, $job ) && Lst::includes( (int) Obj::prop( 'status', $job ), [ ICL_TM_WAITING_FOR_TRANSLATOR, ICL_TM_IN_PROGRESS ] ) ) { $this->alreadyFound = true; return 'otgs-ico-refresh-spin'; } else { return $default; } } }