Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 25618)
+++ wp-includes/post.php	(working copy)
@@ -189,6 +189,15 @@
 		$file = $uploads['basedir'] . "/$file";
 	if ( $unfiltered )
 		return $file;
+		
+	/**
+	 * Filter the attachment file path.
+	 *
+	 * @since 2.1.0
+	 *
+	 * @param string $file The file path to be filtered.
+	 * @param int $attachment_id The ID of the attachment.
+	 */
 	return apply_filters( 'get_attached_file', $file, $attachment_id );
 }
 
@@ -209,6 +218,14 @@
 	if ( !get_post( $attachment_id ) )
 		return false;
 
+	/**
+	 * Filter the attachment file path before saving.
+	 *
+	 * @since 2.1.0
+	 *
+	 * @param string $file The file path to be filtered.
+	 * @param int $attachment_id The ID of the attachment.
+	 */
 	$file = apply_filters( 'update_attached_file', $file, $attachment_id );
 	if ( $file = _wp_relative_upload_path( $file ) )
 		return update_post_meta( $attachment_id, '_wp_attached_file', $file );
@@ -236,6 +253,14 @@
 			$new_path = ltrim( $new_path, '/' );
 	}
 
+	/**
+	 * Filter the attachment file path before saving.
+	 *
+	 * @since 2.9.0
+	 *
+	 * @param string $newpath The relative path fo the file.
+	 * @param string $path The original absolute path to the file.
+	 */
 	return apply_filters( '_wp_relative_upload_path', $new_path, $path );
 }
 
@@ -1331,6 +1356,14 @@
 		register_taxonomy_for_object_type( $taxonomy, $post_type );
 	}
 
+	/**
+	 * Fires actions to be run after a post type is registered.
+	 *
+	 * @since 3.3.0
+	 *
+	 * @param string $post_type The slug of the post type registered.
+	 * @param object $args The arguments for the post type registration.
+	 */
 	do_action( 'registered_post_type', $post_type, $args );
 
 	return $args;
@@ -1497,6 +1530,14 @@
 	$labels = _get_custom_object_labels( $post_type_object, $nohier_vs_hier_defaults );
 
 	$post_type = $post_type_object->name;
+	
+	/**
+	 * Filter the labels for a specific post type.
+	 *
+	 * @since 3.5.0
+	 *
+	 * @param array $labels the labels for the custom post type.
+	 */
 	return apply_filters( "post_type_labels_{$post_type}", $labels );
 }
 
@@ -1981,11 +2022,26 @@
 		$format_to_edit = array('post_content', 'post_excerpt', 'post_title', 'post_password');
 
 		if ( $prefixed ) {
-			$value = apply_filters("edit_{$field}", $value, $post_id);
-			// Old school
-			$value = apply_filters("{$field_no_prefix}_edit_pre", $value, $post_id);
+			/**
+			 * Filter and sanitize the value of the prefixed field (for editing).
+			 *
+			 * @since 2.3.0
+			 *
+			 * @param mixed $value The Post Object value to sanitize.
+			 * @param int $post_id The Post ID.
+			 */
+			$value = apply_filters( "edit_{$field}", $value, $post_id );
+			/**
+			 * Old school method...
+			 * @see edit_{$field} filter above.
+			 */
+			$value = apply_filters( "{$field_no_prefix}_edit_pre", $value, $post_id );
 		} else {
-			$value = apply_filters("edit_post_{$field}", $value, $post_id);
+			/**
+			 * Non prefixed version...
+			 * @see edit_{$field} filter above.
+			 */
+			$value = apply_filters( "edit_post_{$field}", $value, $post_id );
 		}
 
 		if ( in_array($field, $format_to_edit) ) {
@@ -1998,18 +2054,56 @@
 		}
 	} else if ( 'db' == $context ) {
 		if ( $prefixed ) {
-			$value = apply_filters("pre_{$field}", $value);
-			$value = apply_filters("{$field_no_prefix}_save_pre", $value);
+			/**
+			 * Filter and sanitize the value of the prefixed field (for database use).
+			 *
+			 * @since 2.3.0
+			 *
+			 * @param mixed $value The Post Object value to sanitize.
+			 */
+			$value = apply_filters( "pre_{$field}", $value );
+			/**
+			 * Filter value after pre_{$field} is run.
+			 *
+			 * @since 2.3.0
+			 *
+			 * @param mixed $value The Post Object value to sanitize.
+			 */
+			$value = apply_filters( "{$field_no_prefix}_save_pre", $value );
 		} else {
-			$value = apply_filters("pre_post_{$field}", $value);
-			$value = apply_filters("{$field}_pre", $value);
+			/**
+			 * Non prefixed version...
+			 * @see pre_{$field} filter above
+			 */
+			$value = apply_filters( "pre_post_{$field}", $value );
+			/**
+			 * Filter value after pre_post_{$field} is run.
+			 *
+			 * @since 2.3.0
+			 *
+			 * @param mixed $value The Post Object value to sanitize.
+			 */
+			$value = apply_filters( "{$field}_pre", $value );
 		}
 	} else {
 		// Use display filters by default.
 		if ( $prefixed )
-			$value = apply_filters($field, $value, $post_id, $context);
+			/**
+			 * Filter and sanitize the value of the prefixed field (for other contexts).
+			 *
+			 * @since 2.3.0
+			 *
+			 * @param mixed $value The Post Object value to sanitize.
+			 * @param int $post_id The Post ID.
+			 * @param string $context The context to filter for.
+			 */
+			$value = apply_filters( $field, $value, $post_id, $context );
 		else
-			$value = apply_filters("post_{$field}", $value, $post_id, $context);
+			/**
+			 * Non prefixed version...
+			 * @see {$field} filter directly above.
+			 */
+			$value = apply_filters( "post_{$field}", $value, $post_id, $context );
 	}
 
 	if ( 'attribute' == $context )
