Legacy support for removed icon menu partial

This commit is contained in:
Tetrakern 2024-10-17 22:10:20 +02:00
parent a68664158a
commit 7a7ea992d3
2 changed files with 20 additions and 0 deletions

View File

@ -286,6 +286,7 @@ Fictioneer customizes WordPress by using as many standard action and filter hook
| `edit_user_profile` | `fictioneer_custom_profile_fields` (20) | `edit_user_profile` | `fictioneer_custom_profile_fields` (20)
| `edit_user_profile_update` | `fictioneer_update_admin_user_profile` (10), `fictioneer_update_my_user_profile` (10), `fictioneer_update_admin_unlocked_posts` (10) | `edit_user_profile_update` | `fictioneer_update_admin_user_profile` (10), `fictioneer_update_my_user_profile` (10), `fictioneer_update_admin_unlocked_posts` (10)
| `get_header` | `fictioneer_maintenance_mode` (10) | `get_header` | `fictioneer_maintenance_mode` (10)
| `get_template_part` | `fictioneer_legacy_icon_menu_partial` (10)
| `init` | `fictioneer_add_character_taxonomy` (0), `fictioneer_add_content_warning_taxonomy` (0), `fictioneer_add_fandom_taxonomy` (0), `fictioneer_add_genre_taxonomy` (0), `fictioneer_add_logout_endpoint`, `fictioneer_fcn_chapter_post_type` (0), `fictioneer_fcn_collection_post_type` (0), `fictioneer_fcn_recommendation_post_type` (0), `fictioneer_fcn_story_post_type` (0), `fictioneer_add_epub_download_endpoint` (10), `fictioneer_add_oauth2_endpoint` (10), `fictioneer_restrict_admin_panel` (10), `fictioneer_disable_heartbeat` (1), `fictioneer_modify_allowed_tags` (20), `fictioneer_story_rss` (10), `fictioneer_remove_custom_fields_supports` (10), `fictioneer_add_sitemap_rewrite_rule` (10), `fictioneer_fast_ajax` (99999), `fictioneer_add_chapter_rewrite_tags` (10), `fictioneer_add_chapter_rewrite_rules` (10), `fictioneer_rewrite_chapter_permalink` (10), `fictioneer_disable_emojis` (10), `fictioneer_disable_page_optimize_plugin` (10) | `init` | `fictioneer_add_character_taxonomy` (0), `fictioneer_add_content_warning_taxonomy` (0), `fictioneer_add_fandom_taxonomy` (0), `fictioneer_add_genre_taxonomy` (0), `fictioneer_add_logout_endpoint`, `fictioneer_fcn_chapter_post_type` (0), `fictioneer_fcn_collection_post_type` (0), `fictioneer_fcn_recommendation_post_type` (0), `fictioneer_fcn_story_post_type` (0), `fictioneer_add_epub_download_endpoint` (10), `fictioneer_add_oauth2_endpoint` (10), `fictioneer_restrict_admin_panel` (10), `fictioneer_disable_heartbeat` (1), `fictioneer_modify_allowed_tags` (20), `fictioneer_story_rss` (10), `fictioneer_remove_custom_fields_supports` (10), `fictioneer_add_sitemap_rewrite_rule` (10), `fictioneer_fast_ajax` (99999), `fictioneer_add_chapter_rewrite_tags` (10), `fictioneer_add_chapter_rewrite_rules` (10), `fictioneer_rewrite_chapter_permalink` (10), `fictioneer_disable_emojis` (10), `fictioneer_disable_page_optimize_plugin` (10)
| `login_form` | `fictioneer_after_logout_cleanup` (10) | `login_form` | `fictioneer_after_logout_cleanup` (10)
| `login_head` | `fictioneer_wp_login_scripts` (10) | `login_head` | `fictioneer_wp_login_scripts` (10)

View File

@ -2445,6 +2445,25 @@ function fictioneer_render_icon_menu( $args ) {
echo '<div class="icon-menu _' . $location . '" data-nosnippet>' . implode( '', $output ) . '</div>'; echo '<div class="icon-menu _' . $location . '" data-nosnippet>' . implode( '', $output ) . '</div>';
} }
/**
* Legacy support for icon menu partial (used in some child themes)
*
* @since 5.25.0
* @link https://developer.wordpress.org/reference/functions/get_template_part/
*
* @param string $slug The slug name for the generic template.
* @param string $name The name of the specialized template or an empty string if there is none.
* @param string[] $templates Array of template files to search for, in order.
* @param array $args Additional arguments passed to the template.
*/
function fictioneer_legacy_icon_menu_partial( $slug, $name, $templates, $args ) {
if ( $slug === 'partials/_icon-menu' ) {
fictioneer_render_icon_menu( $args );
}
}
add_action( 'get_template_part', 'fictioneer_legacy_icon_menu_partial', 10, 4 );
// ============================================================================= // =============================================================================
// SPLIDE // SPLIDE
// ============================================================================= // =============================================================================