[ Index ]

PHP Cross Reference of WordPress




/wp-includes/ -> class-wp-customize-nav-menus.php (summary)

WordPress Customize Nav Menus classes

File Size: 1586 lines (57 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 30 functions


Functions that are not part of a class:

__construct( $manager )   X-Ref

since: 4.3.0
param: WP_Customize_Manager $manager Customizer bootstrap instance.

filter_nonces( $nonces )   X-Ref
Adds a nonce for customizing menus.

since: 4.5.0
return: string[] Modified array of nonces.
param: string[] $nonces Array of nonces.

ajax_load_available_items()   X-Ref
Ajax handler for loading available menu items.

since: 4.3.0

load_available_items_query( $object_type = 'post_type', $object_name = 'page', $page = 0 )   X-Ref
Performs the post_type and taxonomy queries for loading available menu items.

since: 4.3.0
return: array|WP_Error An array of menu items on success, a WP_Error object on failure.
param: string $object_type Optional. Accepts any custom object type and has built-in support for
param: string $object_name Optional. Accepts any registered taxonomy or post type name. Default is 'page'.
param: int    $page        Optional. The page number used to generate the query offset. Default is '0'.

ajax_search_available_items()   X-Ref
Ajax handler for searching available menu items.

since: 4.3.0

search_available_items_query( $args = array()   X-Ref
Performs post queries for available-item searching.

Based on WP_Editor::wp_link_query().

since: 4.3.0
return: array Menu items.
param: array $args Optional. Accepts 'pagenum' and 's' (search) arguments.

enqueue_scripts()   X-Ref
Enqueues scripts and styles for Customizer pane.

since: 4.3.0

filter_dynamic_setting_args( $setting_args, $setting_id )   X-Ref
Filters a dynamic setting's constructor args.

For a dynamic setting to be registered, this filter must be employed
to override the default false value with an array of args to pass to
the WP_Customize_Setting constructor.

since: 4.3.0
return: array|false
param: false|array $setting_args The arguments to the WP_Customize_Setting constructor.
param: string      $setting_id   ID for dynamic setting, usually coming from `$_POST['customized']`.

filter_dynamic_setting_class( $setting_class, $setting_id, $setting_args )   X-Ref
Allows non-statically created settings to be constructed with custom WP_Customize_Setting subclass.

since: 4.3.0
return: string
param: string $setting_class WP_Customize_Setting or a subclass.
param: string $setting_id    ID for dynamic setting, usually coming from `$_POST['customized']`.
param: array  $setting_args  WP_Customize_Setting or a subclass.

customize_register()   X-Ref
Adds the customizer settings and controls.

since: 4.3.0

intval_base10( $value )   X-Ref
Gets the base10 intval.

This is used as a setting's sanitize_callback; we can't use just plain
intval because the second argument is not what intval() expects.

since: 4.3.0
return: int Integer.
param: mixed $value Number to convert.

available_item_types()   X-Ref
Returns an array of all the available item types.

since: 4.3.0
since: 4.7.0  Each array item now includes a `$type_label` in addition to `$title`, `$type`, and `$object`.
return: array The available menu item types.

insert_auto_draft_post( $postarr )   X-Ref
Adds a new `auto-draft` post.

since: 4.7.0
return: WP_Post|WP_Error Inserted auto-draft post object or error.
param: array $postarr {

ajax_insert_auto_draft_post()   X-Ref
Ajax handler for adding a new auto-draft post.

since: 4.7.0

print_templates()   X-Ref
Prints the JavaScript templates used to render Menu Customizer components.

Templates are imported into the JS use wp.template.

since: 4.3.0

available_items_template()   X-Ref
Prints the HTML template used to render the add-menu-item frame.

since: 4.3.0

print_post_type_container( $available_item_type )   X-Ref
Prints the markup for new menu items.

To be used in the template #available-menu-items.

since: 4.7.0
param: array $available_item_type Menu item data to output, including title, type, and label.

print_custom_links_available_menu_item()   X-Ref
Prints the markup for available menu item custom links.

since: 4.7.0

customize_dynamic_partial_args( $partial_args, $partial_id )   X-Ref
Filters arguments for dynamic nav_menu selective refresh partials.

since: 4.5.0
return: array Partial args.
param: array|false $partial_args Partial args.
param: string      $partial_id   Partial ID.

customize_preview_init()   X-Ref
Adds hooks for the Customizer preview.

since: 4.3.0

make_auto_draft_status_previewable()   X-Ref
Makes the auto-draft status protected so that it can be queried.

since: 4.7.0

sanitize_nav_menus_created_posts( $value )   X-Ref
Sanitizes post IDs for posts created for nav menu items to be published.

since: 4.7.0
return: array Post IDs.
param: array $value Post IDs.

save_nav_menus_created_posts( $setting )   X-Ref
Publishes the auto-draft posts that were created for nav menu items.

The post IDs will have been sanitized by already by
`WP_Customize_Nav_Menu_Items::sanitize_nav_menus_created_posts()` to
remove any post IDs for which the user cannot publish or for which the
post is not an auto-draft.

since: 4.7.0
param: WP_Customize_Setting $setting Customizer setting object.

filter_wp_nav_menu_args( $args )   X-Ref
Keeps track of the arguments that are being passed to wp_nav_menu().

since: 4.3.0
return: array Arguments.
param: array $args An array containing wp_nav_menu() arguments.

filter_wp_nav_menu( $nav_menu_content, $args )   X-Ref
Prepares wp_nav_menu() calls for partial refresh.

Injects attributes into container element.

since: 4.3.0
return: string Nav menu HTML with selective refresh attributes added if partial can be refreshed.
param: string $nav_menu_content The HTML content for the navigation menu.
param: object $args             An object containing wp_nav_menu() arguments.

hash_nav_menu_args( $args )   X-Ref
Hashes (hmac) the nav menu arguments to ensure they are not tampered with when
submitted in the Ajax request.

Note that the array is expected to be pre-sorted.

since: 4.3.0
return: string Hashed nav menu arguments.
param: array $args The arguments to hash.

customize_preview_enqueue_deps()   X-Ref
Enqueues scripts for the Customizer preview.

since: 4.3.0

export_preview_data()   X-Ref
Exports data from PHP to JS.

since: 4.3.0

export_partial_rendered_nav_menu_instances( $response )   X-Ref
Exports any wp_nav_menu() calls during the rendering of any partials.

since: 4.5.0
return: array Response.
param: array $response Response.

render_nav_menu_partial( $partial, $nav_menu_args )   X-Ref
Renders a specific menu via wp_nav_menu() using the supplied arguments.

since: 4.3.0
return: string|false
param: WP_Customize_Partial $partial       Partial.
param: array                $nav_menu_args Nav menu args supplied as container context.

Generated: Sat Jun 22 01:00:02 2024 Cross-referenced by PHPXref 0.7.1