@@ -2181,7 +2275,14 @@
 		'video' => array(__('Video'), __('Manage Video'), _n_noop('Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>')),
 	);
 
-	return apply_filters('post_mime_types', $post_mime_types);
+	/**
+	 * Filter the default post mime types.
+	 *
+	 * @since 2.5.0
+	 *
+	 * @param array $post_mime_types The array of post mime-types in slug=>labels format.
+	 */
+	return apply_filters( 'post_mime_types', $post_mime_types );
 }
 
 /**
@@ -2299,7 +2400,14 @@
 	if ( $post->post_type == 'attachment' )
 		return wp_delete_attachment( $postid, $force_delete );
 
-	do_action('before_delete_post', $postid);
+	/**
+	 * Fire actions to be run before the post is prepped for deletion.
+	 *
+	 * @since 3.2.0
+	 *
+	 * @param int $postid The Post ID.
+	 */
+	do_action( 'before_delete_post', $postid );
 
 	delete_post_meta($postid,'_wp_trash_meta_status');
 	delete_post_meta($postid,'_wp_trash_meta_time');
@@ -2334,8 +2442,25 @@
 	foreach ( $post_meta_ids as $mid )
 		delete_metadata_by_mid( 'post', $mid );
 
+	/**
+	 * Fires actions to be run JUST before the actual post is deleted.
+	 *
+	 * @since 1.2.1 (possibly earlier)
+	 *
+	 * @param int $postid The Post ID.
+	 */
 	do_action( 'delete_post', $postid );
+	
+	// Delete the post from the database
 	$wpdb->delete( $wpdb->posts, array( 'ID' => $postid ) );
+	
+	/**
+	 * Fires actions to be run JUST after the actual post is deleted.
+	 *
+	 * @since 2.2.0
+	 *
+	 * @param int $postid The Post ID.
+	 */
 	do_action( 'deleted_post', $postid );
 
 	clean_post_cache( $post );
@@ -2347,7 +2472,14 @@
 
 	wp_clear_scheduled_hook('publish_future_post', array( $postid ) );
 
-	do_action('after_delete_post', $postid);
+	/**
+	 * Fires actions to run after delete_post has completed.
+	 *
+	 * @since 3.2.0
+	 *
+	 * @param int $postid The Post ID.
+	 */
+	do_action( 'after_delete_post', $postid );
 
 	return $post;
 }
@@ -2403,7 +2535,14 @@
 	if ( $post['post_status'] == 'trash' )
 		return false;
 
-	do_action('wp_trash_post', $post_id);
+	/**
+	 * Fires actions to be run before trashing a post.
+	 *
+	 * @since 3.3.0
+	 *
+	 * @param int $post_id The Post ID.
+	 */
+	do_action( 'wp_trash_post', $post_id );
 
 	add_post_meta($post_id,'_wp_trash_meta_status', $post['post_status']);
 	add_post_meta($post_id,'_wp_trash_meta_time', time());
@@ -2413,7 +2552,14 @@
 
 	wp_trash_post_comments($post_id);
 
-	do_action('trashed_post', $post_id);
+	/**
+	 * Fires actions to be run after trashing a post.
+	 *
+	 * @since 2.9.0
+	 *
+	 * @param int $post_id The Post ID.
+	 */
+	do_action( 'trashed_post', $post_id );
 
 	return $post;
 }
