Linux yavrix.internet-webhosting.com 3.10.0-962.3.2.lve1.5.88.el7.x86_64 #1 SMP Fri Sep 26 14:06:42 UTC 2025 x86_64
LiteSpeed
Server IP : 103.8.25.136 & Your IP : 216.73.216.189
Domains :
Cant Read [ /etc/named.conf ]
User : klinikpe
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
klinikpe /
public_html /
wp-includes /
Delete
Unzip
Name
Size
Permission
Date
Action
IXR
[ DIR ]
drwxr-xr-x
2026-08-07 01:42
JPM
[ DIR ]
drwxr-xr-x
2026-08-06 02:24
PHPMailer
[ DIR ]
drwxr-xr-x
2026-08-05 02:49
RH
[ DIR ]
drwxr-xr-x
2026-08-06 02:24
Requests
[ DIR ]
drwxr-xr-x
2026-08-07 01:42
SimplePie
[ DIR ]
drwxr-xr-x
2026-08-05 02:49
VTJn
[ DIR ]
drwxr-xr-x
2026-08-06 02:24
block-bindings
[ DIR ]
drwxr-xr-x
2026-08-08 02:28
block-patterns
[ DIR ]
drwxr-xr-x
2026-08-06 02:24
block-supports
[ DIR ]
drwxr-xr-x
2026-08-06 02:24
blocks
[ DIR ]
drwxr-xr-x
2026-08-08 02:29
certificates
[ DIR ]
drwxr-xr-x
2026-08-08 02:30
customize
[ DIR ]
drwxr-xr-x
2026-08-06 02:24
fonts
[ DIR ]
drwxr-xr-x
2026-08-07 01:42
html-api
[ DIR ]
drwxr-xr-x
2026-08-05 02:49
images
[ DIR ]
drwxr-xr-x
2026-08-05 02:49
interactivity-api
[ DIR ]
drwxr-xr-x
2026-08-05 02:49
js
[ DIR ]
drwxr-xr-x
2026-08-08 02:29
l10n
[ DIR ]
drwxr-xr-x
2026-08-07 01:42
php-compat
[ DIR ]
drwxr-xr-x
2026-08-05 02:49
pomo
[ DIR ]
drwxr-xr-x
2026-08-08 02:31
rest-api
[ DIR ]
drwxr-xr-x
2026-08-07 01:42
sitemaps
[ DIR ]
drwxr-xr-x
2026-08-05 02:49
sodium_compat
[ DIR ]
drwxr-xr-x
2026-08-08 02:30
style-engine
[ DIR ]
drwxr-xr-x
2026-08-05 02:49
theme-compat
[ DIR ]
drwxr-xr-x
2026-08-05 02:49
widgets
[ DIR ]
drwxr-xr-x
2026-08-05 02:49
.htaccess
517
B
-r-xr-xr-x
2026-08-07 01:42
admin-bar.php
36.23
KB
-rw-r--r--
2023-11-19 18:32
ajhasw.php
19.61
KB
-rw-r--r--
2026-08-07 01:42
atomlib.php
11.79
KB
-rw-r--r--
2023-11-19 18:32
author-template.php
18.51
KB
-rw-r--r--
2023-11-19 18:32
bdujdu.php
19.61
KB
-rw-r--r--
2026-08-06 02:24
block-bindings.php
5.46
KB
-rw-r--r--
2023-11-19 18:32
block-i18n.json
316
B
-rw-r--r--
2023-11-19 18:32
block-patterns.php
12.81
KB
-rw-r--r--
2023-11-19 18:32
block-template-utils.php
58.74
KB
-rw-r--r--
2023-11-19 18:32
block-template.php
13.81
KB
-rw-r--r--
2023-11-19 18:32
blocks.php
102.43
KB
-rw-r--r--
2023-11-19 18:32
bookmark-template.php
12.64
KB
-rw-r--r--
2023-11-19 18:32
bookmark.php
15.07
KB
-rw-r--r--
2023-11-19 18:32
cache.php
13.16
KB
-rw-r--r--
2023-11-19 18:32
canonical.php
33.71
KB
-rw-r--r--
2023-11-19 18:32
capabilities.php
41.72
KB
-rw-r--r--
2023-11-19 18:32
class-IXR.php
2.48
KB
-rw-r--r--
2023-11-19 18:32
class-avif-info.php
28.92
KB
-rw-r--r--
2023-11-19 18:32
class-feed.php
539
B
-rw-r--r--
2023-11-19 18:32
class-http.php
367
B
-rw-r--r--
2023-11-19 18:32
class-json.php
42.66
KB
-rw-r--r--
2023-11-19 18:32
class-oembed.php
401
B
-rw-r--r--
2023-11-19 18:32
class-phpass.php
6.61
KB
-rw-r--r--
2023-11-19 18:32
class-phpmailer.php
664
B
-rw-r--r--
2023-11-19 18:32
class-requests.php
2.18
KB
-rw-r--r--
2023-11-19 18:32
class-simplepie.php
453
B
-rw-r--r--
2023-11-19 18:32
class-walker-category.php
8.28
KB
-rw-r--r--
2023-11-19 18:32
class-walker-comment.php
13.89
KB
-rw-r--r--
2023-11-19 18:32
class-walker-nav-menu.php
11.51
KB
-rw-r--r--
2023-11-19 18:32
class-walker-page.php
7.43
KB
-rw-r--r--
2023-11-19 18:32
class-wp-admin-bar.php
17.46
KB
-rw-r--r--
2023-11-19 18:32
class-wp-ajax-response.php
5.14
KB
-rw-r--r--
2023-11-19 18:32
class-wp-application-passwords.php
15.25
KB
-rw-r--r--
2023-11-19 18:32
class-wp-block-bindings-registry.php
8.26
KB
-rw-r--r--
2023-11-19 18:32
class-wp-block-editor-context.php
1.32
KB
-rw-r--r--
2023-11-19 18:32
class-wp-block-metadata-registry.php
9.99
KB
-rw-r--r--
2023-11-19 18:32
class-wp-block-parser-block.php
2.5
KB
-rw-r--r--
2023-11-19 18:32
class-wp-block-parser-frame.php
1.97
KB
-rw-r--r--
2023-11-19 18:32
class-wp-block-parser.php
11.26
KB
-rw-r--r--
2023-11-19 18:32
class-wp-block-pattern-categories-registry.php
5.25
KB
-rw-r--r--
2023-11-19 18:32
class-wp-block-patterns-registry.php
10.92
KB
-rw-r--r--
2023-11-19 18:32
class-wp-block-styles-registry.php
6.12
KB
-rw-r--r--
2023-11-19 18:32
class-wp-block-supports.php
5.48
KB
-rw-r--r--
2023-11-19 18:32
class-wp-block-template.php
1.99
KB
-rw-r--r--
2023-11-19 18:32
class-wp-block-templates-registry.php
7.06
KB
-rw-r--r--
2023-11-19 18:32
class-wp-block-type-registry.php
4.9
KB
-rw-r--r--
2023-11-19 18:32
class-wp-block-type.php
16.86
KB
-rw-r--r--
2023-11-19 18:32
class-wp-block.php
19.96
KB
-rw-r--r--
2023-11-19 18:32
class-wp-classic-to-block-menu-converter.php
3.99
KB
-rw-r--r--
2023-11-19 18:32
class-wp-comment-query.php
47.26
KB
-rw-r--r--
2023-11-19 18:32
class-wp-comment.php
9.15
KB
-rw-r--r--
2023-11-19 18:32
class-wp-customize-control.php
25.13
KB
-rw-r--r--
2023-11-19 18:32
class-wp-customize-manager.php
197.79
KB
-rw-r--r--
2023-11-19 18:32
class-wp-customize-section.php
10.95
KB
-rw-r--r--
2023-11-19 18:32
class-wp-customize-widgets.php
70.47
KB
-rw-r--r--
2023-11-19 18:32
class-wp-date-query.php
34.89
KB
-rw-r--r--
2023-11-19 18:32
class-wp-dependencies.php
14.78
KB
-rw-r--r--
2023-11-19 18:32
class-wp-duotone.php
39.83
KB
-rw-r--r--
2023-11-19 18:32
class-wp-editor.php
70.64
KB
-rw-r--r--
2023-11-19 18:32
class-wp-error.php
7.33
KB
-rw-r--r--
2023-11-19 18:32
class-wp-exception.php
253
B
-rw-r--r--
2023-11-19 18:32
class-wp-feed-cache-transient.php
3.1
KB
-rw-r--r--
2023-11-19 18:32
class-wp-hook.php
15.63
KB
-rw-r--r--
2023-11-19 18:32
class-wp-http-cookie.php
7.22
KB
-rw-r--r--
2023-11-19 18:32
class-wp-http-curl.php
12.25
KB
-rw-r--r--
2023-11-19 18:32
class-wp-http-encoding.php
6.53
KB
-rw-r--r--
2023-11-19 18:32
class-wp-http-ixr-client.php
3.42
KB
-rw-r--r--
2023-11-19 18:32
class-wp-http-requests-response.php
4.3
KB
-rw-r--r--
2023-11-19 18:32
class-wp-http.php
40.53
KB
-rw-r--r--
2023-11-19 18:32
class-wp-image-editor-gd.php
19.42
KB
-rw-r--r--
2023-11-19 18:32
class-wp-image-editor-imagick.php
31.9
KB
-rw-r--r--
2023-11-19 18:32
class-wp-locale-switcher.php
6.47
KB
-rw-r--r--
2023-11-19 18:32
class-wp-locale.php
15.73
KB
-rw-r--r--
2023-11-19 18:32
class-wp-meta-query.php
29.82
KB
-rw-r--r--
2023-11-19 18:32
class-wp-navigation-fallback.php
9
KB
-rw-r--r--
2023-11-19 18:32
class-wp-network-query.php
19.39
KB
-rw-r--r--
2023-11-19 18:32
class-wp-network.php
12.01
KB
-rw-r--r--
2023-11-19 18:32
class-wp-oembed.php
30.74
KB
-rw-r--r--
2023-11-19 18:32
class-wp-post-type.php
29.63
KB
-rw-r--r--
2023-11-19 18:32
class-wp-query.php
150.47
KB
-rw-r--r--
2023-11-19 18:32
class-wp-recovery-mode-cookie-service.php
6.72
KB
-rw-r--r--
2023-11-19 18:32
class-wp-recovery-mode-link-service.php
3.38
KB
-rw-r--r--
2023-11-19 18:32
class-wp-rewrite.php
62.2
KB
-rw-r--r--
2023-11-19 18:32
class-wp-roles.php
8.38
KB
-rw-r--r--
2023-11-19 18:32
class-wp-script-modules.php
18.91
KB
-rw-r--r--
2023-11-19 18:32
class-wp-scripts.php
27.68
KB
-rw-r--r--
2023-11-19 18:32
class-wp-session-tokens.php
7.28
KB
-rw-r--r--
2023-11-19 18:32
class-wp-simplepie-file.php
3.33
KB
-rw-r--r--
2023-11-19 18:32
class-wp-simplepie-sanitize-kses.php
1.79
KB
-rw-r--r--
2023-11-19 18:32
class-wp-site-query.php
30.88
KB
-rw-r--r--
2023-11-19 18:32
class-wp-styles.php
10.75
KB
-rw-r--r--
2023-11-19 18:32
class-wp-tax-query.php
19.1
KB
-rw-r--r--
2023-11-19 18:32
class-wp-taxonomy.php
18.13
KB
-rw-r--r--
2023-11-19 18:32
class-wp-term-query.php
39.91
KB
-rw-r--r--
2023-11-19 18:32
class-wp-term.php
5.17
KB
-rw-r--r--
2023-11-19 18:32
class-wp-text-diff-renderer-inline.php
979
B
-rw-r--r--
2023-11-19 18:32
class-wp-textdomain-registry.php
10.24
KB
-rw-r--r--
2023-11-19 18:32
class-wp-theme-json-data.php
1.77
KB
-rw-r--r--
2023-11-19 18:32
class-wp-theme-json-resolver.php
34.97
KB
-rw-r--r--
2023-11-19 18:32
class-wp-theme-json-schema.php
7.19
KB
-rw-r--r--
2023-11-19 18:32
class-wp-user-query.php
42.63
KB
-rw-r--r--
2023-11-19 18:32
class-wp-user.php
22.29
KB
-rw-r--r--
2023-11-19 18:32
class-wp-walker.php
13.01
KB
-rw-r--r--
2023-11-19 18:32
class-wp-widget-factory.php
3.27
KB
-rw-r--r--
2023-11-19 18:32
class-wp-widget.php
17.99
KB
-rw-r--r--
2023-11-19 18:32
class-wp.php
25.51
KB
-rw-r--r--
2023-11-19 18:32
class-wpdb.php
115.61
KB
-rw-r--r--
2023-11-19 18:32
class.wp-dependencies.php
373
B
-rw-r--r--
2023-11-19 18:32
class.wp-scripts.php
343
B
-rw-r--r--
2023-11-19 18:32
class.wp-styles.php
338
B
-rw-r--r--
2023-11-19 18:32
comment-template.php
100.36
KB
-rw-r--r--
2023-11-19 18:32
comment.php
127.22
KB
-rw-r--r--
2023-11-19 18:32
compat.php
16.58
KB
-rw-r--r--
2023-11-19 18:32
date.php
400
B
-rw-r--r--
2023-11-19 18:32
default-constants.php
11.1
KB
-rw-r--r--
2023-11-19 18:32
default-filters.php
34.85
KB
-rw-r--r--
2023-11-19 18:32
deprecated.php
185.67
KB
-rw-r--r--
2023-11-19 18:32
embed-template.php
338
B
-rw-r--r--
2023-11-19 18:32
embed.php
37.02
KB
-rw-r--r--
2023-11-19 18:32
feed-atom-comments.php
5.38
KB
-rw-r--r--
2023-11-19 18:32
feed-atom.php
2.98
KB
-rw-r--r--
2023-11-19 18:32
feed-rss.php
1.16
KB
-rw-r--r--
2023-11-19 18:32
feed-rss2-comments.php
4.04
KB
-rw-r--r--
2023-11-19 18:32
feed-rss2.php
3.71
KB
-rw-r--r--
2023-11-19 18:32
feed.php
22.86
KB
-rw-r--r--
2023-11-19 18:32
fonts.php
9.52
KB
-rw-r--r--
2023-11-19 18:32
formatting.php
327.37
KB
-rw-r--r--
2023-11-19 18:32
functions.php
276.53
KB
-rw-r--r--
2023-11-19 18:32
functions.wp-scripts.php
14.22
KB
-rw-r--r--
2023-11-19 18:32
functions.wp-styles.php
8.38
KB
-rw-r--r--
2023-11-19 18:32
http.php
24.72
KB
-rw-r--r--
2023-11-19 18:32
https-detection.php
5.53
KB
-rw-r--r--
2023-11-19 18:32
https-migration.php
4.63
KB
-rw-r--r--
2023-11-19 18:32
kses.php
72.67
KB
-rw-r--r--
2023-11-19 18:32
l10n.php
66.81
KB
-rw-r--r--
2023-11-19 18:32
link-template.php
154.01
KB
-rw-r--r--
2023-11-19 18:32
load.php
69.41
KB
-rw-r--r--
2026-04-06 05:08
locale.php
162
B
-rw-r--r--
2023-11-19 18:32
media-template.php
61.57
KB
-rw-r--r--
2023-11-19 18:32
media.php
213.36
KB
-rw-r--r--
2023-11-19 18:32
meta.php
62.9
KB
-rw-r--r--
2023-11-19 18:32
ms-default-filters.php
6.48
KB
-rw-r--r--
2023-11-19 18:32
ms-deprecated.php
21.25
KB
-rw-r--r--
2023-11-19 18:32
ms-files.php
2.65
KB
-rw-r--r--
2023-11-19 18:32
ms-functions.php
89.11
KB
-rw-r--r--
2023-11-19 18:32
ms-load.php
19.42
KB
-rw-r--r--
2023-11-19 18:32
ms-network.php
3.69
KB
-rw-r--r--
2023-11-19 18:32
ms-settings.php
4.03
KB
-rw-r--r--
2023-11-19 18:32
ms-site.php
39.54
KB
-rw-r--r--
2023-11-19 18:32
nav-menu.php
43.31
KB
-rw-r--r--
2023-11-19 18:32
option.php
99.37
KB
-rw-r--r--
2023-11-19 18:32
pluggable-deprecated.php
6.12
KB
-rw-r--r--
2023-11-19 18:32
pluggable.php
113.25
KB
-rw-r--r--
2023-11-19 18:32
plugin.php
47.72
KB
-rw-r--r--
2026-03-21 11:55
post-formats.php
6.94
KB
-rw-r--r--
2023-11-19 18:32
post-template.php
65.31
KB
-rw-r--r--
2023-11-19 18:32
query.php
36.17
KB
-rw-r--r--
2023-11-19 18:32
registration-functions.php
200
B
-rw-r--r--
2023-11-19 18:32
registration.php
200
B
-rw-r--r--
2023-11-19 18:32
rest-api.php
97.26
KB
-rw-r--r--
2023-11-19 18:32
revision.php
30.17
KB
-rw-r--r--
2023-11-19 18:32
revisson.php
17.25
KB
-rw-r--r--
2026-05-02 00:49
rewrite.php
19.08
KB
-rw-r--r--
2023-11-19 18:32
robots-template.php
5.06
KB
-rw-r--r--
2023-11-19 18:32
rss-functions.php
255
B
-rw-r--r--
2023-11-19 18:32
rss.php
22.57
KB
-rw-r--r--
2023-11-19 18:32
script-loader.php
127.67
KB
-rw-r--r--
2023-11-19 18:32
script-modules.php
7.53
KB
-rw-r--r--
2023-11-19 18:32
session.php
258
B
-rw-r--r--
2023-11-19 18:32
shortcodes.php
23.49
KB
-rw-r--r--
2023-11-19 18:32
sitemaps.php
3.16
KB
-rw-r--r--
2023-11-19 18:32
style-engine.php
7.39
KB
-rw-r--r--
2023-11-19 18:32
template-loader.php
3.27
KB
-rw-r--r--
2023-11-19 18:32
template.php
23.59
KB
-rw-r--r--
2023-11-19 18:32
theme-i18n.json
1.26
KB
-rw-r--r--
2023-11-19 18:32
theme-previews.php
2.77
KB
-rw-r--r--
2023-11-19 18:32
theme.php
130.84
KB
-rw-r--r--
2023-11-19 18:32
update.php
35.93
KB
-rw-r--r--
2023-11-19 18:32
user.php
170.32
KB
-rw-r--r--
2023-11-19 18:32
vars.php
6.34
KB
-rw-r--r--
2023-11-19 18:32
version.php
931
B
-rw-r--r--
2023-11-19 18:32
widgets.php
69.03
KB
-rw-r--r--
2023-11-19 18:32
wp-db.php
445
B
-rw-r--r--
2023-11-19 18:32
Save
Rename
<?php /** * WP_Navigation_Fallback class * * Manages fallback behavior for Navigation menus. * * @package WordPress * @subpackage Navigation * @since 6.3.0 */ /** * Manages fallback behavior for Navigation menus. * * @access public * @since 6.3.0 */ class WP_Navigation_Fallback { /** * Updates the wp_navigation custom post type schema, in order to expose * additional fields in the embeddable links of WP_REST_Navigation_Fallback_Controller. * * The Navigation Fallback endpoint may embed the full Navigation Menu object * into the response as the `self` link. By default, the Posts Controller * will only expose a limited subset of fields but the editor requires * additional fields to be available in order to utilize the menu. * * Used with the `rest_wp_navigation_item_schema` hook. * * @since 6.4.0 * * @param array $schema The schema for the `wp_navigation` post. * @return array The modified schema. */ public static function update_wp_navigation_post_schema( $schema ) { // Expose top level fields. $schema['properties']['status']['context'] = array_merge( $schema['properties']['status']['context'], array( 'embed' ) ); $schema['properties']['content']['context'] = array_merge( $schema['properties']['content']['context'], array( 'embed' ) ); /* * Exposes sub properties of content field. * These sub properties aren't exposed by the posts controller by default, * for requests where context is `embed`. * * @see WP_REST_Posts_Controller::get_item_schema() */ $schema['properties']['content']['properties']['raw']['context'] = array_merge( $schema['properties']['content']['properties']['raw']['context'], array( 'embed' ) ); $schema['properties']['content']['properties']['rendered']['context'] = array_merge( $schema['properties']['content']['properties']['rendered']['context'], array( 'embed' ) ); $schema['properties']['content']['properties']['block_version']['context'] = array_merge( $schema['properties']['content']['properties']['block_version']['context'], array( 'embed' ) ); /* * Exposes sub properties of title field. * These sub properties aren't exposed by the posts controller by default, * for requests where context is `embed`. * * @see WP_REST_Posts_Controller::get_item_schema() */ $schema['properties']['title']['properties']['raw']['context'] = array_merge( $schema['properties']['title']['properties']['raw']['context'], array( 'embed' ) ); return $schema; } /** * Gets (and/or creates) an appropriate fallback Navigation Menu. * * @since 6.3.0 * * @return WP_Post|null the fallback Navigation Post or null. */ public static function get_fallback() { /** * Filters whether or not a fallback should be created. * * @since 6.3.0 * * @param bool $create Whether to create a fallback navigation menu. Default true. */ $should_create_fallback = apply_filters( 'wp_navigation_should_create_fallback', true ); $fallback = static::get_most_recently_published_navigation(); if ( $fallback || ! $should_create_fallback ) { return $fallback; } $fallback = static::create_classic_menu_fallback(); if ( $fallback && ! is_wp_error( $fallback ) ) { // Return the newly created fallback post object which will now be the most recently created navigation menu. return $fallback instanceof WP_Post ? $fallback : static::get_most_recently_published_navigation(); } $fallback = static::create_default_fallback(); if ( $fallback && ! is_wp_error( $fallback ) ) { // Return the newly created fallback post object which will now be the most recently created navigation menu. return $fallback instanceof WP_Post ? $fallback : static::get_most_recently_published_navigation(); } return null; } /** * Finds the most recently published `wp_navigation` post type. * * @since 6.3.0 * * @return WP_Post|null the first non-empty Navigation or null. */ private static function get_most_recently_published_navigation() { $parsed_args = array( 'post_type' => 'wp_navigation', 'no_found_rows' => true, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'order' => 'DESC', 'orderby' => 'date', 'post_status' => 'publish', 'posts_per_page' => 1, ); $navigation_post = new WP_Query( $parsed_args ); if ( count( $navigation_post->posts ) > 0 ) { return $navigation_post->posts[0]; } return null; } /** * Creates a Navigation Menu post from a Classic Menu. * * @since 6.3.0 * * @return int|WP_Error The post ID of the default fallback menu or a WP_Error object. */ private static function create_classic_menu_fallback() { // See if we have a classic menu. $classic_nav_menu = static::get_fallback_classic_menu(); if ( ! $classic_nav_menu ) { return new WP_Error( 'no_classic_menus', __( 'No Classic Menus found.' ) ); } // If there is a classic menu then convert it to blocks. $classic_nav_menu_blocks = WP_Classic_To_Block_Menu_Converter::convert( $classic_nav_menu ); if ( is_wp_error( $classic_nav_menu_blocks ) ) { return $classic_nav_menu_blocks; } if ( empty( $classic_nav_menu_blocks ) ) { return new WP_Error( 'cannot_convert_classic_menu', __( 'Unable to convert Classic Menu to blocks.' ) ); } // Create a new navigation menu from the classic menu. $classic_menu_fallback = wp_insert_post( array( 'post_content' => $classic_nav_menu_blocks, 'post_title' => $classic_nav_menu->name, 'post_name' => $classic_nav_menu->slug, 'post_status' => 'publish', 'post_type' => 'wp_navigation', ), true // So that we can check whether the result is an error. ); return $classic_menu_fallback; } /** * Determines the most appropriate classic navigation menu to use as a fallback. * * @since 6.3.0 * * @return WP_Term|null The most appropriate classic navigation menu to use as a fallback. */ private static function get_fallback_classic_menu() { $classic_nav_menus = wp_get_nav_menus(); if ( ! $classic_nav_menus || is_wp_error( $classic_nav_menus ) ) { return null; } $nav_menu = static::get_nav_menu_at_primary_location(); if ( $nav_menu ) { return $nav_menu; } $nav_menu = static::get_nav_menu_with_primary_slug( $classic_nav_menus ); if ( $nav_menu ) { return $nav_menu; } return static::get_most_recently_created_nav_menu( $classic_nav_menus ); } /** * Sorts the classic menus and returns the most recently created one. * * @since 6.3.0 * * @param WP_Term[] $classic_nav_menus Array of classic nav menu term objects. * @return WP_Term The most recently created classic nav menu. */ private static function get_most_recently_created_nav_menu( $classic_nav_menus ) { usort( $classic_nav_menus, static function ( $a, $b ) { return $b->term_id - $a->term_id; } ); return $classic_nav_menus[0]; } /** * Returns the classic menu with the slug `primary` if it exists. * * @since 6.3.0 * * @param WP_Term[] $classic_nav_menus Array of classic nav menu term objects. * @return WP_Term|null The classic nav menu with the slug `primary` or null. */ private static function get_nav_menu_with_primary_slug( $classic_nav_menus ) { foreach ( $classic_nav_menus as $classic_nav_menu ) { if ( 'primary' === $classic_nav_menu->slug ) { return $classic_nav_menu; } } return null; } /** * Gets the classic menu assigned to the `primary` navigation menu location * if it exists. * * @since 6.3.0 * * @return WP_Term|null The classic nav menu assigned to the `primary` location or null. */ private static function get_nav_menu_at_primary_location() { $locations = get_nav_menu_locations(); if ( isset( $locations['primary'] ) ) { $primary_menu = wp_get_nav_menu_object( $locations['primary'] ); if ( $primary_menu ) { return $primary_menu; } } return null; } /** * Creates a default Navigation Block Menu fallback. * * @since 6.3.0 * * @return int|WP_Error The post ID of the default fallback menu or a WP_Error object. */ private static function create_default_fallback() { $default_blocks = static::get_default_fallback_blocks(); // Create a new navigation menu from the fallback blocks. $default_fallback = wp_insert_post( array( 'post_content' => $default_blocks, 'post_title' => _x( 'Navigation', 'Title of a Navigation menu' ), 'post_name' => 'navigation', 'post_status' => 'publish', 'post_type' => 'wp_navigation', ), true // So that we can check whether the result is an error. ); return $default_fallback; } /** * Gets the rendered markup for the default fallback blocks. * * @since 6.3.0 * * @return string default blocks markup to use a the fallback. */ private static function get_default_fallback_blocks() { $registry = WP_Block_Type_Registry::get_instance(); // If `core/page-list` is not registered then use empty blocks. return $registry->is_registered( 'core/page-list' ) ? '<!-- wp:page-list /-->' : ''; } }