#32: attachment_fields_to_save

The attachment_fields_to_save filter allows you to modify the associated data of an attachment.

It is evaluated in:

attachment_fields_to_save accepts 2 arguments:

  1. array $post The attachment attributes.
  2. array $attachment_data An array of attachment fields.

Example:

The following shows how you might go about saving a custom attachment field — we’ll say, a field with the id of image_editor_name — implemented via the attachment_fields_to_edit filter.

View the code example on Gist.

#31: wp_check_post_lock_window

The wp_check_post_lock_window filter allows you to modify the post lock window duration.

It is evaluated in:

wp_check_post_lock_window accepts a single argument:

  1. int $interval The interval in seconds the post lock window should last. Default is 120.

Example:

The following example extends the post lock window to 2.5 minutes, or 150 seconds.

View the code example on Gist.

#30: nav_menu_meta_box_object

The nav_menu_meta_box_object filter allows you to modify a nav menu meta box object.

It was added in 3.0.

It is evaluated in wp_ajax_menu_get_metabox() in the wp-admin/includes/ajax-actions.php file.

nav_menu_meta_box_object accepts a single argument:

  1. object $item_object The nav menu meta box object, e.g. Page, Post, Category, Tag, etc.

Example:

The following example renames the ‘Categories’ and ‘Tags’ accordion sections in the menus screen to ‘Category Archives’ and ‘Tag Archives’ respectively since adding menu links to specific terms in these taxonomies will point to their archives anyway.

View the code example on Gist.