@@ -2435,7 +2581,14 @@
 	if ( $post['post_status'] != 'trash' )
 		return false;
 
-	do_action('untrash_post', $post_id);
+	/**
+	 * Fires actions to be run before untrashing a post.
+	 *
+	 * @since 3.3.0
+	 *
+	 * @param int $post_id The Post ID.
+	 */
+	do_action( 'untrash_post', $post_id );
 
 	$post_status = get_post_meta($post_id, '_wp_trash_meta_status', true);
 
@@ -2448,7 +2601,14 @@
 
 	wp_untrash_post_comments($post_id);
 
-	do_action('untrashed_post', $post_id);
+	/**
+	 * Fires actions to be run after untrashing a post.
+	 *
+	 * @since 2.9.0
+	 *
+	 * @param int $post_id The Post ID.
+	 */
+	do_action( 'untrashed_post', $post_id );
 
 	return $post;
 }
@@ -2472,7 +2632,14 @@
 
 	$post_id = $post->ID;
 
-	do_action('trash_post_comments', $post_id);
+	/**
+	 * Fires actions to be run before trashing the post comments.
+	 *
+	 * @since 3.3.0
+	 *
+	 * @param int $post_id The Post ID.
+	 */
+	do_action( 'trash_post_comments', $post_id );
 
 	$comments = $wpdb->get_results( $wpdb->prepare("SELECT comment_ID, comment_approved FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id) );
 	if ( empty($comments) )
@@ -2489,7 +2656,14 @@
 
 	clean_comment_cache( array_keys($statuses) );
 
-	do_action('trashed_post_comments', $post_id, $statuses);
+	/**
+	 * Fires actions to be run after trashing the post comments.
+	 *
+	 * @since 2.9.0
+	 *
+	 * @param int $post_id The Post ID.
+	 */
+	do_action( 'trashed_post_comments', $post_id, $statuses );
 
 	return $result;
 }
@@ -2518,7 +2692,14 @@
 	if ( empty($statuses) )
 		return true;
 
-	do_action('untrash_post_comments', $post_id);
+	/**
+	 * Fires actions to be run before untrashing the post comments.
+	 *
+	 * @since 3.3.0
+	 *
+	 * @param int $post_id The Post ID.
+	 */
+	do_action( 'untrash_post_comments', $post_id );
 
 	// Restore each comment to its original status
 	$group_by_status = array();
@@ -2537,7 +2718,14 @@
 
 	delete_post_meta($post_id, '_wp_trash_meta_comments_status');
 
-	do_action('untrashed_post_comments', $post_id);
+	/**
+	 * Fires actions to be run after untrashing the post comments.
+	 *
+	 * @since 2.9.0
+	 *
+	 * @param int $post_id The Post ID.
+	 */
+	do_action( 'untrashed_post_comments', $post_id );
 }
 
 /**
@@ -2738,6 +2926,14 @@
 	$maybe_empty = ! $post_content && ! $post_title && ! $post_excerpt && post_type_supports( $post_type, 'editor' )
 		&& post_type_supports( $post_type, 'title' ) && post_type_supports( $post_type, 'excerpt' );
 
+	/**
+	 * Fitler to modify the $maybe_empty value. Use to force the value to true or false.
+	 *
+	 * @since 3.3.0
+	 *
+	 * @param bool $maybe_empty The current value saying if the post may be empty.
+	 * @param array $postarr The array of post data elements passed to this function.
+	 */
 	if ( apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ) ) {
 		if ( $wp_error )
 			return new WP_Error( 'empty_content', __( 'Content, title, and excerpt are empty.' ) );
@@ -2850,6 +3046,16 @@
 		$post_parent = 0;
 
 	// Check the post_parent to see if it will cause a hierarchy loop
+	/**
+	 * Filter to test and make sure the post_parent won't cause a heirarchy loop.
+	 *
+	 * @since 3.1.0
+	 *
+	 * @param int $post_parent The intended post_parent value.
+	 * @param int $post_ID The ID of the post being inserted/updated.
+	 * @param array $postarr The modified post array pulling in the modified extracted variables.
+	 * @param array $postarr The original post array passed to the function.
+	 */
 	$post_parent = apply_filters( 'wp_insert_post_parent', $post_parent, $post_ID, compact( array_keys( $postarr ) ), $postarr );
 
 	if ( isset($menu_order) )
@@ -2864,11 +3070,28 @@
 
 	// expected_slashed (everything!)
 	$data = compact( array( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order', 'guid' ) );
-	$data = apply_filters('wp_insert_post_data', $data, $postarr);
+	
+	/**
+	 * Filter the post data before insertion.
+	 *
+	 * @since 2.7.0
+	 *
+	 * @param array $data The modified post data array.
+	 * @param array $postarr The original post array passed to the function.
+	 */
+	$data = apply_filters( 'wp_insert_post_data', $data, $postarr );
 	$data = wp_unslash( $data );
 	$where = array( 'ID' => $post_ID );
 
 	if ( $update ) {
+		/**
+		 * Fire actions to be run before the post is updated.
+		 *
+		 * @since 2.5.0
+		 *
+		 * @param int $post_ID The Post ID.
+		 * @param array $data The post data array we're updating with.
+		 */
 		do_action( 'pre_post_update', $post_ID, $data );
 		if ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) {
 			if ( $wp_error )
@@ -2945,13 +3168,62 @@
 	wp_transition_post_status($data['post_status'], $previous_status, $post);
 
 	if ( $update ) {
-		do_action('edit_post', $post_ID, $post);
+		/**
+		 * Fire actions to be run after the post has been edited.
+		 *
+		 * @since 1.2.1
+		 *
+		 * @param int $post_ID The Post ID.
+		 * @param WP_Post $post The Post object (after being updated).
+		 */
+		do_action( 'edit_post', $post_ID, $post );
+		
 		$post_after = get_post($post_ID);
-		do_action( 'post_updated', $post_ID, $post_after, $post_before);
+		
+		/**
+		 * Fire actions to be run after the post has been updated,
+		 * with comparision of the post before and after updating.
+		 *
+		 * @since 3.0.0
+		 *
+		 * @param int $post_ID The Post ID.
+		 * @param WP_Post $post_after The Post object (after being updated).
+		 * @param WP_Post $post_before The Post object (before being updated).
+		 */
+		do_action( 'post_updated', $post_ID, $post_after, $post_before );
 	}
 
+	/**
+	 * Fire actions to be run after updating a post of a specific type.
+	 *
+	 * @since 3.7.0
+	 *
+	 * @param int $post_ID The Post ID.
+	 * @param WP_Post $post The Post object (after being updated).
+	 * @param bool $update Wether or not this was an update vs. an insert.
+	 */
 	do_action( "save_post_{$post->post_type}", $post_ID, $post, $update );
+
+	/**
+	 * Fire actions to be run after updating a post.
+	 *
+	 * @since 1.5.2
+	 *
+	 * @param int $post_ID The Post ID.
+	 * @param WP_Post $post The Post object (after being updated).
+	 * @param bool $update Wether or not this was an update vs. an insert.
+	 */
 	do_action( 'save_post', $post_ID, $post, $update );
+
+	/**
+	 * Fire actions to be run after wp_insert_post is completed.
+	 *
+	 * @since 2.0
+	 *
+	 * @param int $post_ID The Post ID.
+	 * @param WP_Post $post The Post object (after being updated).
+	 * @param bool $update Wether or not this was an update vs. an insert.
+	 */
 	do_action( 'wp_insert_post', $post_ID, $post, $update );
 
 	return $post_ID;
@@ -3041,10 +3313,17 @@
 	$old_status = $post->post_status;
 	$post->post_status = 'publish';
 	wp_transition_post_status( 'publish', $old_status, $post );
-
+	
+	// Duplicate hook
 	do_action( 'edit_post', $post->ID, $post );
+	
+	// Duplicate hook
 	do_action( "save_post_{$post->post_type}", $post->ID, $post, true );
+	
+	// Duplicate hook
 	do_action( 'save_post', $post->ID, $post, true );
+	
+	// Duplicate hook
 	do_action( 'wp_insert_post', $post->ID, $post, true );
 }
 
@@ -3112,7 +3391,17 @@
 		$check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND ID != %d LIMIT 1";
 		$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_ID ) );
 
-		if ( $post_name_check || in_array( $slug, $feeds ) || apply_filters( 'wp_unique_post_slug_is_bad_attachment_slug', false, $slug ) ) {
+		/**
+		 * Filter to flag the post slug as a bad attachment slug.
+		 *
+		 * @since 3.1.0
+		 *
+		 * @param bool false The default value for the flag.
+		 * @param string $slug The slug to test with.
+		 */
+		$slug_is_bad = apply_filters( 'wp_unique_post_slug_is_bad_attachment_slug', false, $slug );
+		
+		if ( $post_name_check || in_array( $slug, $feeds ) || $slug_is_bad ) {
 			$suffix = 2;
 			do {
 				$alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
@@ -3129,7 +3418,19 @@
 		$check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( '" . implode( "', '", esc_sql( $hierarchical_post_types ) ) . "' ) AND ID != %d AND post_parent = %d LIMIT 1";
 		$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_ID, $post_parent ) );
 
-		if ( $post_name_check || in_array( $slug, $feeds ) || preg_match( "@^($wp_rewrite->pagination_base)?\d+$@", $slug )  || apply_filters( 'wp_unique_post_slug_is_bad_hierarchical_slug', false, $slug, $post_type, $post_parent ) ) {
+		/**
+		 * Filter to flag the post slug as a bad hierarchical slug.
+		 *
+		 * @since 3.1.0
+		 *
+		 * @param bool false The default value for the flag.
+		 * @param string $slug The slug to test with.
+		 * @param string $post_type The post's type.
+		 * @param int $post_parent The ID of the post's parent.
+		 */
+		$slug_is_bad = apply_filters( 'wp_unique_post_slug_is_bad_hierarchical_slug', false, $slug, $post_type, $post_parent );
+
+		if ( $post_name_check || in_array( $slug, $feeds ) || preg_match( "@^($wp_rewrite->pagination_base)?\d+$@", $slug ) || $slug_is_bad ) {
 			$suffix = 2;
 			do {
 				$alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
@@ -3143,7 +3444,18 @@
 		$check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1";
 		$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_ID ) );
 
-		if ( $post_name_check || in_array( $slug, $feeds ) || apply_filters( 'wp_unique_post_slug_is_bad_flat_slug', false, $slug, $post_type ) ) {
+		/**
+		 * Filter to flag the post slug as a bad flat slug.
+		 *
+		 * @since 3.1.0
+		 *
+		 * @param bool false The default value for the flag.
+		 * @param string $slug The slug to test with.
+		 * @param string $post_type The post's type.
+		 */
+		$slug_is_bad = apply_filters( 'wp_unique_post_slug_is_bad_flat_slug', false, $slug, $post_type );
+
+		if ( $post_name_check || in_array( $slug, $feeds ) || $slug_is_bad ) {
 			$suffix = 2;
 			do {
 				$alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
@@ -3154,6 +3466,18 @@
 		}
 	}
 
+	/**
+	 * Filter the unique slug for the post.
+	 *
+	 * @since 3.3.0
+	 *
+	 * @param string $slug The unique slug to filter.
+	 * @param int $post_ID The Post ID.
+	 * @param string $post_status The Post status.
+	 * @param string $post_type The Post type.
+	 * @param int $post_parent The Post parent.
+	 * @param string $slug The original slug passed.
+	 */
 	return apply_filters( 'wp_unique_post_slug', $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug );
 }
 
@@ -3335,7 +3659,16 @@
 	$pung = preg_split('/\s/', $pung);
 	$pung[] = $uri;
 	$new = implode("\n", $pung);
-	$new = apply_filters('add_ping', $new);
+	
+	/**
+	 * Filter the array of "pung" URLs to update with.
+	 *
+	 * @since 2.0.0
+	 *
+	 * @param array $new The updated array of URLs.
+	 */
+	$new = apply_filters( 'add_ping', $new );
+	
 	// expected_slashed ($new)
 	$new = wp_unslash($new);
 	return $wpdb->update( $wpdb->posts, array( 'pinged' => $new ), array( 'ID' => $post_id ) );
@@ -3363,7 +3696,16 @@
 			$pung[] = trim( $enclosure[ 0 ] );
 		}
 	}
-	$pung = apply_filters('get_enclosed', $pung, $post_id);
+	
+	/**
+	 * Filter the array of enclosures.
+	 *
+	 * @since 2.0.0
+	 *
+	 * @param array $pung The list of enclosures.
+	 * @param int $post_id The Post ID.
+	 */
+	$pung = apply_filters( 'get_enclosed', $pung, $post_id );
 	return $pung;
 }
 
