Guest User

Untitled

a guest
Apr 26th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <?php
  2. if(is_user_logged_in()){
  3. $args = array(
  4. 'sort_order' => 'asc',
  5. 'sort_column' => 'post_title',
  6. 'post_type' => 'page',
  7. 'numberposts' => -1,
  8. 'post_status' => 'publish',
  9. 'suppress_filters' => false
  10. );
  11. $pages = get_posts($args);
  12. echo '<table>';
  13. foreach($pages as $page){ //pre($page);
  14. $slug = $page->post_name;
  15. $warning = (1 === preg_match('~[0-9]~', $slug)) ? 'style="background:red;"': '';
  16. echo '<tr '.$warning.'><td style="padding:10px;">'.$page->post_title.'</td><td style="padding:10px;">'.$slug.'</td></tr>';
  17. }
  18. echo '</table>';
  19. }
  20. ?>
Add Comment
Please, Sign In to add comment