PHP code example of wvnderlab-agency / wp-disable-date-based-archives

1. Go to this page and download the library: Download wvnderlab-agency/wp-disable-date-based-archives library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wvnderlab-agency / wp-disable-date-based-archives example snippets


// disable the plugin functionality
add_filter( 'wvnderlab/disable-date-based-archives/enabled', '__return_false' );

// set the status code to 301 - Moved Permanently
add_filter( 'wvnderlab/disable-date-based-archives/status-code', fn() => 301 );
// set the status code to 302 - Found
add_filter( 'wvnderlab/disable-date-based-archives/status-code', fn() => 302 );
// set the status code to 307 - Temporary Redirect
add_filter( 'wvnderlab/disable-date-based-archives/status-code', fn() => 307 );
// set the status code to 308 - Permanent Redirect
add_filter( 'wvnderlab/disable-date-based-archives/status-code', fn() => 308 );
// set the status code to 410 - Gone
add_filter( 'wvnderlab/disable-date-based-archives/status-code', fn() => 410 );

// override the redirect URL
add_filter( 'wvnderlab/disable-date-based-archives/redirect_url', 'YOUR_REDIRECT_URL' );