Changeset 27667 for trunk/src/wp-admin/includes/post.php
- Timestamp:
- 03/24/2014 01:48:40 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/post.php
r27612 r27667 275 275 276 276 $attachment_data = isset( $post_data['attachments'][ $post_ID ] ) ? $post_data['attachments'][ $post_ID ] : array(); 277 277 278 /** This filter is documented in wp-admin/includes/media.php */ 278 279 $post_data = apply_filters( 'attachment_fields_to_save', $post_data, $attachment_data ); … … 496 497 } 497 498 499 /** 500 * Filter the default post content initially used in the "Write Post" form. 501 * 502 * @since 1.5.0 503 * 504 * @param string $post_content Default post content. 505 * @param WP_Post $post Post object. 506 */ 498 507 $post->post_content = apply_filters( 'default_content', $post_content, $post ); 499 $post->post_title = apply_filters( 'default_title', $post_title, $post ); 508 509 /** 510 * Filter the default post title initially used in the "Write Post" form. 511 * 512 * @since 1.5.0 513 * 514 * @param string $post_title Default post title. 515 * @param WP_Post $post Post object. 516 */ 517 $post->post_title = apply_filters( 'default_title', $post_title, $post ); 518 519 /** 520 * Filter the default post excerpt initially used in the "Write Post" form. 521 * 522 * @since 1.5.0 523 * 524 * @param string $post_excerpt Default post excerpt. 525 * @param WP_Post $post Post object. 526 */ 500 527 $post->post_excerpt = apply_filters( 'default_excerpt', $post_excerpt, $post ); 501 528 $post->post_name = ''; … … 866 893 $posts_per_page = 20; 867 894 895 /** 896 * Filter the number of items per page to show for a specific 'per_page' type. 897 * 898 * The dynamic hook name, $per_page, refers to a hook name comprised of the post type, 899 * preceded by 'edit_', and succeeded by '_per_page', e.g. 'edit_$post_type_per_page'. 900 * 901 * Some examples of filter hooks generated here include: 'edit_attachment_per_page', 902 * 'edit_post_per_page', 'edit_page_per_page', etc. 903 * 904 * @since 3.0.0 905 * 906 * @param int $posts_per_page Number of posts to display per page for the given 'per_page' 907 * type. Default 20. 908 */ 868 909 $posts_per_page = apply_filters( $per_page, $posts_per_page ); 910 911 /** 912 * Filter the number of posts displayed per page when specifically listing "posts". 913 * 914 * @since 2.8.0 915 * 916 * @param int $per_page Number of posts to be displayed. Default 20. 917 * @param string $post_type The post type. 918 */ 869 919 $posts_per_page = apply_filters( 'edit_posts_per_page', $posts_per_page, $post_type ); 870 920 … … 907 957 * 908 958 * @since 2.5.0 909 * @uses apply_filters() Calls 'upload_per_page' on posts_per_page argument910 959 * 911 960 * @param array|bool $q Array of query variables to use to build the query or false to use $_GET superglobal. … … 928 977 if ( empty( $media_per_page ) || $media_per_page < 1 ) 929 978 $media_per_page = 20; 979 980 /** 981 * Filter the number of items to list per page when listing media items. 982 * 983 * @since 2.9.0 984 * 985 * @param int $media_per_page Number of media to list. Default 20. 986 */ 930 987 $q['posts_per_page'] = apply_filters( 'upload_per_page', $media_per_page ); 931 988 … … 967 1024 } 968 1025 1026 /** 1027 * Filter the postbox classes for a specific screen and screen ID combo. 1028 * 1029 * The dynamic portions of the hook name, $page, and $id, refer to 1030 * the screen, and screen ID, respectively. 1031 * 1032 * @since 3.2.0 1033 * 1034 * @param array $classes An array of postbox classes. 1035 */ 969 1036 $classes = apply_filters( "postbox_classes_{$page}_{$id}", $classes ); 970 1037 return implode( ' ', $classes ); … … 1018 1085 $uri = strrev( stristr( strrev( $uri ), '/' ) ); 1019 1086 $uri = untrailingslashit($uri); 1087 1088 /** This filter is documented in wp-admin/edit-tag-form.php */ 1020 1089 $uri = apply_filters( 'editable_slug', $uri ); 1021 1090 if ( !empty($uri) ) … … 1024 1093 } 1025 1094 1026 $permalink = array($permalink, apply_filters('editable_slug', $post->post_name)); 1095 /** This filter is documented in wp-admin/edit-tag-form.php */ 1096 $permalink = array( $permalink, apply_filters( 'editable_slug', $post->post_name ) ); 1027 1097 $post->post_status = $original_status; 1028 1098 $post->post_date = $original_date; … … 1068 1138 $return .= "<span id='view-post-btn'><a href='$permalink' class='button button-small'>$view_post</a></span>\n"; 1069 1139 1070 $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug); 1140 /** 1141 * Filter the sample permalink HTML markup. 1142 * 1143 * @since 2.9.0 1144 * 1145 * @param string $return Sample permalink HTML markup. 1146 * @param int|WP_Post $id Post object or ID. 1147 * @param string $new_title New sample permalink title. 1148 * @param string $new_slug New sample permalink slug. 1149 */ 1150 $return = apply_filters( 'get_sample_permalink_html', $return, $id, $new_title, $new_slug ); 1071 1151 1072 1152 return $return; … … 1100 1180 } 1101 1181 1102 $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug); 1182 /** This filter is documented in wp-admin/includes/post.php */ 1183 $return = apply_filters( 'get_sample_permalink_html', $return, $id, $new_title, $new_slug ); 1103 1184 1104 1185 return $return; … … 1138 1219 } 1139 1220 1221 /** 1222 * Filter the admin post thumbnail HTML markup to return. 1223 * 1224 * @since 2.9.0 1225 * 1226 * @param string $content Admin post thumbnail HTML markup. 1227 * @param int $post_id Post ID. 1228 */ 1140 1229 return apply_filters( 'admin_post_thumbnail_html', $content, $post->ID ); 1141 1230 } … … 1160 1249 $user = isset( $lock[1] ) ? $lock[1] : get_post_meta( $post->ID, '_edit_last', true ); 1161 1250 1251 /** This filter is documented in wp-admin/includes/ajax-actions.php */ 1162 1252 $time_window = apply_filters( 'wp_check_post_lock_window', 150 ); 1163 1253 … … 1204 1294 1205 1295 if ( $user ) { 1296 1297 /** 1298 * Filter whether to show the post locked dialog. 1299 * 1300 * Returning a falsey value to the filter will short-circuit displaying the dialog. 1301 * 1302 * @since 3.6.0 1303 * 1304 * @param bool $display Whether to display the dialog. Default true. 1305 * @param WP_User|bool $user WP_User object on success, false otherwise. 1306 */ 1206 1307 if ( ! apply_filters( 'show_post_locked_dialog', true, $post, $user ) ) 1207 1308 return; … … 1246 1347 } 1247 1348 1349 /** This filter is documented in wp-admin/includes/meta-boxes.php */ 1248 1350 $preview_link = apply_filters( 'preview_post_link', $preview_link ); 1351 1352 /** 1353 * Filter whether to allow the post lock to be overridden. 1354 * 1355 * Returning a falsey value to the filter will disable the ability 1356 * to override the post lock. 1357 * 1358 * @since 3.6.0 1359 * 1360 * @param bool $override Whether to allow overriding post locks. Default true. 1361 * @param WP_Post $post Post object. 1362 * @param WP_User $user User object. 1363 */ 1249 1364 $override = apply_filters( 'override_post_lock', true, $post, $user ); 1250 1365 $tab_last = $override ? '' : ' wp-tab-last'; … … 1260 1375 ?> 1261 1376 </p> 1262 <?php do_action( 'post_locked_dialog', $post ); ?> 1377 <?php 1378 /** 1379 * Fires inside the post locked dialog before the buttons are displayed. 1380 * 1381 * @since 3.6.0 1382 * 1383 * @param WP_Post $post Post object. 1384 */ 1385 do_action( 'post_locked_dialog', $post ); 1386 ?> 1263 1387 <p> 1264 1388 <a class="button" href="<?php echo esc_url( $sendback ); ?>"><?php echo $sendback_text; ?></a> … … 1288 1412 <span class="locked-saved hidden"><?php _e('Your latest changes were saved as a revision.'); ?></span> 1289 1413 </p> 1290 <?php do_action( 'post_lock_lost_dialog', $post ); ?> 1414 <?php 1415 /** 1416 * Fires inside the dialog displayed when a user has lost the post lock. 1417 * 1418 * @since 3.6.0 1419 * 1420 * @param WP_Post $post Post object. 1421 */ 1422 do_action( 'post_lock_lost_dialog', $post ); 1423 ?> 1291 1424 <p><a class="button button-primary wp-tab-last" href="<?php echo esc_url( $sendback ); ?>"><?php echo $sendback_text; ?></a></p> 1292 1425 </div> … … 1415 1548 1416 1549 $url = add_query_arg( $query_args, get_permalink( $post->ID ) ); 1550 1551 /** This filter is documented in wp-admin/includes/meta-boxes.php */ 1417 1552 return apply_filters( 'preview_post_link', $url ); 1418 1553 }
Note: See TracChangeset
for help on using the changeset viewer.