Nonce validation in REST API

In a headless WordPress setup where you are using JWT for authentication, the standard nonce mechanism provided by wp may not directly fit your needs, especially when dealing with preview functionality. The nonce generated by wp is typically tied to the users session, which is not compatible with JWT authentication. One approach to solve this … Read more

WordPress API V2 – filter and order by ACF field

You could consider using the rest_{$this->post_type}_query filter hook to modify the result of certain REST API queries. To not mess with existing API calls, you could look at using new query parameters that have not been used. Then, use these parameters in your filter. For example: GET /wp-json/wp/v2/crowdfunding?per_page=6&foo_parameter=bar function my_plugin_filter( $args, $request ) { if … Read more

WordPress – Contact Form 7 – Get uploaded file issue

Try this function my_custom_form_submission( $contact_form ) { $submission = WPCF7_Submission::get_instance(); if ( $submission ) { $data = $submission->get_posted_data(); $email = isset( $data[‘your-email’] ) ? sanitize_email( $data[‘your-email’] ) : ”; $phone=”Nincs megadva”; $lastname = isset( $data[‘your-name’] ) ? sanitize_text_field( $data[‘your-name’] ) : ”; $firstname = isset( $data[‘text-532’] ) ? sanitize_text_field( $data[‘text-532’] ) : ”; $companyname = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)