This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a custom sitemap with the lastest n posts, and updates it after saving a post. | |
// Useful for big sites. | |
// Writes an xml file in the root level of the wp install: https://example/my-custom-sitemap.xml | |
add_action( "save_post", "wpr_create_custom_sitemap" ); | |
function wpr_create_custom_sitemap() { | |
if ( str_replace( '-', '', get_option( 'gmt_offset' ) ) < 0 ) { | |
$tempo = '-0' . str_replace( '-', '', get_option( 'gmt_offset' ) ); | |
} else { | |
$tempo = get_option( 'gmt_offset' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WP Rocket | Remove Post URLs from purge based on strings | |
* Description: Removes URLs from WP Rocket’s automatic cache purging based on a partial string match. | |
* Author: WP Rocket Support Team | |
* Author URI: http://wp-rocket.me/ | |
* License: GNU General Public License v2 or later | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
* | |
*/ |