Title: [Plugin: WP Cache Block] Plugin ignores different block names
Last modified: August 19, 2016

---

# [Plugin: WP Cache Block] Plugin ignores different block names

 *  [jarosz](https://wordpress.org/support/users/jarosz/)
 * (@jarosz)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-wp-cache-block-plugin-ignores-different-block-names/)
 * Hi, i wanted to use this plugin to cache few blocks on my page, but it doesn’t
   work as expected. I think this is a bug.
 * This is the code which in my template.
 *     ```
       <?php if (wp_cacheblock_start('block-1')): ?>
           foo
       <?php endif; wp_cacheblock_end(); ?>
       <?php if (wp_cacheblock_start('block-2')): ?>
           bar
       <?php endif; wp_cacheblock_end(); ?>
       ```
   
 * Expected result: foo bar
 * Actual result: foo foo
 * I think the purpose of block name is to avoid specyfying unique key for each 
   block, so this is my fix.
 * wp-cache-block:123
    change `$unique_key = '';` to `$unique_key = 'cb_'.$blockname;`
 * [http://wordpress.org/extend/plugins/wp-cache-block/](http://wordpress.org/extend/plugins/wp-cache-block/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [prettyboymp](https://wordpress.org/support/users/prettyboymp/)
 * (@prettyboymp)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-wp-cache-block-plugin-ignores-different-block-names/#post-1910984)
 * Thank you for the find. I’ve updated the plugin to fix this issue and another
   I found with the key length being to long when transients are used.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: WP Cache Block] Plugin ignores different block names’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-cache-block.svg)
 * [WP Cache Block](https://wordpress.org/plugins/wp-cache-block/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-cache-block/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-cache-block/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-cache-block/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-cache-block/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-cache-block/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [prettyboymp](https://wordpress.org/support/users/prettyboymp/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-wp-cache-block-plugin-ignores-different-block-names/#post-1910984)
 * Status: not resolved