[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

WordPress Customize Nav Menus classes

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

Defines 30 functions

  __construct()
  filter_nonces()
  ajax_load_available_items()
  load_available_items_query()
  ajax_search_available_items()
  search_available_items_query()
  enqueue_scripts()
  filter_dynamic_setting_args()
  filter_dynamic_setting_class()
  customize_register()
  intval_base10()
  available_item_types()
  insert_auto_draft_post()
  ajax_insert_auto_draft_post()
  print_templates()
  available_items_template()
  print_post_type_container()
  print_custom_links_available_menu_item()
  customize_dynamic_partial_args()
  customize_preview_init()
  make_auto_draft_status_previewable()
  sanitize_nav_menus_created_posts()
  save_nav_menus_created_posts()
  filter_wp_nav_menu_args()
  filter_wp_nav_menu()
  hash_nav_menu_args()
  customize_preview_enqueue_deps()
  export_preview_data()
  export_partial_rendered_nav_menu_instances()
  render_nav_menu_partial()

Functions
Functions that are not part of a class:

__construct( $manager )   X-Ref
Constructor.

since: 4.3.0
param: object $manager An instance of the WP_Customize_Manager class.

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

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

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

since: 4.3.0

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

since: 4.3.0
param: string $type   Optional. Accepts any custom object type and has built-in support for
param: string $object 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'.
return: array|WP_Error An array of menu items on success, a WP_Error object on failure.

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
param: array $args Optional. Accepts 'pagenum' and 's' (search) arguments.
return: array Menu items.

enqueue_scripts()   X-Ref
Enqueue 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
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']`.
return: array|false

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

since: 4.3.0
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.
return: string

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

since: 4.3.0

intval_base10( $value )   X-Ref
Get 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
param: mixed $value Number to convert.
return: int Integer.

available_item_types()   X-Ref
Return 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
Add a new `auto-draft` post.

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

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

since: 4.7.0

print_templates()   X-Ref
Print 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
Print the html template used to render the add-menu-item frame.

since: 4.3.0

print_post_type_container( $available_item_type )   X-Ref
Print 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.
return: void

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

since: 4.7.0
return: void

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

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

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

since: 4.3.0

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

since: 4.7.0

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

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

save_nav_menus_created_posts( $setting )   X-Ref
Publish 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
Keep track of the arguments that are being passed to wp_nav_menu().

since: 4.3.0
param: array $args An array containing wp_nav_menu() arguments.
return: array 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
param: string $nav_menu_content The HTML content for the navigation menu.
param: object $args             An object containing wp_nav_menu() arguments.
return: string Nav menu HTML with selective refresh attributes added if partial can be refreshed.

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
param: array $args The arguments to hash.
return: string Hashed nav menu arguments.

customize_preview_enqueue_deps()   X-Ref
Enqueue 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
Export any wp_nav_menu() calls during the rendering of any partials.

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

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

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



Generated: Mon Nov 18 01:00:04 2019 Cross-referenced by PHPXref 0.7.1