Files
roi-theme/wp-content/plugins/wp-marketing-automations/compatibilities/rest/class-bwfan-compatibilities-with-force-login.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

34 lines
898 B
PHP
Executable File

<?php
/**
* Force Login
* https://wordpress.org/plugins/wp-force-login/
*/
if ( ! class_exists( 'BWFAN_Compatibility_With_Force_Login' ) ) {
class BWFAN_Compatibility_With_Force_Login {
public function __construct() {
add_filter( 'rest_jsonp_enabled', array( $this, 'bwfan_allow_rest_apis_with_force_login' ), 100 );
}
/**
* Allow Autonami and WooFunnels endpoints in rest calls
*
* @param $status
*
* @return mixed
*/
public function bwfan_allow_rest_apis_with_force_login( $status ) {
$rest_route = $GLOBALS['wp']->query_vars['rest_route'];
if ( false !== strpos( $rest_route, 'autonami' ) || false !== strpos( $rest_route, 'woofunnel' ) || false !== strpos( $rest_route, 'funnelkit' ) ) {
remove_filter( 'rest_authentication_errors', 'v_forcelogin_rest_access', 99 );
}
return $status;
}
}
new BWFAN_Compatibility_With_Force_Login();
}