<?php global $post; $indexable = DigitalGov_Search::is_indexable($post); function selected_option($indexable, $check = true) { if ($indexable == $check) { return 'checked'; } return ''; } ?> <div id="minor"> <h3>Should this page be indexed?</h3> <p><input type="radio" name="index" value="yes" <?php echo selected_option($indexable); ?> > Yes</p> <p><input type="radio" name="index" value="no"<?php echo selected_option($indexable, false); ?> > No</p> </div> <div id="major-publishing-actions"> <div id="publishing-actions"> <input name="save" type="submit" class="button button-primary button-large right" id="publish" value="Update"> </div> <div class="clear"></div> </div>
} catch (WordPressCouldNotConnectToAPIException $e) { echo "{$e->getMessage()} {$document->title}."; if (++$attempt < $MAX_ATTEMPTS_PER_POST) { echo " Trying again..."; attemptToIndexDocument($post_id, $document, $attempt); } echo "\n"; } } $args = array('post_type' => 'any', 'post_status' => 'publish', 'posts_per_page' => -1); $posts_array = get_posts($args); foreach ($posts_array as $post) { try { $document = DigitalGov_Search_Document::create_from_post($post); deindexDocument($post->ID, $document); if (DigitalGov_Search::is_indexable($post)) { attemptToIndexDocument($post->ID, $document, 0); } } catch (Exception $e) { echo "Unknown Exception: {$e->getMessage()}"; } continue; } ?> </pre> <p>Indexing complete!</p> <a href="<?php echo esc_url(DigitalGov_Search_Admin::get_page_url()); ?> "><span class="button button-primary"><?php