=== Custom & Recent Pages Widget ===
Contributors: onodev77
Tags: recent pages, custom pages, selected pages, pages widget
Requires at least: 5.0
Tested up to: 6.8
Requires PHP: 7.2
Stable tag: 1.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A flexible widget to display selected or latest pages, with optional pagination. Compatible with both Classic and Block Widgets.

== Description ==
This plugin adds a widget that allows you to display a list of WordPress pages in a sidebar or widget-ready area. It offers two display modes:

- **Manual Selection**: Choose specific pages to display using a paginated selector.
- **Latest Pages**: Automatically show the most recently published pages (customizable number).

It is designed for usability and supports both the Classic Widgets interface and the Block-based Widget Editor introduced in WordPress 5.8+.

**Features**:
* Choose between showing the latest published pages or manually selected ones.
* Paginated page selector in the admin interface for easy manual selection.
* Supports unlimited pages.
* Fully compatible with Block Widgets and Classic Widgets.
* Lightweight and simple to use.

== Installation ==
1. Upload the plugin files to the `/wp-content/plugins/onodev-recent-pages-widget` directory, or install the plugin via the WordPress plugin screen.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to **Appearance > Widgets** and add the **Onodev Recent Pages Widget** to your desired widget area.
4. Select display mode (Manual or Latest), choose pages or number of latest pages, and save.

== Frequently Asked Questions ==

= Can I use this plugin with the block-based widget editor? =
Yes, this plugin fully supports both Classic Widgets and Block Widgets (introduced in WordPress 5.8).

= How many pages can I select manually? =
You can select as many pages as needed. The admin interface shows 10 pages per view with navigation arrows to browse all available pages.

= What happens if I select "Latest Pages" mode? =
You can set the number of recent pages to display. The list will automatically update based on the most recently published pages.

== Screenshots ==

1. **Widget Backend:** Select pages to show in your widget.

== Changelog ==

= 1.2 =
* Added display mode toggle: "Manual Selection" or "Latest Pages".
* Added field to set number of latest pages to display.
* Improved JS and UX for showing/hiding fields dynamically.
* Enhanced block widget compatibility and interface logic.

= 1.1 =
* Fix compatibility with block widget editor.
* Added external JS for pagination to work reliably.


= 1.0 =
* Initial release.
