'', 'date_modified' => 'no', 'date_class' => 'icp_date', 'numberposts' => $default_number_of_posts, ), $atts, 'catlist'); $args = array( 'posts_per_page' => intval($atts['numberposts']), ); if (!empty($atts['name'])) { $args['category_name'] = sanitize_text_field($atts['name']); } $query = new WP_Query($args); $output = ''; wp_reset_postdata(); return $output; } add_shortcode('catlist', 'advance_catlist_post_shortcode'); // Add Settings Page function advance_catlist_post_add_admin_menu() { add_menu_page( esc_html__('Advance Catlist Post', 'advance-catlist-post'), esc_html__('Catlist Settings', 'advance-catlist-post'), 'manage_options', 'advance_catlist_post', 'advance_catlist_post_options_page', 'dashicons-admin-settings', 20 ); } add_action('admin_menu', 'advance_catlist_post_add_admin_menu'); function advance_catlist_post_options_page() { ?>