@@ -3381,7 +3723,15 @@
 	$pung = $wpdb->get_var( $wpdb->prepare( "SELECT pinged FROM $wpdb->posts WHERE ID = %d", $post_id ));
 	$pung = trim($pung);
 	$pung = preg_split('/\s/', $pung);
-	$pung = apply_filters('get_pung', $pung);
+	
+	/**
+	 * Filter the array of "pung" URLs to return.
+	 *
+	 * @since 2.0.0
+	 *
+	 * @param array $new The updated array of URLs.
+	 */
+	$pung = apply_filters( 'get_pung', $pung );
 	return $pung;
 }
 
@@ -3399,7 +3749,15 @@
 	$to_ping = $wpdb->get_var( $wpdb->prepare( "SELECT to_ping FROM $wpdb->posts WHERE ID = %d", $post_id ));
 	$to_ping = sanitize_trackback_urls( $to_ping );
 	$to_ping = preg_split('/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY);
-	$to_ping = apply_filters('get_to_ping',  $to_ping);
+	
+	/**
+	 * Filter the list of URLs to be pinged.
+	 *
+	 * @since 2.0.0
+	 *
+	 * @param array $to_ping The list of URLs to ping.
+	 */
+	$to_ping = apply_filters( 'get_to_ping',  $to_ping );
 	return $to_ping;
 }
 
