public function get_untranslated_posts();
/** * Renders the widget's view. * * @since 3.0.0 * * @param mixed $object Queried object, or other stuff. * @param array $instance Widget settings. * * @return void */ public function render($object, array $instance) { $related_site_ids = $this->site_relations->get_related_site_ids(); if (!$related_site_ids) { return; } $have_untranslated_posts = false; ?> <table class="widefat"> <?php foreach ($related_site_ids as $related_site_id) { ?> <?php switch_to_blog($related_site_id); ?> <?php $untranslated_posts = $this->post_repository->get_untranslated_posts(); ?> <?php if ($untranslated_posts) { ?> <?php $have_untranslated_posts = true; ?> <tr> <th colspan="3"> <strong> <?php /* translators: %s: site name */ $message = __('Pending Translations for %s', 'multilingual-press'); printf($message, get_bloginfo('name')); ?> </strong> </th> </tr> <?php foreach ($untranslated_posts as $post) { ?> <tr> <td style="width: 20%;"> <?php edit_post_link(__('Translate', 'multilingual-press'), '', '', $post->ID); ?> </td> <td style="width: 55%;"> <?php echo esc_html(get_the_title($post->ID)); ?> </td> <td style="width: 25%;"> <?php echo esc_html(get_the_time(get_option('date_format'), $post->ID)); ?> </td> </tr> <?php } ?> <?php } ?> <?php restore_current_blog(); ?> <?php } ?> <?php if (!$have_untranslated_posts) { ?> <tr> <td colspan="3"> <?php esc_html_e('No untranslated posts found.', 'multilingual-press'); ?> </td> </tr> <?php } ?> </table> <?php }