refactor: rename unregister_post_type function

Renamed unregister_post_type to process_unregister_post_type
to enhance readability and clarity regarding its purpose. This
change ensures that the function's name better reflects its
role in handling the unregistration process of the post type
based on customizer settings.

No change in functionality was introduced. Resolves ambiguity
for future maintenance.
This commit is contained in:
Kumi 2024-08-03 19:46:24 +02:00
parent acdff85d5a
commit 1c631f5a47
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -1052,7 +1052,7 @@ function customize_register($wp_customize) {
add_action('customize_register', 'customize_register');
function unregister_post_type() {
function process_unregister_post_type() {
// Get the customizer setting
$disable_posts = get_theme_mod('disable_posts', false);
@ -1062,7 +1062,7 @@ function unregister_post_type() {
}
}
add_action('init', 'unregister_post_type', 20);
add_action('init', 'process_unregister_post_type', 20);
function remove_post_menu_item() {
$disable_posts = get_theme_mod('disable_posts', false);