@@ -3727,7 +4085,16 @@
 	if ( $cache = wp_cache_get( $cache_key, 'posts' ) ) {
 		// Convert to WP_Post instances
 		$pages = array_map( 'get_post', $cache );
-		$pages = apply_filters('get_pages', $pages, $r);
+		
+		/**
+		 * Filter the list of pages being fetched.
+		 *
+		 * @since 2.1.0
+		 *
+		 * @param array $pages The array of pages being fetched.
+		 * @param array $r The parsed arguments passed to this function.
+		 */
+		$pages = apply_filters( 'get_pages', $pages, $r );
 		return $pages;
 	}
 
@@ -3857,7 +4224,8 @@
 	$pages = $wpdb->get_results($query);
 
 	if ( empty($pages) ) {
-		$pages = apply_filters('get_pages', array(), $r);
+		// Duplicate hook
+		$pages = apply_filters( 'get_pages', array(), $r );
 		return $pages;
 	}
 
@@ -3896,7 +4264,8 @@
 	// Convert to WP_Post instances
 	$pages = array_map( 'get_post', $pages );
 
-	$pages = apply_filters('get_pages', $pages, $r);
+	// Duplicate hook
+	$pages = apply_filters( 'get_pages', $pages, $r );
 
 	return $pages;
 }
