Example #1
0
    // 將 exit 改為錯誤提示
} elseif (!$status_obj->public && !$status_obj->private) {
    do_action('comment_on_draft', $comment_post_ID);
    err(__('Invalid comment status.'));
    // 將 exit 改為錯誤提示
} elseif (post_password_required($comment_post_ID)) {
    do_action('comment_on_password_protected', $comment_post_ID);
    err(__('Password Protected'));
    // 將 exit 改為錯誤提示
} else {
    do_action('pre_comment_on_post', $comment_post_ID);
}
$arg0_name = comments_field_name($comment_post_ID, 0);
$arg1_name = comments_field_name($comment_post_ID, 1);
$arg2_name = comments_field_name($comment_post_ID, 2);
$arg3_name = comments_field_name($comment_post_ID, 3);
$comment_author = isset($_POST[$arg0_name]) ? trim(strip_tags($_POST[$arg0_name])) : null;
$comment_author_email = isset($_POST[$arg1_name]) ? trim($_POST[$arg1_name]) : null;
$comment_author_url = isset($_POST[$arg2_name]) ? trim($_POST[$arg2_name]) : null;
$comment_content = isset($_POST[$arg3_name]) ? trim($_POST[$arg3_name]) : null;
$edit_id = isset($_POST['edit_id']) ? $_POST['edit_id'] : null;
// 提取 edit_id
// If the user is logged in
$user = wp_get_current_user();
if ($user->ID) {
    if (empty($user->display_name)) {
        $user->display_name = $user->user_login;
    }
    global $wpdb;
    $comment_author = $wpdb->escape($user->display_name);
    $comment_author_email = $wpdb->escape($user->user_email);
Example #2
0
  <p style="margin-left:8px;">登录为 <a href="<?php 
            echo home_url();
            ?>
/wp-admin/profile.php"><?php 
            echo $user_identity;
            ?>
</a>. <a href="<?php 
            echo get_option('siteurl');
            ?>
/wp-login.php?action=logout" title="退出">退出 &raquo;</a></p>
  <?php 
        } else {
            $arg0 = comments_field_name($id, 0);
            $arg1 = comments_field_name($id, 1);
            $arg2 = comments_field_name($id, 2);
            $arg3 = comments_field_name($id, 3);
            ?>
  <p>
    <input type="text" name="<?php 
            echo $arg0;
            ?>
" class="comm_input input_0" value="<?php 
            echo $comment_author;
            ?>
" size="22" tabindex="1" />
    <label for="<?php 
            echo $arg0;
            ?>
">昵称 (必填)</label>
  </p>
  <p>