wpdb = $wpdb; $this->service_names = $service_names; } public function get() { if ( $this->cache === null ) { $sql = " SELECT * FROM ( ( SELECT translation_service FROM {$this->wpdb->prefix}icl_translation_status ) UNION ( SELECT translation_service FROM {$this->wpdb->prefix}icl_string_translations ) ) as services WHERE translation_service != 'local' AND translation_service != '' "; $this->cache = array_map( array( $this, 'map' ), $this->wpdb->get_col( $sql ) ); } return $this->cache; } private function map( $translation_service_id ) { return array( 'value' => $translation_service_id, 'label' => $this->service_names->get_name( $translation_service_id ), ); } }