@@ -4111,9 +4480,23 @@
 		add_post_meta( $post_ID, '_wp_attachment_context', $context, true );
 
 	if ( $update) {
-		do_action('edit_attachment', $post_ID);
+		/**
+		 * Fires actions to run after an attachment has been edited.
+		 *
+		 * @since 2.0.0
+		 *
+		 * @param int $post_ID The Post ID.
+		 */
+		do_action( 'edit_attachment', $post_ID );
 	} else {
-		do_action('add_attachment', $post_ID);
+		/**
+		 * Fires actions to run after an attachment has been added.
+		 *
+		 * @since 2.0.0
+		 *
+		 * @param int $post_ID The Post ID.
+		 */
+		do_action( 'add_attachment', $post_ID );
 	}
 
 	return $post_ID;
@@ -4165,7 +4548,14 @@
 	if ( is_multisite() )
 		delete_transient( 'dirsize_cache' );
 
-	do_action('delete_attachment', $post_id);
+	/**
+	 * Fires actions to be run before preperation for attachment deletion.
+	 *
+	 * @since 2.0.0
+	 *
+	 * @param int $post_id The attachment id.
+	 */
+	do_action( 'delete_attachment', $post_id );
 
 	wp_delete_object_term_relationships($post_id, array('category', 'post_tag'));
 	wp_delete_object_term_relationships($post_id, get_object_taxonomies($post->post_type));
@@ -4180,8 +4570,12 @@
 	foreach ( $post_meta_ids as $mid )
 		delete_metadata_by_mid( 'post', $mid );
 
+	// Duplicate hook
 	do_action( 'delete_post', $post_id );
+	
 	$wpdb->delete( $wpdb->posts, array( 'ID' => $post_id ) );
+	
+	// Duplicate hook
 	do_action( 'deleted_post', $post_id );
 
 	$uploadpath = wp_upload_dir();
@@ -4190,13 +4584,23 @@
 		// Don't delete the thumb if another attachment uses it
 		if (! $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata' AND meta_value LIKE %s AND post_id <> %d", '%' . $meta['thumb'] . '%', $post_id)) ) {
 			$thumbfile = str_replace(basename($file), $meta['thumb'], $file);
-			$thumbfile = apply_filters('wp_delete_file', $thumbfile);
+			
+			/**
+			 * Filter the path of file to delete.
+			 *
+			 * @since 2.1.0
+			 *
+			 * @param string $thumbfile The name of the thumbnail file.
+			 */
+			$thumbfile = apply_filters( 'wp_delete_file', $thumbfile );
+			
 			@ unlink( path_join($uploadpath['basedir'], $thumbfile) );
 		}
 	}
 
 	// remove intermediate and backup images if there are any
 	foreach ( $intermediate_sizes as $intermediate ) {
+		// Duplicate hook
 		$intermediate_file = apply_filters( 'wp_delete_file', $intermediate['path'] );
 		@ unlink( path_join($uploadpath['basedir'], $intermediate_file) );
 	}
