Changeset 29206 for trunk/src/wp-admin/includes/ajax-actions.php
- Timestamp:
- 07/17/2014 09:13:53 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r29178 r29206 22 22 $response = array(); 23 23 24 // screen_id is the same as $current_screen->id and the JS global 'pagenow' 24 // screen_id is the same as $current_screen->id and the JS global 'pagenow'. 25 25 if ( ! empty($_POST['screen_id']) ) 26 26 $screen_id = sanitize_key($_POST['screen_id']); … … 65 65 do_action( 'heartbeat_nopriv_tick', $response, $screen_id ); 66 66 67 // send the current time according to the server67 // Send the current time according to the server. 68 68 $response['server_time'] = time(); 69 69 … … 363 363 $comment_count = wp_count_comments($post_id); 364 364 365 if ( isset( $comment_count->$status ) ) // We're looking for a known type of comment count 365 // We're looking for a known type of comment count. 366 if ( isset( $comment_count->$status ) ) 366 367 $total = $comment_count->$status; 367 // else use the decremented value from above 368 } 369 370 $time = time(); // The time since the last comment count 368 // Else use the decremented value from above. 369 } 370 371 // The time since the last comment count. 372 $time = time(); 371 373 372 374 $x = new WP_Ajax_Response( array( 373 375 'what' => 'comment', 374 'id' => $comment_id, // here for completeness - not used 376 // Here for completeness - not used. 377 'id' => $comment_id, 375 378 'supplemental' => array( 376 379 'total_items_i18n' => sprintf( _n( '1 item', '%s items', $total ), number_format_i18n( $total ) ), … … 956 959 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID'); 957 960 958 // automatically approve parent comment961 // Automatically approve parent comment. 959 962 if ( !empty($_POST['approve_parent']) ) { 960 963 $parent = get_comment( $comment_parent ); … … 1513 1516 1514 1517 $post = get_post( $post_ID, ARRAY_A ); 1515 $post = wp_slash($post); //since it is from db 1518 1519 // Since it's coming from the database. 1520 $post = wp_slash($post); 1516 1521 1517 1522 $data['content'] = $post['post_content']; 1518 1523 $data['excerpt'] = $post['post_excerpt']; 1519 1524 1520 // rename1525 // Rename. 1521 1526 $data['user_ID'] = get_current_user_id(); 1522 1527 … … 1524 1529 $data['parent_id'] = $data['post_parent']; 1525 1530 1526 // status1531 // Status. 1527 1532 if ( isset($data['keep_private']) && 'private' == $data['keep_private'] ) 1528 1533 $data['post_status'] = 'private'; … … 1541 1546 } 1542 1547 1543 // update the post1548 // Update the post. 1544 1549 edit_post(); 1545 1550 … … 1687 1692 unset( $_POST['savewidgets'], $_POST['action'] ); 1688 1693 1689 // save widgets order for all sidebars1694 // Save widgets order for all sidebars. 1690 1695 if ( is_array($_POST['sidebars']) ) { 1691 1696 $sidebars = array(); … … 1752 1757 $sidebar = isset($sidebars[$sidebar_id]) ? $sidebars[$sidebar_id] : array(); 1753 1758 1754 // delete1759 // Delete. 1755 1760 if ( isset($_POST['delete_widget']) && $_POST['delete_widget'] ) { 1756 1761 … … 2412 2417 2413 2418 $post = get_post( isset( $_POST['post_id'] ) ? $_POST['post_id'] : 0 ); 2414 // ping WordPress for an embed 2419 2420 // Ping WordPress for an embed. 2415 2421 $check_embed = $wp_embed->run_shortcode( '[embed]'. $src .'[/embed]' ); 2416 // fallback that WordPress creates when no oEmbed was found 2422 2423 // Fallback that WordPress creates when no oEmbed was found. 2417 2424 $fallback = $wp_embed->maybe_make_link( $src ); 2418 2425 … … 2457 2464 } 2458 2465 2459 // screen_id is the same as $current_screen->id and the JS global 'pagenow' 2466 // screen_id is the same as $current_screen->id and the JS global 'pagenow'. 2460 2467 if ( ! empty($_POST['screen_id']) ) 2461 2468 $screen_id = sanitize_key($_POST['screen_id']);
Note: See TracChangeset
for help on using the changeset viewer.