Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(is_user_logged_in()){
- $args = array(
- 'sort_order' => 'asc',
- 'sort_column' => 'post_title',
- 'post_type' => 'page',
- 'numberposts' => -1,
- 'post_status' => 'publish',
- 'suppress_filters' => false
- );
- $pages = get_posts($args);
- echo '<table>';
- foreach($pages as $page){ //pre($page);
- $slug = $page->post_name;
- $warning = (1 === preg_match('~[0-9]~', $slug)) ? 'style="background:red;"': '';
- echo '<tr '.$warning.'><td style="padding:10px;">'.$page->post_title.'</td><td style="padding:10px;">'.$slug.'</td></tr>';
- }
- echo '</table>';
- }
- ?>
Add Comment
Please, Sign In to add comment