\/\/\u90e8\u5206\u5185\u5bb9\u8bc4\u8bba\u53ef\u89c1\nfunction reply_to_read($atts, $content=null) { \n extract(shortcode_atts(array(\"notice\" => '<p class=\"reply-to-read\">\u6e29\u99a8\u63d0\u793a: \u6b64\u5904\u5185\u5bb9\u9700\u8981<a href=\"#respond\" title=\"\u8bc4\u8bba\u672c\u6587\">\u8bc4\u8bba\u672c\u6587<\/a>\u540e\u624d\u80fd\u67e5\u770b.<\/p>'), $atts)); \n $email = null; \n $user_ID = (int) wp_get_current_user()->ID; \n if ($user_ID > 0) { \n $email = get_userdata($user_ID)->user_email; \n \/\/\u5bf9\u7ad9\u957f\u76f4\u63a5\u663e\u793a\u5185\u5bb9 \n $admin_email = \"admin@ymjihe.com\"; \/\/\u7ad9\u957fEmail \n if ($email == $admin_email) { \n return $content; \n } \n } else if (isset($_COOKIE['comment_author_email_' . COOKIEHASH])) { \n $email = str_replace('%40', '@', $_COOKIE['comment_author_email_' . COOKIEHASH]); \n } else { \n return $notice; \n } \n if (empty($email)) { \n return $notice; \n } \n global $wpdb; \n $post_id = get_the_ID(); \n $query = \"SELECT `comment_ID` FROM {$wpdb->comments} WHERE `comment_post_ID`={$post_id} and `comment_approved`='1' and `comment_author_email`='{$email}' LIMIT 1\"; \n if ($wpdb->get_results($query)) { \n return do_shortcode($content); \n } else { \n return $notice; \n } \n } \n \n add_shortcode('reply', 'reply_to_read');<\/code><\/pre>\n\n\n\n\u6ce8\uff1a\u8bf7\u81ea\u884c\u4fee\u6539\u7b2c8\u884c\u7684\u90ae\u4ef6\u4e3a\u7ba1\u7406\u5458\u7684\u3002\u5982\u679c\u4f60\u7684\u7f51\u7ad9\u4f7f\u7528\u4e86ajax\u514d\u5237\u65b0\u63d0\u4ea4\u8bc4\u8bba\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u4fee\u6539\u7b2c2\u884c\u7684\u63d0\u793a\u6587\u5b57\uff0c\u63d0\u793a\u8bbf\u5ba2\u8bc4\u8bba\u540e\u5237\u65b0\u9875\u9762\u6765\u67e5\u770b\u9690\u85cf\u5185\u5bb9\u3002<\/p>\n\n\n\n
\u8c03\u7528\u65b9\u6cd5<\/h2>\n\n\n\n
\u7f16\u8f91\u6587\u7ae0\u65f6\uff0c\u4f7f\u7528\u4e0b\u9762\u7684\u4e24\u79cd\u7b80\u7801\u8c03\u7528\uff1a<\/p>\n\n\n\n
\/\/\u7b80\u78011 \u4efb\u9009\u4e00\u79cd\u4f7f\u7528\n\n[reply]\u8bc4\u8bba\u53ef\u89c1\u7684\u5185\u5bb9[\/reply]\n\n\/\/\u7b80\u78012 \u4efb\u9009\u4e00\u79cd\u4f7f\u7528\n\n[reply notice=\"\u81ea\u5b9a\u4e49\u7684\u63d0\u793a\u4fe1\u606f\"]\u8bc4\u8bba\u53ef\u89c1\u7684\u5185\u5bb9[\/reply]\n\ufeff<\/code><\/pre>\n\n\n\n\u4e0b\u9762\u8fd9\u6bb5\uff0c\u662f\u53e6\u5916\u4e00\u4e2a\u4ee3\u7801\uff0c\u4f46\u6211\u4e0d\u77e5\u9053\u600e\u4e48\u4f7f\u7528\uff0c\u61c2\u4ee3\u7801\u7684\u540c\u5b66\u8bf7\u5728\u8bc4\u8bba\u533a\u7559\u8a00<\/h4>\n\n\n\nfunction iepress_commentonly_shortcode( $atts, $content ){\n\t\/\/ set some default values\n\t\t$display_message = __( 'You Must be Logged in and Commented to view this content,', 'iepress' );\n\t\t$logined_message = __( 'You Must be Commented to view this content,', 'iepress' );\n\t\t$link = wp_login_url( get_permalink() );\n\t\t$linktext = __( 'Register or Login Here', 'iepress' );\n\t\t$commenttext = __( 'Comment Here', 'iepress' );\n\t\t\n\t\t$atts = shortcode_atts(\n\t\t\tarray(\n\t\t\t\t'display' => $display_message,\n\t\t\t\t'logined'=> $logined_message,\n\t\t\t\t'linkto' => $link,\n\t\t\t\t'linktext' => $linktext,\n\t\t\t\t'commenttext' =>$commenttext,\n\t\t\t),\n\t\t\t$atts\n\t\t);\n\t\t\n\tif( !is_null( $content ) ) : if(!is_user_logged_in()){ \n\t$content = '' . $atts['display'] . '<a class=\"wpu-login-btn\" href=\" '. $atts['linkto'] . ' \" title=\"'. $atts['linktext'] . '\">'. $atts['linktext'] . '<\/a>';\n\t\n\t}else{ \n\tglobal $post;\n\t $user_id = get_current_user_ID();\n\t if( $user_id != $post->post_author && !user_can($user_id,'edit_others_posts') ){\n\t\t$comments = get_comments( array('status' => 'approve', 'user_id' => get_current_user_ID(), 'post_id' => $post->ID, 'count' => true ) );\n\t\t if(!$comments) {\n\t\t\t $content = '' . $atts['logined'] . '<a class=\"wpu-login-btn\" href=\" '.get_comments_link().' \" title=\"'. $atts['commenttext'] . '\">'. $atts['commenttext'] . '<\/a>';\n\t\t\t }\n\t\t}\n\t}endif;\n\treturn '<div class=\"memberonly\">'.$content.'<\/div>';\n}\nadd_shortcode( 'com', 'iepress_commentonly_shortcode' );<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"\u5b9e\u73b0\u9690\u85cfWordPress\u90e8\u5206\u5185\u5bb9\uff0c\u8ba9\u7528\u6237\u8bc4\u8bba\u53ef\u89c1\uff0c\u5982\u679c\u4f60\u8bbe\u7f6e\uff0c \u767b\u9646\u7528\u6237\u624d\u53ef\u4ee5\u8bc4\u8bba\uff0c\u8fd8\u53ef\u4ee5\u8fbe\u5230\u7528\u6237\u767b\u9646\u540e\u8bc4\u8bba\u53ef\u89c1\u7684\u6548\u679c\u3002\u8fd9\u4e00\u8282\u7684wordpress\u5f00\u53d1\u6559\u5927\u5bb6\u5982\u4f55\u5b9e\u73b0\u4e0a\u8ff0\u529f\u80fd<\/p>\n","protected":false},"author":1,"featured_media":14615,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[185,204],"collection":[],"class_list":["post-5914","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-wp-development"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.npc.ink\/wp-json\/wp\/v2\/posts\/5914"}],"collection":[{"href":"https:\/\/www.npc.ink\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.npc.ink\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.npc.ink\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.npc.ink\/wp-json\/wp\/v2\/comments?post=5914"}],"version-history":[{"count":0,"href":"https:\/\/www.npc.ink\/wp-json\/wp\/v2\/posts\/5914\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.npc.ink\/wp-json\/wp\/v2\/media\/14615"}],"wp:attachment":[{"href":"https:\/\/www.npc.ink\/wp-json\/wp\/v2\/media?parent=5914"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.npc.ink\/wp-json\/wp\/v2\/categories?post=5914"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.npc.ink\/wp-json\/wp\/v2\/tags?post=5914"},{"taxonomy":"collection","embeddable":true,"href":"https:\/\/www.npc.ink\/wp-json\/wp\/v2\/collection?post=5914"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}