Files
roi-theme/wp-content/plugins/wp-marketing-automations/compatibilities/rest/class-bwfan-compatibilities-with-password-protected.php
root a22573bf0b Commit inicial - WordPress Análisis de Precios Unitarios
- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 21:04:30 -06:00

38 lines
951 B
PHP
Executable File

<?php
/**
* Password Protected
* https://wordpress.org/plugins/password-protected/
*/
if ( ! class_exists( 'BWFAN_Compatibility_With_Password_Protected' ) ) {
class BWFAN_Compatibility_With_Password_Protected {
public function __construct() {
add_filter( 'password_protected_is_active', array( $this, 'bwfan_allow_rest_api_password_protected' ), 100 );
}
/**
* Allow Autonami and WooFunnels endpoints in rest calls
*
* @param $status
*
* @return false|mixed
*/
public function bwfan_allow_rest_api_password_protected( $status ) {
$rest_route = isset( $GLOBALS['wp']->query_vars['rest_route'] ) ? $GLOBALS['wp']->query_vars['rest_route'] : '';
if ( empty( $rest_route ) ) {
return $status;
}
if ( strpos( $rest_route, 'autonami' ) !== false || strpos( $rest_route, 'woofunnel' ) !== false ) {
return false;
}
return $status;
}
}
new BWFAN_Compatibility_With_Password_Protected();
}