English 中文(简体)
可区分的“从Cache页起”在轮椅上发挥的具体作用
原标题:disable "Purge from Page Cache" for specific roles on w3-total-cache

总体而言,每个员额都有“从Cache页起”的能力。

“作者”角色的用户也可利用这一功能。 这丝毫不令人担心,如果只能在自己的职位上这样做的话。 但是,作为“作者”,你也可以在其他用户职位上这样做。

因此,是否有办法混淆不清,使特定用户群体无法这样做?

问题回答

这消除了所有角色之间的联系,使之发挥作用。 php

function remove_purge_from_page_cache_link($actions, $post){
  unset($actions[ pgcache_purge ]);

  return $actions;
}

add_filter( post_row_actions ,  remove_purge_from_page_cache_link ,1000,2);
add_filter( page_row_actions ,  remove_purge_from_page_cache_link ,1000,2);

To make it only remove for authors you ll want to use something like this

if (!current_user_can( publish_posts )) {
    unset($actions[ pgcache_purge ]);
}

你可以 t弄你想要的用户群体的逻辑。





相关问题
Write-though caching of large data sets in WCF?

We ve got a smart client that talks to a SQL Server database via WCF, displaying the entities in the database, and allowing the user to edit those entities. Some of the WCF calls return a large data ...

Clearing RSL in Cache

I have built a flex application which has a "main" project and it is assosciated with a few RSL s which are loaded and cached once i run my "main" application. The problem i am facing is that the ...

how to tell clicking "back" to load cache?

I would like for my site when someone clicks "Back" or "Forward" for the server to tell the browser to load the cache instead of reloading the entire page. I ve tested some headers and done research, ...

java plugin cache and dynamic IP host

I m trying to use Amazon S3 and Amazon Cloudfront CDN to deliver the jar files of my applet application. I m seeing several cache misses of my jars by the java plugin. This is a show-stopper for me, ...

Frequently Used metadata Hashmap

Are there any implementations of a static size hashtable that limits the entries to either the most recently or most frequently used metadata? I would prefer not to keep track of this information ...

PHP - Memcache - HTML Caching

I would like to create a caching system that will bypass some mechanisms in order to improve the performance. I have some examples: 1-) I have a dynamic PHP page that is updated every hour. The page ...

Performance of Sql subqueriesfunctions

I am currently working on a particularly complex use-case. Simplifying below :) First, a client record has a many-to-one relationship with a collection of services, that is, a single client may have ...

热门标签