args = $args; if ( ! $this->args['print'] ) { $this->the_html_sitemaps( $this->args ); } } /** * Get the author list * * @see https://codex.wordpress.org/Function_Reference/wp_list_authors * @param array $author_args Arguments for wp_list_author(). * @return string Return list of author */ private function get_wp_list_author( $author_args = array() ) { $author_args['echo'] = false; return wp_list_authors( $author_args ); } /** * Get the pages list * * @see https://codex.wordpress.org/Function_Reference/wp_list_pages * @param array $pages_args Argument for wp_list_pages() * @return string Return list of pages */ private function get_wp_list_pages( $pages_args = array() ) { $pages_args['title_li'] = ''; $pages_args['echo'] = false; return wp_list_pages( $pages_args ); } /** * Print the HTML sitemaps * * @param array $args The arguments for class. */ public function the_html_sitemaps( $args = array() ) { echo $this->get_the_html_sitemaps( $args ); // XSS ok. } /** * Get the HTML sitemaps outputs * * @param array $args Argument for HTML sitemaps. * @return string Return the HTML sitemaps */ public function get_the_html_sitemaps( $args = array() ) { /** * The post HTML output * * @var string */ $posts_output = ''; $posts_output .= '
'; //http://yoast.com/html-sitemap-wordpress/ // // var_dump(get_pages()); // var_dump(get_posts()); /** * Args for wp_list_authors function * * @var array */ $author_args = array( 'exclude_admin' => false, ); $posts_output .= '

' . __( 'Authors:', 'italystrap' ) . '

'; /** * A list of post names registered * * @var array */ $post_types = get_post_types( array( 'public' => true ) ); foreach ( $post_types as $post_type ) { // if ( in_array( $post_type, array('post','page','attachment') ) ) // continue; $pt = get_post_type_object( $post_type ); if ( 'post' === $post_type ) { $posts_output .= '

' . $pt->labels->name . '

'; } elseif ( 'page' === $post_type ) { $posts_output .= '

' . $pt->labels->name . '

'; } elseif ( 'attachment' === $post_type ) { continue; } else { /** * Get all custopm post type */ $posts_output .= '

' . $pt->labels->name . '

'; } } $posts_output .= '
'; return apply_filters( 'italystrap_html_sitemaps', $posts_output ); } }