编辑:comment.php
<?php /** * WordPress Comment Administration API. * * @package WordPress * @subpackage Administration * @since 2.3.0 */ /** * Determines if a comment exists based on author and date. * * For best performance, use `$timezone = 'gmt'`, which queries a field that is properly indexed. The default value * for `$timezone` is 'blog' for legacy reasons. * * @since 2.0.0 * @since 4.4.0 Added the `$timezone` parameter. * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $comment_author Author of the comment. * @param string $comment_date Date of the comment. * @param string $timezone Timezone. Accepts 'blog' or 'gmt'. Default 'blog'. * @return string|null Comment post ID on success. */ function comment_exists( $comment_author, $comment_date, $timezone = 'blog' ) { global $wpdb; $date_field = 'comment_date'; if ( 'gmt' === $timezone ) { $date_field = 'comment_date_gmt'; } return $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_author = %s AND $date_field = %s", stripslashes( $comment_author ), stripslashes( $comment_date ) ) ); } /** * Updates a comment with values provided in $_POST. * * @since 2.0.0 * @since 5.5.0 A return value was added. * * @return int|WP_Error The value 1 if the comment was updated, 0 if not updated. * A WP_Error object on failure. */ function edit_comment() { if ( ! current_user_can( 'edit_comment', (int) $_POST['comment_ID'] ) ) { wp_die( __( 'Sorry, you are not allowed to edit comments on this post.' ) ); } if ( isset( $_POST['newcomment_author'] ) ) { $_POST['comment_author'] = $_POST['newcomment_author']; } if ( isset( $_POST['newcomment_author_email'] ) ) { $_POST['comment_author_email'] = $_POST['newcomment_author_email']; } if ( isset( $_POST['newcomment_author_url'] ) ) { $_POST['comment_author_url'] = $_POST['newcomment_author_url']; } if ( isset( $_POST['comment_status'] ) ) { $_POST['comment_approved'] = $_POST['comment_status']; } if ( isset( $_POST['content'] ) ) { $_POST['comment_content'] = $_POST['content']; } if ( isset( $_POST['comment_ID'] ) ) { $_POST['comment_ID'] = (int) $_POST['comment_ID']; } foreach ( array( 'aa', 'mm', 'jj', 'hh', 'mn' ) as $timeunit ) { if ( ! empty( $_POST[ 'hidden_' . $timeunit ] ) && $_POST[ 'hidden_' . $timeunit ] !== $_POST[ $timeunit ] ) { $_POST['edit_date'] = '1'; break; } } if ( ! empty( $_POST['edit_date'] ) ) { $aa = $_POST['aa']; $mm = $_POST['mm']; $jj = $_POST['jj']; $hh = $_POST['hh']; $mn = $_POST['mn']; $ss = $_POST['ss']; $jj = ( $jj > 31 ) ? 31 : $jj; $hh = ( $hh > 23 ) ? $hh - 24 : $hh; $mn = ( $mn > 59 ) ? $mn - 60 : $mn; $ss = ( $ss > 59 ) ? $ss - 60 : $ss; $_POST['comment_date'] = "$aa-$mm-$jj $hh:$mn:$ss"; } return wp_update_comment( $_POST, true ); } /** * Returns a WP_Comment object based on comment ID. * * @since 2.0.0 * * @param int $id ID of comment to retrieve. * @return WP_Comment|false Comment if found. False on failure. */ function get_comment_to_edit( $id ) { $comment = get_comment( $id ); if ( ! $comment ) { return false; } $comment->comment_ID = (int) $comment->comment_ID; $comment->comment_post_ID = (int) $comment->comment_post_ID; $comment->comment_content = format_to_edit( $comment->comment_content ); /** * Filters the comment content before editing. * * @since 2.0.0 * * @param string $comment_content Comment content. */ $comment->comment_content = apply_filters( 'comment_edit_pre', $comment->comment_content ); $comment->comment_author = format_to_edit( $comment->comment_author ); $comment->comment_author_email = format_to_edit( $comment->comment_author_email ); $comment->comment_author_url = format_to_edit( $comment->comment_author_url ); $comment->comment_author_url = esc_url( $comment->comment_author_url ); return $comment; } /** * Gets the number of pending comments on a post or posts. * * @since 2.3.0 * @since 6.9.0 Exclude the 'note' comment type from the count. * * @global wpdb $wpdb WordPress database abstraction object. * * @param int|int[] $post_id Either a single Post ID or an array of Post IDs * @return int|int[] Either a single Posts pending comments as an int or an array of ints keyed on the Post IDs */ function get_pending_comments_num( $post_id ) { global $wpdb; $single = false; if ( ! is_array( $post_id ) ) { $post_id_array = (array) $post_id; $single = true; } else { $post_id_array = $post_id; } $post_id_array = array_map( 'intval', $post_id_array ); $post_id_in = "'" . implode( "', '", $post_id_array ) . "'"; $pending = $wpdb->get_results( "SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id_in ) AND comment_approved = '0' AND comment_type != 'note' GROUP BY comment_post_ID", ARRAY_A ); if ( $single ) { if ( empty( $pending ) ) { return 0; } else { return absint( $pending[0]['num_comments'] ); } } $pending_keyed = array(); // Default to zero pending for all posts in request. foreach ( $post_id_array as $id ) { $pending_keyed[ $id ] = 0; } if ( ! empty( $pending ) ) { foreach ( $pending as $pend ) { $pending_keyed[ $pend['comment_post_ID'] ] = absint( $pend['num_comments'] ); } } return $pending_keyed; } /** * Adds avatars to relevant places in admin. * * @since 2.5.0 * * @param string $name User name. * @return string Avatar with the user name. */ function floated_admin_avatar( $name ) { $avatar = get_avatar( get_comment(), 32, 'mystery' ); return "$avatar $name"; } /** * Enqueues comment shortcuts jQuery script. * * @since 2.7.0 */ function enqueue_comment_hotkeys_js() { if ( 'true' === get_user_option( 'comment_shortcuts' ) ) { wp_enqueue_script( 'jquery-table-hotkeys' ); } } /** * Displays error message at bottom of comments. * * @since 2.5.0 * * @param string $msg Error Message. Assumed to contain HTML and be sanitized. */ function comment_footer_die( $msg ) { echo "<div class='wrap'><p>$msg</p></div>"; require_once ABSPATH . 'wp-admin/admin-footer.php'; die; }
保存文件
位置:
home
/
robertofarias
/
public_html
/
wp-admin
/
includes
批量上传
创建
创建
批量权限
批量删除
名称
权限
大小
修改时间
操作
↑ 返回上级
-
-
-
-
admin-filters.php
-rw-r--r--
7.85 KB
2025-04-16 11:06
编辑
下载
权限
删除
重命名
admin.php
-rw-r--r--
3.54 KB
2022-11-10 19:44
编辑
下载
权限
删除
重命名
ajax-actions.php
-rw-r--r--
148.33 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
bookmark.php
-rw-r--r--
11.45 KB
2025-04-16 11:06
编辑
下载
权限
删除
重命名
class-automatic-upgrader-skin.php
-rw-r--r--
3.58 KB
2023-08-09 11:43
编辑
下载
权限
删除
重命名
class-bulk-plugin-upgrader-skin.php
-rw-r--r--
2.53 KB
2024-07-17 11:51
编辑
下载
权限
删除
重命名
class-bulk-theme-upgrader-skin.php
-rw-r--r--
2.6 KB
2024-07-17 11:51
编辑
下载
权限
删除
重命名
class-bulk-upgrader-skin.php
-rw-r--r--
6.59 KB
2024-07-17 11:51
编辑
下载
权限
删除
重命名
class-core-upgrader.php
-rw-r--r--
14.83 KB
2024-11-13 13:01
编辑
下载
权限
删除
重命名
class-custom-background.php
-rw-r--r--
21.18 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-custom-image-header.php
-rw-r--r--
48.13 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-file-upload-upgrader.php
-rw-r--r--
4.07 KB
2024-07-17 11:51
编辑
下载
权限
删除
重命名
class-ftp-pure.php
-rw-r--r--
5.3 KB
2019-11-01 14:57
编辑
下载
权限
删除
重命名
class-ftp-sockets.php
-rw-r--r--
8.28 KB
2022-03-22 16:25
编辑
下载
权限
删除
重命名
class-ftp.php
-rw-r--r--
26.73 KB
2025-04-16 11:06
编辑
下载
权限
删除
重命名
class-language-pack-upgrader-skin.php
-rw-r--r--
2.8 KB
2024-07-17 11:51
编辑
下载
权限
删除
重命名
class-language-pack-upgrader.php
-rw-r--r--
15.2 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-pclzip.php
-rw-r--r--
192.08 KB
2025-04-16 11:06
编辑
下载
权限
删除
重命名
class-plugin-installer-skin.php
-rw-r--r--
11.77 KB
2024-11-13 13:01
编辑
下载
权限
删除
重命名
class-plugin-upgrader-skin.php
-rw-r--r--
3.2 KB
2023-08-09 11:43
编辑
下载
权限
删除
重命名
class-plugin-upgrader.php
-rw-r--r--
22.89 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-theme-installer-skin.php
-rw-r--r--
12.77 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-theme-upgrader-skin.php
-rw-r--r--
4.08 KB
2024-04-03 10:16
编辑
下载
权限
删除
重命名
class-theme-upgrader.php
-rw-r--r--
26.27 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-walker-category-checklist.php
-rw-r--r--
4.97 KB
2024-11-13 13:01
编辑
下载
权限
删除
重命名
class-walker-nav-menu-checklist.php
-rw-r--r--
5.57 KB
2026-03-11 06:39
编辑
下载
权限
删除
重命名
class-walker-nav-menu-edit.php
-rw-r--r--
13.93 KB
2026-03-11 06:39
编辑
下载
权限
删除
重命名
class-wp-ajax-upgrader-skin.php
-rw-r--r--
4.09 KB
2023-08-09 11:43
编辑
下载
权限
删除
重命名
class-wp-application-passwords-list-table.php
-rw-r--r--
6.79 KB
2024-04-03 10:16
编辑
下载
权限
删除
重命名
class-wp-automatic-updater.php
-rw-r--r--
60.45 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-comments-list-table.php
-rw-r--r--
32.4 KB
2026-02-27 10:54
编辑
下载
权限
删除
重命名
class-wp-community-events.php
-rw-r--r--
18.24 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-debug-data.php
-rw-r--r--
66.01 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-filesystem-base.php
-rw-r--r--
23.84 KB
2024-04-03 10:16
编辑
下载
权限
删除
重命名
class-wp-filesystem-direct.php
-rw-r--r--
17.72 KB
2024-04-03 10:16
编辑
下载
权限
删除
重命名
class-wp-filesystem-ftpext.php
-rw-r--r--
22.71 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-filesystem-ftpsockets.php
-rw-r--r--
18.05 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-filesystem-ssh2.php
-rw-r--r--
22.76 KB
2024-04-03 10:16
编辑
下载
权限
删除
重命名
class-wp-importer.php
-rw-r--r--
7.34 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-internal-pointers.php
-rw-r--r--
4.51 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-links-list-table.php
-rw-r--r--
9.02 KB
2024-11-13 13:01
编辑
下载
权限
删除
重命名
class-wp-list-table-compat.php
-rw-r--r--
1.46 KB
2020-11-14 16:54
编辑
下载
权限
删除
重命名
class-wp-list-table.php
-rw-r--r--
51.76 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-media-list-table.php
-rw-r--r--
25.29 KB
2025-04-16 11:06
编辑
下载
权限
删除
重命名
class-wp-ms-sites-list-table.php
-rw-r--r--
21.61 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-ms-themes-list-table.php
-rw-r--r--
27.77 KB
2025-04-16 11:06
编辑
下载
权限
删除
重命名
class-wp-ms-users-list-table.php
-rw-r--r--
15.35 KB
2025-04-16 11:06
编辑
下载
权限
删除
重命名
class-wp-plugin-install-list-table.php
-rw-r--r--
24.54 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-plugins-list-table.php
-rw-r--r--
56.44 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-post-comments-list-table.php
-rw-r--r--
1.42 KB
2022-10-04 03:47
编辑
下载
权限
删除
重命名
class-wp-posts-list-table.php
-rw-r--r--
63.66 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-privacy-data-export-requests-list-table.php
-rw-r--r--
5.43 KB
2022-03-10 19:22
编辑
下载
权限
删除
重命名
class-wp-privacy-data-removal-requests-list-table.php
-rw-r--r--
5.58 KB
2023-11-08 10:55
编辑
下载
权限
删除
重命名
class-wp-privacy-policy-content.php
-rw-r--r--
31.9 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-privacy-requests-table.php
-rw-r--r--
14.44 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-screen.php
-rw-r--r--
36.47 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-site-health-auto-updates.php
-rw-r--r--
14 KB
2025-04-16 11:06
编辑
下载
权限
删除
重命名
class-wp-site-health.php
-rw-r--r--
121.89 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-site-icon.php
-rw-r--r--
6.26 KB
2024-04-03 10:16
编辑
下载
权限
删除
重命名
class-wp-terms-list-table.php
-rw-r--r--
20.73 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-theme-install-list-table.php
-rw-r--r--
15.23 KB
2025-04-16 11:06
编辑
下载
权限
删除
重命名
class-wp-themes-list-table.php
-rw-r--r--
10.14 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-upgrader-skin.php
-rw-r--r--
6.94 KB
2024-07-17 11:51
编辑
下载
权限
删除
重命名
class-wp-upgrader-skins.php
-rw-r--r--
1.44 KB
2019-10-08 17:19
编辑
下载
权限
删除
重命名
class-wp-upgrader.php
-rw-r--r--
46.85 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
class-wp-users-list-table.php
-rw-r--r--
18.61 KB
2024-04-03 10:16
编辑
下载
权限
删除
重命名
comment.php
-rw-r--r--
6.08 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
continents-cities.php
-rw-r--r--
20.06 KB
2022-09-19 23:24
编辑
下载
权限
删除
重命名
credits.php
-rw-r--r--
5.73 KB
2025-04-16 11:06
编辑
下载
权限
删除
重命名
dashboard.php
-rw-r--r--
68.18 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
deprecated.php
-rw-r--r--
40.8 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
edit-tag-messages.php
-rw-r--r--
1.44 KB
2021-12-07 12:20
编辑
下载
权限
删除
重命名
error_log
-rw-r--r--
1.91 KB
2026-04-26 04:42
编辑
下载
权限
删除
重命名
export.php
-rw-r--r--
25.26 KB
2026-02-27 10:54
编辑
下载
权限
删除
重命名
file.php
-rw-r--r--
95.94 KB
2026-03-12 05:56
编辑
下载
权限
删除
重命名
image-edit.php
-rw-r--r--
43.12 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
image.php
-rw-r--r--
41.73 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
import.php
-rw-r--r--
6.46 KB
2024-11-13 13:01
编辑
下载
权限
删除
重命名
list-table.php
-rw-r--r--
3.71 KB
2022-10-04 03:47
编辑
下载
权限
删除
重命名
media.php
-rw-r--r--
116.31 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
menu.php
-rw-r--r--
9.39 KB
2024-04-03 10:16
编辑
下载
权限
删除
重命名
meta-boxes.php
-rw-r--r--
64.34 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
misc.php
-rw-r--r--
44.73 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
ms-admin-filters.php
-rw-r--r--
1.27 KB
2022-09-20 02:51
编辑
下载
权限
删除
重命名
ms-deprecated.php
-rw-r--r--
3.68 KB
2022-09-20 02:51
编辑
下载
权限
删除
重命名
ms.php
-rw-r--r--
33.53 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
nav-menu.php
-rw-r--r--
48.84 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
network.php
-rw-r--r--
26.35 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
noop.php
-rw-r--r--
1.12 KB
2023-11-08 10:55
编辑
下载
权限
删除
重命名
options.php
-rw-r--r--
4.19 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
plugin-install.php
-rw-r--r--
38.19 KB
2026-02-27 10:54
编辑
下载
权限
删除
重命名
plugin.php
-rw-r--r--
91.33 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
post.php
-rw-r--r--
80.39 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
privacy-tools.php
-rw-r--r--
32.67 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
revision.php
-rw-r--r--
16.18 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
schema.php
-rw-r--r--
44.46 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
screen.php
-rw-r--r--
6.23 KB
2024-07-17 11:51
编辑
下载
权限
删除
重命名
taxonomy.php
-rw-r--r--
8.23 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
template.php
-rw-r--r--
96.96 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
theme-install.php
-rw-r--r--
6.83 KB
2024-04-03 10:16
编辑
下载
权限
删除
重命名
translation-install.php
-rw-r--r--
10.82 KB
2024-11-13 13:01
编辑
下载
权限
删除
重命名
update-core.php
-rw-r--r--
68.86 KB
2026-03-12 05:56
编辑
下载
权限
删除
重命名
update.php
-rw-r--r--
33.63 KB
2025-04-16 11:06
编辑
下载
权限
删除
重命名
upgrade.php
-rw-r--r--
113.3 KB
2025-12-04 05:41
编辑
下载
权限
删除
重命名
user.php
-rw-r--r--
22.98 KB
2025-04-16 11:06
编辑
下载
权限
删除
重命名
widgets.php
-rw-r--r--
10.66 KB
2023-11-08 10:55
编辑
下载
权限
删除
重命名