@@ -4204,12 +4608,14 @@
 	if ( is_array($backup_sizes) ) {
 		foreach ( $backup_sizes as $size ) {
 			$del_file = path_join( dirname($meta['file']), $size['file'] );
-			$del_file = apply_filters('wp_delete_file', $del_file);
+			// Duplicate hook
+			$del_file = apply_filters( 'wp_delete_file', $del_file );
 			@ unlink( path_join($uploadpath['basedir'], $del_file) );
 		}
 	}
 
-	$file = apply_filters('wp_delete_file', $file);
+	// Duplicate hook
+	$file = apply_filters( 'wp_delete_file', $file );
 
 	if ( ! empty($file) )
 		@ unlink($file);
@@ -4237,7 +4643,15 @@
 
 	if ( $unfiltered )
 		return $data;
-
+	
+	/**
+	 * Filter the attachment metadata.
+	 *
+	 * @since 2.1.0
+	 *
+	 * @param array $data The attachment metadata array.
+	 * @param int $post->ID The Post ID.
+	 */
 	return apply_filters( 'wp_get_attachment_metadata', $data, $post->ID );
 }
 
@@ -4255,6 +4669,7 @@
 	if ( !$post = get_post( $post_id ) )
 		return false;
 
+	// Duplicate hook
 	if ( $data = apply_filters( 'wp_update_attachment_metadata', $data, $post->ID ) )
 		return update_post_meta( $post->ID, '_wp_attachment_metadata', $data );
 	else
@@ -4292,6 +4707,14 @@
 	if ( empty($url) ) //If any of the above options failed, Fallback on the GUID as used pre-2.7, not recommended to rely upon this.
 		$url = get_the_guid( $post->ID );
 
+	/**
+	 * Filter the attachment's URL.
+	 *
+	 * @since 2.1.0
+	 *
+	 * @param string $url The attachment URL.
+	 * @param int $post->ID The Post ID.
+	 */
 	$url = apply_filters( 'wp_get_attachment_url', $url, $post->ID );
 
 	if ( empty( $url ) )
@@ -4318,7 +4741,16 @@
 	$file = get_attached_file( $post->ID );
 
 	if ( !empty($imagedata['thumb']) && ($thumbfile = str_replace(basename($file), $imagedata['thumb'], $file)) && file_exists($thumbfile) )
+		/**
+		 * Filter the path to the thumbnail file.
+		 *
+		 * @since 2.1.0
+		 *
+		 * @param string $thumbfile The path to the thumbnail file.
+		 * @param int $post->ID The Post ID.
+		 */
 		return apply_filters( 'wp_get_attachment_thumb_file', $thumbfile, $post->ID );
+	
 	return false;
 }
 
@@ -4346,6 +4778,14 @@
 
 	$url = str_replace(basename($url), basename($thumb), $url);
 
+	/**
+	 * Filter the URL of the thumbnail file.
+	 *
+	 * @since 2.1.0
+	 *
+	 * @param string $url The URL of the thumbnail.
+	 * @param int $post->ID The Post ID.
+	 */
 	return apply_filters( 'wp_get_attachment_thumb_url', $url, $post->ID );
 }
 
@@ -4410,9 +4850,33 @@
 		$icon_files = wp_cache_get('icon_files');
 
 		if ( !is_array($icon_files) ) {
+			/**
+			 * Filter the path to the icons directory.
+			 *
+			 * @since 2.0.0
+			 *
+			 * @param string The absolute path to the icon directory.
+			 */
 			$icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/crystal' );
+			
+			/**
+			 * Filter the URI to the icons directory.
+			 *
+			 * @since 2.0
+			 *
+			 * @param string The URI to the icon directory.
+			 */
 			$icon_dir_uri = apply_filters( 'icon_dir_uri', includes_url('images/crystal') );
+			
+			/**
+			 * Filter the icon directories array.
+			 *
+			 * @since 2.5.0
+			 *
+			 * @param array The icon directories array.
+			 */
 			$dirs = apply_filters( 'icon_dirs', array($icon_dir => $icon_dir_uri) );
+			
 			$icon_files = array();
 			while ( $dirs ) {
 				$keys = array_keys( $dirs );
@@ -4459,6 +4923,15 @@
 		}
 	}
 
+	/**
+	 * Filter the icon mime type.
+	 *
+	 * @since 2.1.0
+	 *
+	 * @param string $icon The path to the icon image.
+	 * @param string $mime The mime type the icon represents.
+	 * @param int $post_id The Post ID.
+	 */
 	return apply_filters( 'wp_mime_type_icon', $icon, $mime, $post_id ); // Last arg is 0 if function pass mime type.
 }
 
