Changeset 284142
- Timestamp:
- 08/15/2025 07:43:19 PM (7 months ago)
- Location:
- extendable/2.0.28
- Files:
-
- 3 edited
- 1 copied
-
. (copied) (copied from extendable/2.0.27)
-
functions.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
style.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
extendable/2.0.28/functions.php
r278051 r284142 261 261 262 262 /** 263 * Force the block editor to use page-with-title 264 * as the default template for new Pages. 263 * Set default template for new pages in the block editor (auto-drafts) 265 264 * 266 265 * @since Extendable 2.0.26 267 266 * @return void 268 267 */ 269 function extendable_set_default_template_for_ new_pages( WP_REST_Response $response, WP_Post $post ) {270 268 function extendable_set_default_template_for_auto_drafts( WP_REST_Response $response, WP_Post $post ) { 269 271 270 if ( 'page' !== $post->post_type ) { 272 271 return $response; … … 287 286 return $response; 288 287 } 289 add_filter( 'rest_prepare_page', 'extendable_set_default_template_for_new_pages', 10, 2 ); 288 add_filter( 'rest_prepare_page', 'extendable_set_default_template_for_auto_drafts', 10, 2 ); 289 290 /** 291 * Set default template for new pages when saved/published 292 * 293 * @since Extendable 2.0.28 294 * @param int $post_id Post ID. 295 * @param WP_Post $post Post object. 296 * @param bool $update Whether this is an existing post being updated. 297 * @return void 298 */ 299 function extendable_set_default_template_for_new_pages( $post_id, $post, $update ) { 300 301 if ( 'page' !== $post->post_type ) { 302 return; 303 } 304 305 if ( $update ) { 306 return; 307 } 308 309 if ( 'revision' === $post->post_status ) { 310 return; 311 } 312 313 $current_template = get_page_template_slug( $post_id ); 314 315 // If no template is set or it's the default template, set our default 316 if ( empty( $current_template ) || 'page' === $current_template ) { 317 update_post_meta( $post_id, '_wp_page_template', 'page-with-title' ); 318 } 319 } 320 add_action( 'wp_insert_post', 'extendable_set_default_template_for_new_pages', 10, 3 ); -
extendable/2.0.28/readme.txt
r282557 r284142 4 4 Tested up to: 6.8 5 5 Requires PHP: 7.4 6 Stable tag: 2.0.2 76 Stable tag: 2.0.28 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 13 13 14 14 == Changelog == 15 16 = 2.0.28 - 2025-08-16 = 17 - Fix: Default page template now properly persists when publishing pages 15 18 16 19 = 2.0.27 - 2025-08-06 = -
extendable/2.0.28/style.css
r282557 r284142 8 8 Tested up to: 6.8 9 9 Requires PHP: 7.4 10 Version: 2.0.2 710 Version: 2.0.28 11 11 License: GNU General Public License v2 or later 12 12 License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.