English 中文(简体)
如何看待我 Press Admin Panel in my Plugin?
原标题:How Do I Detect A WordPress Admin Panel in my Plugin?

我在我的gin子中有两个事件。 其中一人为前辈。 另一组由行政小组管理。 两者都把同一功能称为一种特定情况,这又给屏幕留下了阴影。 我如何使这一职能明智,用言语说话,并发现它是否被装上前端与行政小组? 我不想在前端的屏幕上重复,但确实希望在行政小组上这样做。 现在,它赞同这两个方面,这不是我想要的东西。

Background

在前端(访问者看到的现场一侧),我拦截了头巾,并检查了:

( is_single() || is_page() || is_home() || is_archive() || is_category() || is_tag())

就行政小组而言,Im拦截了行政活动。 我试图拦截的是:*(a) 上面的 st,但从某种意义上讲,这似乎回答了友好社或某些问题,没有给我带来前端小组和行政小组之间的区别。

最佳回答

使用<代码>is_admin(),以便在Dash板或行政小组展示时发现。

此处记录的更有条件的标签:

问题回答

is_admin(>>,如果你身为管理人,但正在进入博客的头端页,则看来是真实的。 我也试图在显示或没有显示一个行政网页时发现我的原始数据,而is_admin(<>>/code>则未能按预期行事,这明显是因为我同时担任行政主管。





相关问题
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 ...