cache-master icon indicating copy to clipboard operation
cache-master copied to clipboard

Support for custom post types

Open prakash4mail opened this issue 4 years ago • 3 comments

Hi @terrylinooo

I would like to request support for caching the custom post types (besides page & post which you have written in inc/class-cache-master.php line 147 & 148, for now, temp fix: i have manually edited them in my website). Not an expert but i guess in setting page while displaying you can query registered post types and then once settings are saved, then from the configuration you validate if current post type is flagged for cache or not, which you are already doing :) .

Hoping you would accept this feature request.

Thanks, prakash

prakash4mail avatar Dec 18 '21 16:12 prakash4mail

for other incase they are looking at this, you need to add slug name of your custom post types (example created via toolset plugin)

  1. cache-master/inc/admin/functions.php line: 51, add new line just " 'page' => __( 'page', 'cache-master' ), " : for statistics page to display when turned on
  2. wp-content/plugins/cache-master/inc/class-cache-master.php : line 148 : add 'cpt slug',
  3. cache-master/inc/admin/views/option_post_types.php : after line 19 'cpt' => __( 'cpt', 'cache-master' ), : so that you can see it in admin settings to enable caching of it. This is the most imp setting

prakash4mail avatar Dec 18 '21 17:12 prakash4mail

for other incase they are looking at this, you need to add slug name of your custom post types (example created via toolset plugin)

  1. cache-master/inc/admin/functions.php line: 51, add new line just " 'page' => __( 'page', 'cache-master' ), " : for statistics page to display when turned on
  2. wp-content/plugins/cache-master/inc/class-cache-master.php : line 148 : add 'cpt slug',
  3. cache-master/inc/admin/views/option_post_types.php : after line 19 'cpt' => __( 'cpt', 'cache-master' ), : so that you can see it in admin settings to enable caching of it. This is the most imp setting

This manual solution seems to work fine, I've just implemented point 2 and 3, cause of I dont use the stats. Anyway should be useful to have an automatic post type retrieve system, so the user can freely choose which Post Type cache and which not.

BTW Great work.

Hiutaky avatar Jul 07 '22 13:07 Hiutaky

I think my branch can solve your troubles. yannicklin-bugfixes-and-improvements-september-2022

image image

yannicklin avatar Sep 02 '22 09:09 yannicklin