Plugin Directory

Changeset 3480642


Ignore:
Timestamp:
03/11/2026 08:19:00 PM (3 weeks ago)
Author:
rankauthority
Message:

Release 1.0.30: Clear cache after updating post / page

Location:
rank-authority
Files:
9 added
2 edited

Legend:

Unmodified
Added
Removed
  • rank-authority/trunk/rank-authority.php

    r3479769 r3480642  
    44 * Plugin URI: https://rankauthority.com/plugins/rankauthority
    55 * Description: Secure API connector to publish posts / overwrite posts from the RA Dashboard to WordPress. Token reset now available to all administrators.
    6  * Version: 1.0.29
     6 * Version: 1.0.30
    77 * Author: Rank Authority
    88 * Author URI: https://rankauthority.com
     
    13491349    }
    13501350
     1351    /** Clear post/page cache so public view shows updated content immediately */
     1352    private function clear_post_cache($post_id) {
     1353        clean_post_cache($post_id);
     1354        if (function_exists('rocket_clean_post')) {
     1355            rocket_clean_post($post_id); // WP Rocket
     1356        }
     1357        if (function_exists('w3tc_pgcache_flush_post')) {
     1358            w3tc_pgcache_flush_post($post_id); // W3 Total Cache
     1359        } elseif (function_exists('w3tc_flush_post')) {
     1360            w3tc_flush_post($post_id);
     1361        }
     1362        do_action('litespeed_purge_post', $post_id); // LiteSpeed Cache
     1363        do_action('rank_authority_post_cache_cleared', $post_id);
     1364    }
     1365
    13511366    /** Publish post */
    13521367    public function publish_post($request) {
     
    16331648        $permalink = get_permalink($post_id);
    16341649
     1650        // Clear post cache so public view shows new content immediately
     1651        $this->clear_post_cache($post_id);
     1652
    16351653        // Build response with final schema when schema was stored
    16361654        $response = [
     
    17671785            return $updated_id;
    17681786        }
     1787
     1788        // Clear post cache so public view shows new content immediately
     1789        $this->clear_post_cache($updated_id);
    17691790
    17701791        // Update featured image if provided (by media ID)
  • rank-authority/trunk/readme.txt

    r3479769 r3480642  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 1.0.29
     7Stable tag: 1.0.30
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    137137
    138138== Changelog ==
     139
     140= 1.0.30 =
     141* PUT response now includes full updated content (title, content, excerpt, etc.)
     142* Auto-clear post cache after POST/PUT so public view shows new content immediately
     143* Supports WP Rocket, W3 Total Cache, LiteSpeed Cache; hook `rank_authority_post_cache_cleared` for custom cache plugins
    139144
    140145= 1.0.29 =
     
    315320== Upgrade Notice ==
    316321
     322= 1.0.30 =
     323PUT now returns full updated content and auto-clears cache so public view updates immediately without manual cache purge.
     324
    317325= 1.0.29 =
    318326New GET endpoint to fetch post/page content by ID. Use the same Bearer token to retrieve published, draft, and private content.
Note: See TracChangeset for help on using the changeset viewer.