Admin page: form with enctype=”multipart/form-data” does not transfer its data

If you want to upload in a custom folder you can use the following function. Add the function in functions.php function upload_user_file( $file = array(),$path ) { if(!empty($file)) { $upload_dir=$path; $uploaded=move_uploaded_file($file[‘tmp_name’], $upload_dir.$file[‘name’]); if($uploaded) { echo “uploaded successfully “; }else { echo “some error in upload ” ;print_r($file[‘error’]); } } } Make a form in your … Read more

How can I process xml file on upload?

I solved my problem with lots and lots of testing things out. Apparently my FormData Object was not correct. Doing these changes to my code worked: $(‘#xml’).on(‘submit’, function(e) { e.preventDefault(); var form_data = new FormData(this); form_data.append(‘action’, ‘calculate_xml’); $.ajax({ url : ajaxurl, type: “POST”, data : form_data, processData: false, cache: false, contentType: false, success:function(response){ $(‘#response’).html(response); }, … Read more

ACF attachment custom field in rest response

Check out ACF to REST API – https://github.com/airesvsg/acf-to-rest-api You can optionally turn on/off which fields you want to enable. // Enable the option show in rest add_filter( ‘acf/rest_api/field_settings/show_in_rest’, ‘__return_true’ ); // Enable the option edit in rest add_filter( ‘acf/rest_api/field_settings/edit_in_rest’, ‘__return_true’ );

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