Changeset 3410439
- Timestamp:
- 12/04/2025 05:48:08 AM (3 months ago)
- Location:
- default-post-author
- Files:
-
- 21 added
- 1 deleted
- 5 edited
- 1 copied
-
assets/icon-128x128.png (added)
-
assets/icon-256x256.gif (deleted)
-
assets/icon-256x256.png (added)
-
assets/screenshot-1.png (modified) (previous)
-
assets/screenshot-2.png (added)
-
tags/2.2 (copied) (copied from default-post-author/trunk)
-
tags/2.2/assets (added)
-
tags/2.2/assets/css (added)
-
tags/2.2/assets/css/admin-style.css (added)
-
tags/2.2/assets/js (added)
-
tags/2.2/assets/js/admin-script.js (added)
-
tags/2.2/default-post-author.php (modified) (5 diffs)
-
tags/2.2/includes (added)
-
tags/2.2/includes/class-dpap-admin.php (added)
-
tags/2.2/readme.txt (modified) (4 diffs)
-
tags/2.2/templates (added)
-
tags/2.2/templates/admin-page.php (added)
-
trunk/assets (added)
-
trunk/assets/css (added)
-
trunk/assets/css/admin-style.css (added)
-
trunk/assets/js (added)
-
trunk/assets/js/admin-script.js (added)
-
trunk/default-post-author.php (modified) (5 diffs)
-
trunk/includes (added)
-
trunk/includes/class-dpap-admin.php (added)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/templates (added)
-
trunk/templates/admin-page.php (added)
Legend:
- Unmodified
- Added
- Removed
-
default-post-author/tags/2.2/default-post-author.php
r3343426 r3410439 4 4 * Plugin URI: https://wordpress.org/plugins/default-post-author/ 5 5 * Description: The easiest way to set default post author in your WordPress Site. 6 * Version: 2. 16 * Version: 2.2 7 7 * Requires at least: 6.1 8 8 * Requires PHP: 8.0 … … 15 15 16 16 if ( ! defined( 'ABSPATH' ) ) { 17 exit; // Exit if accessed directly. 17 exit; 18 } 19 20 // Plugin constants. 21 define( 'DPAP_VERSION', '2.2' ); 22 define( 'DPAP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 23 define( 'DPAP_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 24 define( 'DPAP_OPTIONS', 'dpap_options' ); 25 26 // Include admin class. 27 require_once DPAP_PLUGIN_DIR . 'includes/class-dpap-admin.php'; 28 29 /** 30 * Initialize admin. 31 * 32 * @return void 33 */ 34 function dpap_init() { 35 if ( is_admin() ) { 36 new DPAP_Admin(); 37 } 38 } 39 add_action( 'plugins_loaded', 'dpap_init' ); 40 41 /** 42 * Get plugin option. 43 * 44 * @param string $key Option key. 45 * @param mixed $default Default value. 46 * @return mixed Option value. 47 */ 48 function dpap_get_option( $key, $default = '' ) { 49 $options = get_option( DPAP_OPTIONS, array() ); 50 return isset( $options[ $key ] ) ? $options[ $key ] : $default; 18 51 } 19 52 20 53 /** 21 * Option name constant.22 */23 if ( ! defined( 'DPAP_OPTION_NAME' ) ) {24 define( 'DPAP_OPTION_NAME', 'default_post_author' );25 }26 27 /**28 * Register setting for storing default author ID.29 */30 function dpap_register_setting() {31 register_setting(32 'dpap_options_group',33 DPAP_OPTION_NAME,34 array(35 'type' => 'integer',36 'sanitize_callback' => 'absint',37 'default' => 1,38 )39 );40 }41 add_action( 'admin_init', 'dpap_register_setting' );42 43 /**44 * Add settings page under Settings menu.45 */46 function dpap_add_admin_menu() {47 add_options_page(48 __( 'Default Post Author', 'default-post-author' ),49 __( 'Default Post Author', 'default-post-author' ),50 'manage_options',51 'default-post-author',52 'dpap_render_options_page'53 );54 }55 add_action( 'admin_menu', 'dpap_add_admin_menu' );56 57 /**58 * Render the options page HTML. The form posts to admin-post.php handlers.59 */60 function dpap_render_options_page() {61 if ( ! current_user_can( 'manage_options' ) ) {62 return;63 }64 65 $current_value = get_option( DPAP_OPTION_NAME, 1 );66 67 // Fetch users with roles author, editor, administrator.68 $user_query = new WP_User_Query( array(69 'role__in' => array( 'author', 'editor', 'administrator' ),70 'orderby' => 'display_name',71 'order' => 'ASC',72 ) );73 74 $users = $user_query->get_results();75 ?>76 <div class="wrap">77 <h1><?php esc_html_e( 'Default Post Author Settings', 'default-post-author' ); ?></h1>78 79 <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">80 <?php // Settings fields for WP Settings API (keeps option group consistent).81 settings_fields( 'dpap_options_group' ); ?>82 83 <table class="form-table" role="presentation">84 <tr>85 <th scope="row"><label for="default_post_author"><?php esc_html_e( 'Default Post Author', 'default-post-author' ); ?></label></th>86 <td>87 <select id="default_post_author" name="default_post_author">88 <?php if ( empty( $users ) ) : ?>89 <option value="0"><?php esc_html_e( 'No eligible users found', 'default-post-author' ); ?></option>90 <?php else : ?>91 <?php foreach ( $users as $user ) : ?>92 <option value="<?php echo esc_attr( $user->ID ); ?>" <?php selected( $user->ID, $current_value ); ?>>93 <?php echo esc_html( $user->display_name ); ?>94 </option>95 <?php endforeach; ?>96 <?php endif; ?>97 </select>98 <p class="description"><?php esc_html_e( 'Select the default author for new posts.', 'default-post-author' ); ?></p>99 </td>100 </tr>101 </table>102 103 <?php // Nonce and action for saving settings.104 wp_nonce_field( 'dpap_save_settings_action', 'dpap_save_settings_nonce' ); ?>105 <input type="hidden" name="action" value="dpap_save_settings">106 <?php submit_button( __( 'Save Changes', 'default-post-author' ), 'primary', 'submit' ); ?>107 </form>108 109 <hr />110 111 <h2><?php esc_html_e( 'Update Existing Posts Authors', 'default-post-author' ); ?></h2>112 <p><?php esc_html_e( "Click the button below to change all existing posts' authors to the selected default author. This operation uses batch updates to avoid timeouts and will respect WordPress hooks for each post update.", 'default-post-author' ); ?></p>113 114 <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">115 <?php wp_nonce_field( 'dpap_update_old_posts_action', 'dpap_update_old_posts_nonce' ); ?>116 <input type="hidden" name="action" value="dpap_update_old_posts">117 <input type="hidden" name="default_post_author" value="<?php echo esc_attr( $current_value ); ?>">118 <?php submit_button( __( 'Update All Existing Posts to Default Author', 'default-post-author' ), 'secondary', 'dpap_update_old_authors' ); ?>119 </form>120 </div>121 <?php122 }123 124 /**125 * Handle save settings via admin-post action.126 */127 function dpap_handle_save_settings() {128 if ( ! current_user_can( 'manage_options' ) ) {129 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'default-post-author' ) );130 }131 132 $nonce = isset( $_POST['dpap_save_settings_nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['dpap_save_settings_nonce'] ) ) : '';133 134 if ( ! wp_verify_nonce( $nonce, 'dpap_save_settings_action' ) ) {135 wp_die( esc_html__( 'Security check failed.', 'default-post-author' ) );136 }137 138 if ( isset( $_POST['default_post_author'] ) ) {139 $new_author = absint( wp_unslash( $_POST['default_post_author'] ) );140 update_option( DPAP_OPTION_NAME, $new_author );141 }142 143 wp_safe_redirect( wp_get_referer() ? wp_get_referer() : admin_url( 'options-general.php?page=default-post-author' ) );144 exit;145 }146 add_action( 'admin_post_dpap_save_settings', 'dpap_handle_save_settings' );147 148 /**149 * Handle update of existing posts to the selected default author.150 * Processes posts in batches to avoid memory/timeouts and uses wp_update_post so hooks run.151 */152 function dpap_handle_update_old_posts() {153 if ( ! current_user_can( 'manage_options' ) ) {154 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'default-post-author' ) );155 }156 157 $nonce = isset( $_POST['dpap_update_old_posts_nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['dpap_update_old_posts_nonce'] ) ) : '';158 159 if ( ! wp_verify_nonce( $nonce, 'dpap_update_old_posts_action' ) ) {160 wp_die( esc_html__( 'Security check failed.', 'default-post-author' ) );161 }162 163 $default_author_id = get_option( DPAP_OPTION_NAME, 1 );164 165 if ( isset( $_POST['default_post_author'] ) ) {166 $default_author_id = absint( wp_unslash( $_POST['default_post_author'] ) );167 update_option( DPAP_OPTION_NAME, $default_author_id );168 }169 170 $user = get_userdata( $default_author_id );171 if ( ! $user || ! array_intersect( array( 'author', 'editor', 'administrator' ), $user->roles ) ) {172 wp_die( esc_html__( 'Selected default author is invalid.', 'default-post-author' ) );173 }174 175 // Batch process posts to avoid timeout/memory issues.176 $args = array(177 'post_type' => 'post',178 'post_status' => 'any',179 'posts_per_page' => 100,180 'fields' => 'ids',181 'orderby' => 'ID',182 'order' => 'ASC',183 'paged' => 1,184 );185 186 $total_updated = 0;187 188 while ( true ) {189 $query = new WP_Query( $args );190 if ( ! $query->have_posts() ) {191 break;192 }193 194 foreach ( $query->posts as $post_id ) {195 // Skip auto-drafts.196 $post_status = get_post_status( $post_id );197 if ( 'auto-draft' === $post_status ) {198 continue;199 }200 201 // Only update if different.202 $current_author = (int) get_post_field( 'post_author', $post_id );203 if ( $current_author === $default_author_id ) {204 continue;205 }206 207 // Use wp_update_post so hooks & cache invalidation run as expected.208 $updated_post_id = wp_update_post( array(209 'ID' => $post_id,210 'post_author' => $default_author_id,211 ), true );212 213 if ( is_wp_error( $updated_post_id ) ) {214 if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {215 // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log216 error_log( sprintf( 'dpap: failed to update post %d: %s', $post_id, $updated_post_id->get_error_message() ) );217 }218 continue;219 }220 221 $total_updated++;222 }223 224 // Move to next page.225 $args['paged']++;226 227 // Avoid infinite loops - break if no more found.228 if ( 0 === count( $query->posts ) ) {229 break;230 }231 232 // Clean up.233 wp_reset_postdata();234 }235 236 /* translators: %d: number of posts updated */237 $message = sprintf( esc_html( _n( '%d post author updated.', '%d post authors updated.', $total_updated, 'default-post-author' ) ), $total_updated );238 239 // Store message as transient to display after redirect.240 set_transient( 'dpap_update_result', $message, 30 );241 242 wp_safe_redirect( wp_get_referer() ? wp_get_referer() : admin_url( 'options-general.php?page=default-post-author' ) );243 exit;244 }245 add_action( 'admin_post_dpap_update_old_posts', 'dpap_handle_update_old_posts' );246 247 /**248 * Show admin notices for the batch update result (transient-based).249 */250 function dpap_admin_notices() {251 if ( ! current_user_can( 'manage_options' ) ) {252 return;253 }254 255 $message = get_transient( 'dpap_update_result' );256 if ( $message ) {257 echo '<div class="notice notice-success is-dismissible"><p>' . esc_html( $message ) . '</p></div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped258 delete_transient( 'dpap_update_result' );259 }260 }261 add_action( 'admin_notices', 'dpap_admin_notices' );262 263 /**264 54 * Set default author for new posts during creation only. 265 * Uses wp_insert_post_data filter.266 55 * 267 56 * @param array $data Array of slashed post data. … … 270 59 */ 271 60 function dpap_force_post_author( $data, $postarr ) { 272 $default_author_id = (int) get_option( DPAP_OPTION_NAME, 1 ); 61 // Check if feature is enabled. 62 if ( ! dpap_get_option( 'enable_default_author', true ) ) { 63 return $data; 64 } 273 65 274 if ( empty( $postarr['ID'] ) ) { 66 $default_author_id = (int) dpap_get_option( 'default_author', 1 ); 67 68 // Only for new posts (not updates). 69 if ( empty( $postarr['ID'] ) && 'post' === $data['post_type'] ) { 275 70 $data['post_author'] = $default_author_id; 276 71 } … … 282 77 /** 283 78 * Ensure revision author matches original post author. 284 * Hook into wp_save_post_revision which provides revision ID and original post.285 * Use wp_update_post to avoid direct DB queries.286 79 * 287 80 * @param int $revision_id Revision post ID. 288 * @param WP_Post $post The original post object. 81 * @param WP_Post $post The original post object. 82 * @return void 289 83 */ 290 84 function dpap_set_revision_author( $revision_id, $post ) { 85 // Check if feature is enabled. 86 if ( ! dpap_get_option( 'sync_revisions', true ) ) { 87 return; 88 } 89 291 90 $revision_id = (int) $revision_id; 292 91 $post_author = (int) $post->post_author; 293 92 294 $result = wp_update_post( array( 295 'ID' => $revision_id, 296 'post_author' => $post_author, 297 ), true ); 93 $result = wp_update_post( 94 array( 95 'ID' => $revision_id, 96 'post_author' => $post_author, 97 ), 98 true 99 ); 298 100 299 101 if ( is_wp_error( $result ) ) { 300 if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {102 if ( defined( 'WP_DEBUG' ) && WP_DEBUG && defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) { 301 103 // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log 302 104 error_log( 'dpap: Failed to update revision author for post ID ' . $post->ID . ': ' . $result->get_error_message() ); … … 306 108 add_action( 'wp_save_post_revision', 'dpap_set_revision_author', 10, 2 ); 307 109 308 309 // Redirect to settings page once the plugin is activated 310 110 /** 111 * Redirect to settings page on activation. 112 * 113 * @param string $plugin Plugin basename. 114 * @return void 115 */ 311 116 function dpap_activation_redirect( $plugin ) { 312 if( $plugin == plugin_basename( __FILE__ ) ) { 117 if ( plugin_basename( __FILE__ ) === $plugin ) { 118 // Set default options on first activation. 119 if ( ! get_option( DPAP_OPTIONS ) ) { 120 update_option( 121 DPAP_OPTIONS, 122 array( 123 'default_author' => 1, 124 'enable_default_author' => true, 125 'sync_revisions' => true, 126 ) 127 ); 128 } 313 129 wp_safe_redirect( admin_url( 'options-general.php?page=default-post-author' ) ); 314 exit;130 exit; 315 131 } 316 132 } 317 133 add_action( 'activated_plugin', 'dpap_activation_redirect' ); 318 134 319 320 135 /** 321 * Uninstall cleanup: remove option when plugin is uninstalled. 136 * Uninstall cleanup. 137 * 138 * @return void 322 139 */ 323 140 function dpap_uninstall() { 324 delete_option( DPAP_OPTION _NAME);141 delete_option( DPAP_OPTIONS ); 325 142 } 326 143 register_uninstall_hook( __FILE__, 'dpap_uninstall' ); 327 328 /* End of file */329 -
default-post-author/tags/2.2/readme.txt
r3343426 r3410439 1 1 === Default Post Author === 2 2 Contributors: wpdelower, monarchwp23 3 Tags: post author, default post author, wp post, posts 3 Tags: post author, default post author, wp post, posts, author management 4 4 Requires at least: 6.1 5 Tested up to: 6. 85 Tested up to: 6.9 6 6 Requires PHP: 8.0 7 Stable tag: 2. 17 Stable tag: 2.2 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 Donate Link: https://www.monarchwp.com/donate 11 11 12 13 The easiest way to set a default post author in your WordPress Site. 12 The easiest way to set a default post author in your WordPress site. 14 13 15 14 == Description == … … 17 16 **Try Default Post Author on a demo site: Click here => [https://tastewp.com/plugins/default-post-author](https://tastewp.org/plugins/default-post-author/).** 18 17 19 The Default Post Author plugin is a powerful tool designed to simplify the process of setting a default post author on your WordPress site. With this plugin, you can easily define a default author for all new posts, ensuring consistency and saving you valuable time. 20 21 Setting up the plugin is quick and straightforward. Once installed and activated, you can navigate to the plugin settings page in your WordPress dashboard. Here, you will find a user-friendly interface that allows you to choose the default author from a list of existing users on your site. 18 The **Default Post Author** plugin is a powerful tool designed to simplify the process of setting a default post author on your WordPress site. With this plugin, you can easily define a default author for all new posts, ensuring consistency and saving you valuable time. 19 20 = ✨ Key Features = 21 22 * **Easy Setup** - Quick and straightforward configuration 23 * **Modern Admin Interface** - Beautiful, intuitive settings page with smooth animations 24 * **Toggle Controls** - Enable/disable features with modern toggle switches 25 * **Bulk Update** - Update all existing posts to the default author with one click 26 * **Revision Sync** - Keep revision authors in sync with parent posts 27 * **AJAX-Powered** - Real-time saving without page reloads 28 * **Progress Tracking** - Visual progress bar for bulk operations 29 * **Responsive Design** - Works perfectly on all devices 30 * **Lightweight** - Optimized code for maximum performance 31 32 = 🎨 Modern Admin Interface = 33 34 Version 2.2 introduces a completely redesigned admin interface featuring: 35 36 * Clean, card-based layout 37 * Smooth animations and transitions 38 * Modern toggle switches instead of checkboxes 39 * Interactive buttons with loading states 40 * Toast notifications for instant feedback 41 * Progress indicators for bulk operations 42 * Fully responsive design 43 44 = 🚀 How It Works = 45 46 1. Install and activate the plugin 47 2. Navigate to **Settings > Default Post Author** 48 3. Select your preferred default author from the dropdown 49 4. Enable/disable features using the toggle switches 50 5. Save your settings - that's it! 22 51 23 52 By selecting a default author, you ensure that every new post created on your site will automatically be attributed to that specific author. This feature is particularly useful for multi-author blogs or websites where different users contribute content regularly. 24 53 25 The Default Post Author plugin also offers additional customization options to enhance your workflow. For instance, you can choose to override the default author setting on a per-post basis, giving you the flexibility to assign different authors to specific posts if needed. 26 27 Furthermore, the plugin provides seamless integration with other popular plugins and themes, ensuring compatibility and a smooth user experience. It is also regularly updated to ensure optimal performance and compatibility with the latest versions of WordPress. 28 29 In summary, the Default Post Author plugin is a must-have tool for WordPress site owners who want to streamline their content creation process. By setting a default post author, you can ensure consistency and save time in managing authorship for your posts. Install this plugin today and enjoy the benefits of effortless default author assignment in your WordPress site. 54 = 🔧 Feature Toggles = 55 56 * **Enable Default Author** - Turn the default author feature on/off without deactivating the plugin 57 * **Sync Revision Authors** - Keep revision authors matching the parent post author 58 59 = 📦 Bulk Update Existing Posts = 60 61 Need to change the author of all existing posts? The plugin includes a powerful bulk update feature that: 62 63 * Processes posts in batches to prevent timeouts 64 * Shows real-time progress 65 * Provides detailed completion messages 66 * Works with any number of posts 67 68 = 🔒 Security = 69 70 * Proper WordPress nonces for all operations 71 * Capability checks for admin functions 72 * Sanitized inputs and escaped outputs 73 * Follows WordPress coding standards 74 75 = 🌐 Compatibility = 76 77 * WordPress 6.1 and higher 78 * PHP 8.0 and higher 79 * Compatible with multisite installations 80 * Works with popular themes and plugins 30 81 31 82 = Contributing & Bug Report = … … 35 86 36 87 = From within WordPress = 37 1. Visit 'Plugins > Add New'38 2. Search for 'Default Post Author'39 3. Activate Default Post Author from your Plugins page.40 4. Go to Settings > Default Post Author41 5. At the bottom of that page you will see a dropdown with all your users list42 4. That's all. 88 1. Visit **Plugins > Add New** 89 2. Search for **'Default Post Author'** 90 3. Click **Install Now** and then **Activate** 91 4. Go to **Settings > Default Post Author** 92 5. Select your default author and configure the toggle options 93 6. Click **Save Settings** - that's all! 43 94 44 95 = Manual Installation = 45 1. Upload the `default-post-author` folder to the `/wp-content/plugins/` directory 46 2. Activate the Default Post Author plugin through the 'Plugins' menu in WordPress 47 3. That's all. 48 96 1. Download the plugin zip file 97 2. Upload the `default-post-author` folder to the `/wp-content/plugins/` directory 98 3. Activate the **Default Post Author** plugin through the **Plugins** menu in WordPress 99 4. Navigate to **Settings > Default Post Author** to configure 100 101 = After Activation = 102 The plugin will automatically redirect you to the settings page after activation, making it easy to get started right away. 49 103 50 104 == Frequently Asked Questions == … … 52 106 = Where is the settings page? = 53 107 54 Settings > General 108 Navigate to **Settings > Default Post Author** in your WordPress admin dashboard. 55 109 56 110 = Is it compatible with multisite? = 57 111 58 Yes! It's compatible with both single sites and multisite. 59 60 = How frequently is the “Default post author” plugin updated? = 112 Yes! The plugin is fully compatible with both single sites and WordPress multisite installations. 113 114 = Can I disable the default author feature temporarily? = 115 116 Yes! Version 2.2 includes a toggle switch to enable/disable the default author feature without deactivating the plugin. 117 118 = How does the bulk update feature work? = 119 120 The bulk update feature processes posts in batches of 100 to prevent server timeouts. It shows a progress bar and notifies you when complete. Only posts with different authors are updated. 121 122 = Will this affect my existing posts? = 123 124 No, by default the plugin only affects new posts. To update existing posts, you must explicitly use the **Update All Posts** feature on the settings page. 125 126 = What happens to post revisions? = 127 128 If the **Sync Revision Authors** toggle is enabled, revision authors will automatically match their parent post's author. 129 130 = How frequently is the plugin updated? = 61 131 62 132 The plugin is actively maintained and updated regularly to ensure compatibility with the latest versions of WordPress and to address any potential issues. 63 133 64 = Is there any customer support available? = 65 66 Yes, in case you encounter any difficulties or have questions, the plugin’s support team is available to assist you and provide prompt and helpful responses. 67 134 = Is there customer support available? = 135 136 Yes! If you encounter any difficulties or have questions, please visit the [support forum](https://wordpress.org/support/plugin/default-post-author/) or contact us through our website. 137 138 = Can I contribute to the plugin? = 139 140 Absolutely! We welcome contributions on our [GitHub repository](https://github.com/WordPress-Satkhira-Community/default-post-author). 68 141 69 142 == Screenshots == 70 143 71 1. A general settings page where you can set the default post author option. 144 1. Modern settings page with card-based layout and gradient header 145 2. Default author selection with styled dropdown 146 3. Feature toggles with modern switch controls 147 4. Bulk update section with progress indicator 148 5. Success notification toast message 149 6. Mobile responsive design 72 150 73 151 == Upgrade Notice == 74 152 153 = 2.2 = 154 Major UI update! New modern admin interface with toggle switches, AJAX saving, progress indicators, and improved user experience. Recommended for all users. 155 156 = 2.1 = 157 Bug fixes and stability improvements. 158 159 = 2.0 = 160 Security and performance updates. New bulk update feature to change all existing posts to the default author. 161 162 == Changelog == 163 164 = 2.2 - (Decemeber 04, 2025) = 165 * **New:** Completely redesigned modern admin interface 166 * **New:** Toggle switches replace checkboxes for better UX 167 * **New:** AJAX-powered settings saving (no page reload) 168 * **New:** Toast notifications for instant feedback 169 * **New:** Progress bar for bulk update operations 170 * **New:** Enable/disable default author feature toggle 171 * **New:** Sync revision authors toggle option 172 * **New:** Animated UI elements and smooth transitions 173 * **New:** Card-based settings layout 174 * **New:** Responsive design improvements 175 * **Improved:** Separated code structure (PHP, CSS, JS) 176 * **Improved:** Better code organization with admin class 177 * **Improved:** Enhanced security measures 178 * **Improved:** Optimized asset loading 179 * **Improved:** Better error handling 180 75 181 = 2.1 - (August 12, 2025) = 76 -Bug Fix182 * Bug Fix 77 183 78 184 = 2.0 - (August 12, 2025) = 79 -Security Update80 -Performance Update81 -Ability to Update All Existing Posts to Default Author185 * Security Update 186 * Performance Update 187 * New: Ability to Update All Existing Posts to Default Author 82 188 83 189 = 1.1.5 - (January 28, 2025) = 84 -Security Update85 -Performance Update86 -TasteWP Live Demo Added190 * Security Update 191 * Performance Update 192 * TasteWP Live Demo Added 87 193 88 194 = 1.1.4 - (November 17, 2024) = 89 -Security Update90 -Performance Update91 -WordPress 6.7 compatibility195 * Security Update 196 * Performance Update 197 * WordPress 6.7 compatibility 92 198 93 199 = 1.1.3 - (July 17, 2024) = 94 -Security Update95 -Performance Update96 -WordPress 6.6 compatibility200 * Security Update 201 * Performance Update 202 * WordPress 6.6 compatibility 97 203 98 204 = 1.1.2 - (April 15, 2024) = 99 -Security Update205 * Security Update 100 206 101 207 = 1.1.1 - (April 15, 2024) = 102 -Bug Fix103 -Performance Update104 -Security Update105 106 = 1.1 - 23-03-2024=107 -Performance Update108 109 = 1.0.2 - 17-02-2024=110 -Performance Update111 112 = 1.0.1 - 17-02-2024=113 -Simple Bug Fix208 * Bug Fix 209 * Performance Update 210 * Security Update 211 212 = 1.1 - (March 23, 2024) = 213 * Performance Update 214 215 = 1.0.2 - (February 17, 2024) = 216 * Performance Update 217 218 = 1.0.1 - (February 17, 2024) = 219 * Simple Bug Fix 114 220 115 221 = 1.0 = 116 222 * Initial release 117 118 == Changelog ==119 120 = 2.1 - (August 12, 2025) =121 - Bug Fix122 123 = 2.0 - (August 12, 2025) =124 - Security Update125 - Performance Update126 - Ability to Update All Existing Posts to Default Author127 128 = 1.1.5 - (January 28, 2025) =129 - Security Update130 - Performance Update131 - TasteWP Live Demo Added132 133 = 1.1.4 - (November 17, 2024) =134 - Security Update135 - Performance Update136 - WordPress 6.7 compatibility137 138 = 1.1.3 - (July 17, 2024) =139 - Security Update140 - Performance Update141 - WordPress 6.6 compatibility142 143 = 1.1.2 - (April 15, 2024) =144 - Security Update145 146 = 1.1.1 - (April 15, 2024) =147 - Bug Fix148 - Performance Update149 - Security Update150 151 = 1.1 - 23-03-2024 =152 - Performance Update153 154 = 1.0.2 - 17-02-2024 =155 - Performance Update156 157 = 1.0.1 - 17-02-2024 =158 - Simple Bug Fix159 160 = 1.0 =161 * Initial release -
default-post-author/trunk/default-post-author.php
r3343426 r3410439 4 4 * Plugin URI: https://wordpress.org/plugins/default-post-author/ 5 5 * Description: The easiest way to set default post author in your WordPress Site. 6 * Version: 2. 16 * Version: 2.2 7 7 * Requires at least: 6.1 8 8 * Requires PHP: 8.0 … … 15 15 16 16 if ( ! defined( 'ABSPATH' ) ) { 17 exit; // Exit if accessed directly. 17 exit; 18 } 19 20 // Plugin constants. 21 define( 'DPAP_VERSION', '2.2' ); 22 define( 'DPAP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 23 define( 'DPAP_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 24 define( 'DPAP_OPTIONS', 'dpap_options' ); 25 26 // Include admin class. 27 require_once DPAP_PLUGIN_DIR . 'includes/class-dpap-admin.php'; 28 29 /** 30 * Initialize admin. 31 * 32 * @return void 33 */ 34 function dpap_init() { 35 if ( is_admin() ) { 36 new DPAP_Admin(); 37 } 38 } 39 add_action( 'plugins_loaded', 'dpap_init' ); 40 41 /** 42 * Get plugin option. 43 * 44 * @param string $key Option key. 45 * @param mixed $default Default value. 46 * @return mixed Option value. 47 */ 48 function dpap_get_option( $key, $default = '' ) { 49 $options = get_option( DPAP_OPTIONS, array() ); 50 return isset( $options[ $key ] ) ? $options[ $key ] : $default; 18 51 } 19 52 20 53 /** 21 * Option name constant.22 */23 if ( ! defined( 'DPAP_OPTION_NAME' ) ) {24 define( 'DPAP_OPTION_NAME', 'default_post_author' );25 }26 27 /**28 * Register setting for storing default author ID.29 */30 function dpap_register_setting() {31 register_setting(32 'dpap_options_group',33 DPAP_OPTION_NAME,34 array(35 'type' => 'integer',36 'sanitize_callback' => 'absint',37 'default' => 1,38 )39 );40 }41 add_action( 'admin_init', 'dpap_register_setting' );42 43 /**44 * Add settings page under Settings menu.45 */46 function dpap_add_admin_menu() {47 add_options_page(48 __( 'Default Post Author', 'default-post-author' ),49 __( 'Default Post Author', 'default-post-author' ),50 'manage_options',51 'default-post-author',52 'dpap_render_options_page'53 );54 }55 add_action( 'admin_menu', 'dpap_add_admin_menu' );56 57 /**58 * Render the options page HTML. The form posts to admin-post.php handlers.59 */60 function dpap_render_options_page() {61 if ( ! current_user_can( 'manage_options' ) ) {62 return;63 }64 65 $current_value = get_option( DPAP_OPTION_NAME, 1 );66 67 // Fetch users with roles author, editor, administrator.68 $user_query = new WP_User_Query( array(69 'role__in' => array( 'author', 'editor', 'administrator' ),70 'orderby' => 'display_name',71 'order' => 'ASC',72 ) );73 74 $users = $user_query->get_results();75 ?>76 <div class="wrap">77 <h1><?php esc_html_e( 'Default Post Author Settings', 'default-post-author' ); ?></h1>78 79 <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">80 <?php // Settings fields for WP Settings API (keeps option group consistent).81 settings_fields( 'dpap_options_group' ); ?>82 83 <table class="form-table" role="presentation">84 <tr>85 <th scope="row"><label for="default_post_author"><?php esc_html_e( 'Default Post Author', 'default-post-author' ); ?></label></th>86 <td>87 <select id="default_post_author" name="default_post_author">88 <?php if ( empty( $users ) ) : ?>89 <option value="0"><?php esc_html_e( 'No eligible users found', 'default-post-author' ); ?></option>90 <?php else : ?>91 <?php foreach ( $users as $user ) : ?>92 <option value="<?php echo esc_attr( $user->ID ); ?>" <?php selected( $user->ID, $current_value ); ?>>93 <?php echo esc_html( $user->display_name ); ?>94 </option>95 <?php endforeach; ?>96 <?php endif; ?>97 </select>98 <p class="description"><?php esc_html_e( 'Select the default author for new posts.', 'default-post-author' ); ?></p>99 </td>100 </tr>101 </table>102 103 <?php // Nonce and action for saving settings.104 wp_nonce_field( 'dpap_save_settings_action', 'dpap_save_settings_nonce' ); ?>105 <input type="hidden" name="action" value="dpap_save_settings">106 <?php submit_button( __( 'Save Changes', 'default-post-author' ), 'primary', 'submit' ); ?>107 </form>108 109 <hr />110 111 <h2><?php esc_html_e( 'Update Existing Posts Authors', 'default-post-author' ); ?></h2>112 <p><?php esc_html_e( "Click the button below to change all existing posts' authors to the selected default author. This operation uses batch updates to avoid timeouts and will respect WordPress hooks for each post update.", 'default-post-author' ); ?></p>113 114 <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">115 <?php wp_nonce_field( 'dpap_update_old_posts_action', 'dpap_update_old_posts_nonce' ); ?>116 <input type="hidden" name="action" value="dpap_update_old_posts">117 <input type="hidden" name="default_post_author" value="<?php echo esc_attr( $current_value ); ?>">118 <?php submit_button( __( 'Update All Existing Posts to Default Author', 'default-post-author' ), 'secondary', 'dpap_update_old_authors' ); ?>119 </form>120 </div>121 <?php122 }123 124 /**125 * Handle save settings via admin-post action.126 */127 function dpap_handle_save_settings() {128 if ( ! current_user_can( 'manage_options' ) ) {129 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'default-post-author' ) );130 }131 132 $nonce = isset( $_POST['dpap_save_settings_nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['dpap_save_settings_nonce'] ) ) : '';133 134 if ( ! wp_verify_nonce( $nonce, 'dpap_save_settings_action' ) ) {135 wp_die( esc_html__( 'Security check failed.', 'default-post-author' ) );136 }137 138 if ( isset( $_POST['default_post_author'] ) ) {139 $new_author = absint( wp_unslash( $_POST['default_post_author'] ) );140 update_option( DPAP_OPTION_NAME, $new_author );141 }142 143 wp_safe_redirect( wp_get_referer() ? wp_get_referer() : admin_url( 'options-general.php?page=default-post-author' ) );144 exit;145 }146 add_action( 'admin_post_dpap_save_settings', 'dpap_handle_save_settings' );147 148 /**149 * Handle update of existing posts to the selected default author.150 * Processes posts in batches to avoid memory/timeouts and uses wp_update_post so hooks run.151 */152 function dpap_handle_update_old_posts() {153 if ( ! current_user_can( 'manage_options' ) ) {154 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'default-post-author' ) );155 }156 157 $nonce = isset( $_POST['dpap_update_old_posts_nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['dpap_update_old_posts_nonce'] ) ) : '';158 159 if ( ! wp_verify_nonce( $nonce, 'dpap_update_old_posts_action' ) ) {160 wp_die( esc_html__( 'Security check failed.', 'default-post-author' ) );161 }162 163 $default_author_id = get_option( DPAP_OPTION_NAME, 1 );164 165 if ( isset( $_POST['default_post_author'] ) ) {166 $default_author_id = absint( wp_unslash( $_POST['default_post_author'] ) );167 update_option( DPAP_OPTION_NAME, $default_author_id );168 }169 170 $user = get_userdata( $default_author_id );171 if ( ! $user || ! array_intersect( array( 'author', 'editor', 'administrator' ), $user->roles ) ) {172 wp_die( esc_html__( 'Selected default author is invalid.', 'default-post-author' ) );173 }174 175 // Batch process posts to avoid timeout/memory issues.176 $args = array(177 'post_type' => 'post',178 'post_status' => 'any',179 'posts_per_page' => 100,180 'fields' => 'ids',181 'orderby' => 'ID',182 'order' => 'ASC',183 'paged' => 1,184 );185 186 $total_updated = 0;187 188 while ( true ) {189 $query = new WP_Query( $args );190 if ( ! $query->have_posts() ) {191 break;192 }193 194 foreach ( $query->posts as $post_id ) {195 // Skip auto-drafts.196 $post_status = get_post_status( $post_id );197 if ( 'auto-draft' === $post_status ) {198 continue;199 }200 201 // Only update if different.202 $current_author = (int) get_post_field( 'post_author', $post_id );203 if ( $current_author === $default_author_id ) {204 continue;205 }206 207 // Use wp_update_post so hooks & cache invalidation run as expected.208 $updated_post_id = wp_update_post( array(209 'ID' => $post_id,210 'post_author' => $default_author_id,211 ), true );212 213 if ( is_wp_error( $updated_post_id ) ) {214 if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {215 // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log216 error_log( sprintf( 'dpap: failed to update post %d: %s', $post_id, $updated_post_id->get_error_message() ) );217 }218 continue;219 }220 221 $total_updated++;222 }223 224 // Move to next page.225 $args['paged']++;226 227 // Avoid infinite loops - break if no more found.228 if ( 0 === count( $query->posts ) ) {229 break;230 }231 232 // Clean up.233 wp_reset_postdata();234 }235 236 /* translators: %d: number of posts updated */237 $message = sprintf( esc_html( _n( '%d post author updated.', '%d post authors updated.', $total_updated, 'default-post-author' ) ), $total_updated );238 239 // Store message as transient to display after redirect.240 set_transient( 'dpap_update_result', $message, 30 );241 242 wp_safe_redirect( wp_get_referer() ? wp_get_referer() : admin_url( 'options-general.php?page=default-post-author' ) );243 exit;244 }245 add_action( 'admin_post_dpap_update_old_posts', 'dpap_handle_update_old_posts' );246 247 /**248 * Show admin notices for the batch update result (transient-based).249 */250 function dpap_admin_notices() {251 if ( ! current_user_can( 'manage_options' ) ) {252 return;253 }254 255 $message = get_transient( 'dpap_update_result' );256 if ( $message ) {257 echo '<div class="notice notice-success is-dismissible"><p>' . esc_html( $message ) . '</p></div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped258 delete_transient( 'dpap_update_result' );259 }260 }261 add_action( 'admin_notices', 'dpap_admin_notices' );262 263 /**264 54 * Set default author for new posts during creation only. 265 * Uses wp_insert_post_data filter.266 55 * 267 56 * @param array $data Array of slashed post data. … … 270 59 */ 271 60 function dpap_force_post_author( $data, $postarr ) { 272 $default_author_id = (int) get_option( DPAP_OPTION_NAME, 1 ); 61 // Check if feature is enabled. 62 if ( ! dpap_get_option( 'enable_default_author', true ) ) { 63 return $data; 64 } 273 65 274 if ( empty( $postarr['ID'] ) ) { 66 $default_author_id = (int) dpap_get_option( 'default_author', 1 ); 67 68 // Only for new posts (not updates). 69 if ( empty( $postarr['ID'] ) && 'post' === $data['post_type'] ) { 275 70 $data['post_author'] = $default_author_id; 276 71 } … … 282 77 /** 283 78 * Ensure revision author matches original post author. 284 * Hook into wp_save_post_revision which provides revision ID and original post.285 * Use wp_update_post to avoid direct DB queries.286 79 * 287 80 * @param int $revision_id Revision post ID. 288 * @param WP_Post $post The original post object. 81 * @param WP_Post $post The original post object. 82 * @return void 289 83 */ 290 84 function dpap_set_revision_author( $revision_id, $post ) { 85 // Check if feature is enabled. 86 if ( ! dpap_get_option( 'sync_revisions', true ) ) { 87 return; 88 } 89 291 90 $revision_id = (int) $revision_id; 292 91 $post_author = (int) $post->post_author; 293 92 294 $result = wp_update_post( array( 295 'ID' => $revision_id, 296 'post_author' => $post_author, 297 ), true ); 93 $result = wp_update_post( 94 array( 95 'ID' => $revision_id, 96 'post_author' => $post_author, 97 ), 98 true 99 ); 298 100 299 101 if ( is_wp_error( $result ) ) { 300 if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {102 if ( defined( 'WP_DEBUG' ) && WP_DEBUG && defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) { 301 103 // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log 302 104 error_log( 'dpap: Failed to update revision author for post ID ' . $post->ID . ': ' . $result->get_error_message() ); … … 306 108 add_action( 'wp_save_post_revision', 'dpap_set_revision_author', 10, 2 ); 307 109 308 309 // Redirect to settings page once the plugin is activated 310 110 /** 111 * Redirect to settings page on activation. 112 * 113 * @param string $plugin Plugin basename. 114 * @return void 115 */ 311 116 function dpap_activation_redirect( $plugin ) { 312 if( $plugin == plugin_basename( __FILE__ ) ) { 117 if ( plugin_basename( __FILE__ ) === $plugin ) { 118 // Set default options on first activation. 119 if ( ! get_option( DPAP_OPTIONS ) ) { 120 update_option( 121 DPAP_OPTIONS, 122 array( 123 'default_author' => 1, 124 'enable_default_author' => true, 125 'sync_revisions' => true, 126 ) 127 ); 128 } 313 129 wp_safe_redirect( admin_url( 'options-general.php?page=default-post-author' ) ); 314 exit;130 exit; 315 131 } 316 132 } 317 133 add_action( 'activated_plugin', 'dpap_activation_redirect' ); 318 134 319 320 135 /** 321 * Uninstall cleanup: remove option when plugin is uninstalled. 136 * Uninstall cleanup. 137 * 138 * @return void 322 139 */ 323 140 function dpap_uninstall() { 324 delete_option( DPAP_OPTION _NAME);141 delete_option( DPAP_OPTIONS ); 325 142 } 326 143 register_uninstall_hook( __FILE__, 'dpap_uninstall' ); 327 328 /* End of file */329 -
default-post-author/trunk/readme.txt
r3343426 r3410439 1 1 === Default Post Author === 2 2 Contributors: wpdelower, monarchwp23 3 Tags: post author, default post author, wp post, posts 3 Tags: post author, default post author, wp post, posts, author management 4 4 Requires at least: 6.1 5 Tested up to: 6. 85 Tested up to: 6.9 6 6 Requires PHP: 8.0 7 Stable tag: 2. 17 Stable tag: 2.2 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 Donate Link: https://www.monarchwp.com/donate 11 11 12 13 The easiest way to set a default post author in your WordPress Site. 12 The easiest way to set a default post author in your WordPress site. 14 13 15 14 == Description == … … 17 16 **Try Default Post Author on a demo site: Click here => [https://tastewp.com/plugins/default-post-author](https://tastewp.org/plugins/default-post-author/).** 18 17 19 The Default Post Author plugin is a powerful tool designed to simplify the process of setting a default post author on your WordPress site. With this plugin, you can easily define a default author for all new posts, ensuring consistency and saving you valuable time. 20 21 Setting up the plugin is quick and straightforward. Once installed and activated, you can navigate to the plugin settings page in your WordPress dashboard. Here, you will find a user-friendly interface that allows you to choose the default author from a list of existing users on your site. 18 The **Default Post Author** plugin is a powerful tool designed to simplify the process of setting a default post author on your WordPress site. With this plugin, you can easily define a default author for all new posts, ensuring consistency and saving you valuable time. 19 20 = ✨ Key Features = 21 22 * **Easy Setup** - Quick and straightforward configuration 23 * **Modern Admin Interface** - Beautiful, intuitive settings page with smooth animations 24 * **Toggle Controls** - Enable/disable features with modern toggle switches 25 * **Bulk Update** - Update all existing posts to the default author with one click 26 * **Revision Sync** - Keep revision authors in sync with parent posts 27 * **AJAX-Powered** - Real-time saving without page reloads 28 * **Progress Tracking** - Visual progress bar for bulk operations 29 * **Responsive Design** - Works perfectly on all devices 30 * **Lightweight** - Optimized code for maximum performance 31 32 = 🎨 Modern Admin Interface = 33 34 Version 2.2 introduces a completely redesigned admin interface featuring: 35 36 * Clean, card-based layout 37 * Smooth animations and transitions 38 * Modern toggle switches instead of checkboxes 39 * Interactive buttons with loading states 40 * Toast notifications for instant feedback 41 * Progress indicators for bulk operations 42 * Fully responsive design 43 44 = 🚀 How It Works = 45 46 1. Install and activate the plugin 47 2. Navigate to **Settings > Default Post Author** 48 3. Select your preferred default author from the dropdown 49 4. Enable/disable features using the toggle switches 50 5. Save your settings - that's it! 22 51 23 52 By selecting a default author, you ensure that every new post created on your site will automatically be attributed to that specific author. This feature is particularly useful for multi-author blogs or websites where different users contribute content regularly. 24 53 25 The Default Post Author plugin also offers additional customization options to enhance your workflow. For instance, you can choose to override the default author setting on a per-post basis, giving you the flexibility to assign different authors to specific posts if needed. 26 27 Furthermore, the plugin provides seamless integration with other popular plugins and themes, ensuring compatibility and a smooth user experience. It is also regularly updated to ensure optimal performance and compatibility with the latest versions of WordPress. 28 29 In summary, the Default Post Author plugin is a must-have tool for WordPress site owners who want to streamline their content creation process. By setting a default post author, you can ensure consistency and save time in managing authorship for your posts. Install this plugin today and enjoy the benefits of effortless default author assignment in your WordPress site. 54 = 🔧 Feature Toggles = 55 56 * **Enable Default Author** - Turn the default author feature on/off without deactivating the plugin 57 * **Sync Revision Authors** - Keep revision authors matching the parent post author 58 59 = 📦 Bulk Update Existing Posts = 60 61 Need to change the author of all existing posts? The plugin includes a powerful bulk update feature that: 62 63 * Processes posts in batches to prevent timeouts 64 * Shows real-time progress 65 * Provides detailed completion messages 66 * Works with any number of posts 67 68 = 🔒 Security = 69 70 * Proper WordPress nonces for all operations 71 * Capability checks for admin functions 72 * Sanitized inputs and escaped outputs 73 * Follows WordPress coding standards 74 75 = 🌐 Compatibility = 76 77 * WordPress 6.1 and higher 78 * PHP 8.0 and higher 79 * Compatible with multisite installations 80 * Works with popular themes and plugins 30 81 31 82 = Contributing & Bug Report = … … 35 86 36 87 = From within WordPress = 37 1. Visit 'Plugins > Add New'38 2. Search for 'Default Post Author'39 3. Activate Default Post Author from your Plugins page.40 4. Go to Settings > Default Post Author41 5. At the bottom of that page you will see a dropdown with all your users list42 4. That's all. 88 1. Visit **Plugins > Add New** 89 2. Search for **'Default Post Author'** 90 3. Click **Install Now** and then **Activate** 91 4. Go to **Settings > Default Post Author** 92 5. Select your default author and configure the toggle options 93 6. Click **Save Settings** - that's all! 43 94 44 95 = Manual Installation = 45 1. Upload the `default-post-author` folder to the `/wp-content/plugins/` directory 46 2. Activate the Default Post Author plugin through the 'Plugins' menu in WordPress 47 3. That's all. 48 96 1. Download the plugin zip file 97 2. Upload the `default-post-author` folder to the `/wp-content/plugins/` directory 98 3. Activate the **Default Post Author** plugin through the **Plugins** menu in WordPress 99 4. Navigate to **Settings > Default Post Author** to configure 100 101 = After Activation = 102 The plugin will automatically redirect you to the settings page after activation, making it easy to get started right away. 49 103 50 104 == Frequently Asked Questions == … … 52 106 = Where is the settings page? = 53 107 54 Settings > General 108 Navigate to **Settings > Default Post Author** in your WordPress admin dashboard. 55 109 56 110 = Is it compatible with multisite? = 57 111 58 Yes! It's compatible with both single sites and multisite. 59 60 = How frequently is the “Default post author” plugin updated? = 112 Yes! The plugin is fully compatible with both single sites and WordPress multisite installations. 113 114 = Can I disable the default author feature temporarily? = 115 116 Yes! Version 2.2 includes a toggle switch to enable/disable the default author feature without deactivating the plugin. 117 118 = How does the bulk update feature work? = 119 120 The bulk update feature processes posts in batches of 100 to prevent server timeouts. It shows a progress bar and notifies you when complete. Only posts with different authors are updated. 121 122 = Will this affect my existing posts? = 123 124 No, by default the plugin only affects new posts. To update existing posts, you must explicitly use the **Update All Posts** feature on the settings page. 125 126 = What happens to post revisions? = 127 128 If the **Sync Revision Authors** toggle is enabled, revision authors will automatically match their parent post's author. 129 130 = How frequently is the plugin updated? = 61 131 62 132 The plugin is actively maintained and updated regularly to ensure compatibility with the latest versions of WordPress and to address any potential issues. 63 133 64 = Is there any customer support available? = 65 66 Yes, in case you encounter any difficulties or have questions, the plugin’s support team is available to assist you and provide prompt and helpful responses. 67 134 = Is there customer support available? = 135 136 Yes! If you encounter any difficulties or have questions, please visit the [support forum](https://wordpress.org/support/plugin/default-post-author/) or contact us through our website. 137 138 = Can I contribute to the plugin? = 139 140 Absolutely! We welcome contributions on our [GitHub repository](https://github.com/WordPress-Satkhira-Community/default-post-author). 68 141 69 142 == Screenshots == 70 143 71 1. A general settings page where you can set the default post author option. 144 1. Modern settings page with card-based layout and gradient header 145 2. Default author selection with styled dropdown 146 3. Feature toggles with modern switch controls 147 4. Bulk update section with progress indicator 148 5. Success notification toast message 149 6. Mobile responsive design 72 150 73 151 == Upgrade Notice == 74 152 153 = 2.2 = 154 Major UI update! New modern admin interface with toggle switches, AJAX saving, progress indicators, and improved user experience. Recommended for all users. 155 156 = 2.1 = 157 Bug fixes and stability improvements. 158 159 = 2.0 = 160 Security and performance updates. New bulk update feature to change all existing posts to the default author. 161 162 == Changelog == 163 164 = 2.2 - (Decemeber 04, 2025) = 165 * **New:** Completely redesigned modern admin interface 166 * **New:** Toggle switches replace checkboxes for better UX 167 * **New:** AJAX-powered settings saving (no page reload) 168 * **New:** Toast notifications for instant feedback 169 * **New:** Progress bar for bulk update operations 170 * **New:** Enable/disable default author feature toggle 171 * **New:** Sync revision authors toggle option 172 * **New:** Animated UI elements and smooth transitions 173 * **New:** Card-based settings layout 174 * **New:** Responsive design improvements 175 * **Improved:** Separated code structure (PHP, CSS, JS) 176 * **Improved:** Better code organization with admin class 177 * **Improved:** Enhanced security measures 178 * **Improved:** Optimized asset loading 179 * **Improved:** Better error handling 180 75 181 = 2.1 - (August 12, 2025) = 76 -Bug Fix182 * Bug Fix 77 183 78 184 = 2.0 - (August 12, 2025) = 79 -Security Update80 -Performance Update81 -Ability to Update All Existing Posts to Default Author185 * Security Update 186 * Performance Update 187 * New: Ability to Update All Existing Posts to Default Author 82 188 83 189 = 1.1.5 - (January 28, 2025) = 84 -Security Update85 -Performance Update86 -TasteWP Live Demo Added190 * Security Update 191 * Performance Update 192 * TasteWP Live Demo Added 87 193 88 194 = 1.1.4 - (November 17, 2024) = 89 -Security Update90 -Performance Update91 -WordPress 6.7 compatibility195 * Security Update 196 * Performance Update 197 * WordPress 6.7 compatibility 92 198 93 199 = 1.1.3 - (July 17, 2024) = 94 -Security Update95 -Performance Update96 -WordPress 6.6 compatibility200 * Security Update 201 * Performance Update 202 * WordPress 6.6 compatibility 97 203 98 204 = 1.1.2 - (April 15, 2024) = 99 -Security Update205 * Security Update 100 206 101 207 = 1.1.1 - (April 15, 2024) = 102 -Bug Fix103 -Performance Update104 -Security Update105 106 = 1.1 - 23-03-2024=107 -Performance Update108 109 = 1.0.2 - 17-02-2024=110 -Performance Update111 112 = 1.0.1 - 17-02-2024=113 -Simple Bug Fix208 * Bug Fix 209 * Performance Update 210 * Security Update 211 212 = 1.1 - (March 23, 2024) = 213 * Performance Update 214 215 = 1.0.2 - (February 17, 2024) = 216 * Performance Update 217 218 = 1.0.1 - (February 17, 2024) = 219 * Simple Bug Fix 114 220 115 221 = 1.0 = 116 222 * Initial release 117 118 == Changelog ==119 120 = 2.1 - (August 12, 2025) =121 - Bug Fix122 123 = 2.0 - (August 12, 2025) =124 - Security Update125 - Performance Update126 - Ability to Update All Existing Posts to Default Author127 128 = 1.1.5 - (January 28, 2025) =129 - Security Update130 - Performance Update131 - TasteWP Live Demo Added132 133 = 1.1.4 - (November 17, 2024) =134 - Security Update135 - Performance Update136 - WordPress 6.7 compatibility137 138 = 1.1.3 - (July 17, 2024) =139 - Security Update140 - Performance Update141 - WordPress 6.6 compatibility142 143 = 1.1.2 - (April 15, 2024) =144 - Security Update145 146 = 1.1.1 - (April 15, 2024) =147 - Bug Fix148 - Performance Update149 - Security Update150 151 = 1.1 - 23-03-2024 =152 - Performance Update153 154 = 1.0.2 - 17-02-2024 =155 - Performance Update156 157 = 1.0.1 - 17-02-2024 =158 - Simple Bug Fix159 160 = 1.0 =161 * Initial release
Note: See TracChangeset
for help on using the changeset viewer.