public function get_word_count() { $current_document = $this->data; $count = 0; if (!$this->is_external_type()) { $wpml_post = new WPML_Post($current_document->ID, $this->sitepress, $this->wpdb); $count += $wpml_post->get_words_count(); } $count = apply_filters('wpml_tm_estimated_words_count', $count, $current_document); return $count; }
/** * @param string $post_type * @param WPML_Post $wpml_post */ private function init_post_type_report($post_type, $wpml_post) { $this->report[$post_type] = array('selected' => !in_array($post_type, $this->nonPreSelectedTypes), 'type' => $wpml_post->get_type_name('name'), 'count' => array('total' => 0, 'untranslated' => 0), 'words' => array('total' => 0, 'untranslated' => 0)); }