English 中文(简体)
页: 1 对评论进行测试,以便我可以取消不必要的文字登记。
原标题:In Page or Post header: Test for comments so I can deregister unnecessary scripts

我的辛勤工作,以我的言语为主题的布道,而无需列入的 unre(wp_deregister_script)则是一个优先事项。

我收到一份评论编辑稿,但有时只需要列入(但总是需要贴在用户身上——我只读)。

My first attempt (in the header):

  if (!is_user_logged_in() AND !comments_open()) {
    wp_deregister_script( dialog );
    wp_deregister_script( editableComments );
  }

Now this is adequate, but the script still remains included unnecessarily for users who are quickly visiting a page or post and have nothing to edit.

www.un.org/Depts/DGACM/index_spanish.htm 我可以使用你的脑能。

访问者的评论条件是:

  • Has just submitted a comment (the page will refresh)
  • The visitor left comment, navigated away and returned to the page to edit

删除时间条件:只要该评论未经修改,就可以加以编辑(如果意见得到核准,便通过隐藏信条链条)。

www.un.org/Depts/DGACM/index_spanish.htm 我指的是......。

是否有办法测试提交评论的页面复读(请见者——或无法确定是否有任何持久性有机污染物数据使其回到网页)?

如果对网页/台站的任何评论都等待调制,则是否可迅速进行测试。

共同工作的人可能都够好。

想法?

最佳回答

我认为,我拟定了一个解决办法,以便放在头脑中。 php

$comments_count = wp_count_comments($post->ID);
if (!is_user_logged_in() AND ($post->comment_status ==  closed  OR $comments_count->moderated == 0)) {
  // if the visitor isn t logged in, and the comments are closed or there are no comments in moderation:
  wp_deregister_script( dialog );
  wp_deregister_script( editableComments );
}

这当然应该做得足够,只要我继续保持低温评论的数量(因为对该具体职位或网页的任何温和评论都意味着所有访客将获得包括的文字,而不仅仅是评论者)。

相关:

问题回答

暂无回答




相关问题
Wrap stray text in <p> tags

Wordpress issue.. how do I wrap stray text in P tags? Example: Before- <div class = "content"> <img src = "hello.jpg"/> <h1>Introduction</h1> Hello! this is ...

Using jQuery Plugins with Wordpress

Having a bit of trouble using jQuery plugins (Superfish, jQuery UI, etc) using Wordpress. Everything works fine in my plain non-Wordpress site, but Wordpress seems to conflict with JQuery. There must ...

WordPress Data Storage Efficiency

I ve been asked to review a WordPress plugin of sorts and try to find ways of making it faster. The premise of this plugin is basically to store a bunch of users and shifts and appointments and ...

Why can t I properly style a blockquote in Wordpress?

On the design I just created for my website, I have a blockquote styled with two quote images using the span technique in css: blockquote { background-image: url(images/openquote.jpg); background-...

How does the WordPress <!--nextpage--> tag actually work?

What happens? I m guessing that somehow the post or page is parsed before displaying, and then just split into two methods? I can t seem to find any documentation on how the underlying <?php ...

Wordpress Plug-ins: How-to add custom URL Handles

I m trying to write a Wordpress Plug-in but can t seem to figure out how you would modify how a URL gets handled, so for example: any requests made for: <url>/?myplugin=<pageID> will ...

热门标签