Web Docs'; } return $links; } add_filter('plugin_row_meta', 'advance_catlist_post_plugin_meta', 10, 2); // Enqueue the CSS file function advance_catlist_post_enqueue_styles() { wp_enqueue_style('advance-catlist-post-style', plugin_dir_url(__FILE__) . 'assets/style.css'); } add_action('wp_enqueue_scripts', 'advance_catlist_post_enqueue_styles'); // Shortcode Logic function advance_catlist_post_shortcode($atts) { $default_number_of_posts = get_option('default_number_of_posts', 5); $show_date = get_option('show_date', 'no'); // Get the setting for showing date $atts = shortcode_atts(array( 'name' => '', '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() { ?>