warpenstein
Forum Replies Created
-
This has been fixed in version 2.2.3
Cannot reproduce.
Are you logged in as administrator? Is your ip address whitelisted?Forum: Plugins
In reply to: [Redirection] Redirection is not workingTry this:
Source URL: /http:/colorcubesstudio.com
Target URL: https://colorcubesstudio.comThis seems to work in version 2.2:
Hotfix:
1. Open password-protected.php in your plugins/password-protected/ folder.
2. Look at the end of the file around line 800
3. There is a function called “only_allow_logged_in_rest_access”, this function needs a modification
4. Look at the if-condition:if ( ! $this->is_user_logged_in() && ! is_user_logged_in() && ! (bool) get_option( 'password_protected_rest' ) ) { return new WP_Error( 'rest_cannot_access', __( 'Only authenticated users can access the REST API.', 'password-protected' ), array( 'status' => rest_authorization_required_code() ) ); }
Replace it with:
if ( (bool) get_option('password_protected_status') && ! $this->is_user_logged_in() && ! is_user_logged_in() && ! (bool) get_option( 'password_protected_rest' ) ) { return new WP_Error( 'rest_cannot_access', __( 'Only authenticated users can access the REST API.', 'password-protected' ), array( 'status' => rest_authorization_required_code() ) ); }
Done!
Explaination:
The rest api will be blocked always if the user isn’t logged in and the option to allow rest is not checked. Now, with the hotfix, the status checkbox to activate the plugin on the password protected option page needs also to be checked to block the api.Same problem here. I get “rest_cannot_access” (http status 401) when trying to submit a form on contact form 7. While Password Protected is enabled (the plugin itself) but not activated in the options of the plugin, it denies access to rest api even when no password is set and it says password protection is disabled.
This problem exists probably for any plugin using the rest api.Forum: Plugins
In reply to: [Contact form 7 TO API] Get responsePut all code like add_action() or add_filter() in the functions.php in your theme directory. Putting the code into a new plugin will also work.
Note to people using closures:
I tried using this hook by doing something like thisadd_action('after_qs_cf7_api_send_lead', function($result, $record) { // some code }
For some reason the $record argument isn’t available in the function. But if you do it like QuerySolutions did, it works. I’m not entirely sure why, maybe WordPress does not handle closures correctly.
Forum: Plugins
In reply to: [Contact form 7 TO API] Manipulate data before POSTHello, this may be an little late but I’m posting this anyway.
add_filter('qs_cf7_api_get_args', function($args) { $args['body']['email'] = '[email protected]'; return $args; });
$args[‘body’] contains all the form fields and “email” is the name of the field I defined in the CF7 form editor.