=== EasyWP Mobile Featured Image ===
Contributors: life8882
Author URI: https://life8882.com
Plugin URI: https://life8882.com/plugins/easywp-mobile-featured-image/
Tags: mobile featured image, responsive image, featured image, wordpress mobile, post thumbnail, custom image
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.0
Stable tag: 2.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Set dedicated featured images for mobile devices without affecting desktop display. Automatically adapts to mobile visitors for improved user experience.

== Description ==
EasyWP Mobile Featured Image is a mobile-optimized WordPress plugin that solves the inconsistency between desktop and mobile featured image display. It allows administrators to set separate featured images for mobile devices, enhancing the browsing experience for mobile users.

### Core Features
1. **Easy Admin Setup**
   - Adds a "Mobile Featured Image" meta box to the sidebar of post/page edit screens
   - Supports image upload, preview, and removal—with the same logic as default featured images
   - Secure saving mechanism: Uses nonce verification and permission checks to ensure safe storage of image IDs
2. **Automatic Mobile Replacement**
   - Detects mobile visits automatically via `wp_is_mobile()`
   - Multi-hook adaptation: Replaces thumbnail IDs, metadata, HTML output, and post list images
   - REST API support: Automatically returns mobile featured image data for mobile API requests
3. **Flexible Extension**
   - Shortcode support: `[mobile_featured_image]` with customizable post ID, image size, and CSS classes
   - Template functions: 4 convenient functions for theme developers (check/output/get mobile images)
   - Compatible with all public post types (posts, pages, custom post types)

== Installation ==
1. Download the plugin zip file
2. Log in to your WordPress admin dashboard, go to "Plugins" → "Add New" → "Upload Plugin", upload the zip file
3. Click "Activate Plugin" to complete installation
4. Navigate to any post/page edit screen—you'll find the "Mobile Featured Image" meta box in the sidebar

== Usage ==
### I. Admin Operation (Set Mobile Featured Image)
1. Edit any post or page, locate the "Mobile Featured Image" meta box in the sidebar
2. Click "Select Image" to choose/upload a mobile-optimized image from the media library
3. The image will preview automatically—click "Remove Image" to replace or delete it
4. Save the post/page—mobile visitors will see the dedicated mobile image automatically

### II. For Theme Developers (Extension Features)
1. **Shortcode Usage**
   - Basic usage: `[mobile_featured_image]` (displays mobile featured image for current post)
   - Custom usage: `[mobile_featured_image id="123" size="medium" class="custom-class" alt="Custom alt text"]`
2. **Template Function Usage**
   - `has_mobile_featured_image( $post_id )`: Checks if a post has a mobile featured image
   - `the_mobile_featured_image( $size, $attr )`: Outputs the mobile featured image (falls back to default if none set)
   - `get_mobile_featured_image_url( $post_id, $size )`: Retrieves the URL of the mobile featured image
   - `get_mobile_featured_image_id( $post_id )`: Retrieves the ID of the mobile featured image

== Frequently Asked Questions ==
Q: Why isn't my mobile featured image showing on mobile devices?
A: Please check: 1. The post/page has been saved; 2. You're accessing from a mobile device (use phone or browser mobile simulation mode); 3. A mobile featured image has been set (default featured image will show if not set)

Q: Can I set mobile featured images for custom post types?
A: Yes, the plugin supports all public post types by default—no extra configuration needed

Q: Can I customize the image size?
A: Yes, both shortcodes and template functions support WordPress built-in image sizes (thumbnail/medium/large/full) or custom image sizes

== Changelog ==
= 2.0.0 =
- Major update: Enhanced REST API compatibility
- Improved mobile image replacement logic
- Added lazy loading support for shortcode
- Optimized admin interface responsiveness
= 1.0 =
- Initial release
- Implemented mobile featured image setup and saving
- Automatic mobile detection and image replacement
- Added shortcode and 4 template helper functions