@@ -4539,7 +5012,15 @@
 	if ( ! $post_type_obj )
 		return $full ? 'WHERE 1 = 0' : ' 1 = 0 ';
 
-	// This hook is deprecated. Why you'd want to use it, I dunno.
+	/**
+	 * Filter for creating the read_private_posts capability.
+	 *
+	 * @deprecated 
+	 *
+	 * @since 2.2.0
+	 *
+	 * @param string '' An empty string.
+	 */
 	if ( ! $cap = apply_filters( 'pub_priv_sql_capability', '' ) )
 		$cap = $post_type_obj->cap->read_private_posts;
 
@@ -4591,7 +5072,17 @@
  * @return string The date of the last post.
  */
 function get_lastpostdate($timezone = 'server') {
-	return apply_filters( 'get_lastpostdate', _get_last_post_time( $timezone, 'date' ), $timezone );
+	$date = _get_last_post_time( $timezone, 'date' );
+	
+	/**
+	 * Filters the last post date.
+	 *
+	 * @since 2.3.0
+	 *
+	 * @param string $date The date field of the timestamp.
+	 * @param string $timezone The location used to get the time.
+	 */
+	return apply_filters( 'get_lastpostdate', $date, $timezone );
 }
 
 /**
@@ -4613,7 +5104,15 @@
 	$lastpostdate = get_lastpostdate($timezone);
 	if ( $lastpostdate > $lastpostmodified )
 		$lastpostmodified = $lastpostdate;
-
+	
+	/**
+	 * Filters the last post modified dated.
+	 *
+	 * @since 2.3.0
+	 *
+	 * @param string $lastpostmodified The modified field of the timestamp.
+	 * @param string $timezone The location used to get the time.
+	 */
 	return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone );
 }
 
@@ -4716,6 +5215,14 @@
 
 	wp_cache_delete( 'wp_get_archives', 'general' );
 
+	/**
+	 * Fires actions to be run once the post cache has been cleaned.
+	 *
+	 * @since 2.5.0
+	 *
+	 * @param int $post->ID The Post ID.
+	 * @param WP_Post The Post object.
+	 */
 	do_action( 'clean_post_cache', $post->ID, $post );
 
 	if ( is_post_type_hierarchical( $post->post_type ) )
@@ -4723,6 +5230,14 @@
 
 	if ( 'page' == $post->post_type ) {
 		wp_cache_delete( 'all_page_ids', 'posts' );
+		
+		/**
+		 * Fires actions to be run once the page cache has been cleaned.
+		 *
+		 * @since 2.5.0
+		 *
+		 * @param int $post->ID The Post ID.
+		 */
 		do_action( 'clean_page_cache', $post->ID );
 	}
 
@@ -4829,7 +5344,14 @@
 	if ( $clean_terms )
 		clean_object_term_cache($id, 'attachment');
 
-	do_action('clean_attachment_cache', $id);
+	/**
+	 * Fires actions to run once the attachment cache has been cleaned.
+	 *
+	 * @since 3.0.0
+	 *
+	 * @param int $id The attachment ID.
+	 */
+	do_action( 'clean_attachment_cache', $id );
 }
 
 //
@@ -4856,6 +5378,17 @@
 		// Reset GUID if transitioning to publish and it is empty
 		if ( '' == get_the_guid($post->ID) )
 			$wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post->ID ) ), array( 'ID' => $post->ID ) );
+			
+		/**
+		 * Fires actions to run once the post status has been changed
+		 * from private to published
+		 *
+		 * @deprecated Use 'private_to_publish' instead.
+		 *
+		 * @since 1.5.2
+		 *
+		 * @param int $post->ID The Post ID.
+		 */
 		do_action('private_to_published', $post->ID);  // Deprecated, use private_to_publish
 	}
 
@@ -4901,6 +5434,14 @@
  */
 function _publish_post_hook($post_id) {
 	if ( defined('XMLRPC_REQUEST') )
+		/**
+		 * Fires actions to be run before scheduling,
+		 * provided XMLRPC_REQUEST is defined.
+		 *
+		 * @since 2.1.0
+		 *
+		 * @param int $post_id The Post ID.
+		 */
 		do_action('xmlrpc_publish_post', $post_id);
 
 	if ( defined('WP_IMPORTING') )
@@ -4908,6 +5449,7 @@
 
 	if ( get_option('default_pingback_flag') )
 		add_post_meta( $post_id, '_pingme', '1' );
+		
 	add_post_meta( $post_id, '_encloseme', '1' );
 
 	wp_schedule_single_event(time(), 'do_pings');
