Sanitizing a custom query’s clauses

I would suggest to think in this way: if I can not sanitize whole query (as you can not, what does sanitized mean? Is DELETE or DROP malicious or wanted query? Your plugin would have to be able to determinate the intended purpose of each query ant it is unreachable.), you can predict it’s content. … Read more

Notice: Undefined index: in options-framework.php

Most likely you have an undefined array index. You can check if the array index exists with isset() like this: if(isset($some_array[$some_index])){ } So check all your arrays in the options-framework.php file. You can try for example: if ( isset($option[‘type’]) && isset($input[$id]) && has_filter( ‘of_sanitize_’ . $option[‘type’] ) ) { $clean[$id] = apply_filters( ‘of_sanitize_’ . $option[‘type’], … Read more

Trouble creating custom sanitization function when uploading video files

validate_file doesn’t quite work the way you’re expecting it to – it checks if $file is in the allowed files array, not just its extension/mime type. You’re looking for wp_check_filetype. However, all that ultimately does is check the extension (i.e. it doesn’t read the headers of the file/ascertain the mime type otherwise). Unless you implement … Read more

Save selectlist value (taxonomy) in wp:wp_set_object_terms

solved it so: $part_brand = get_terms(‘brands’, ‘hide_empty=0′); <label for=”part_brand”>Бренд</label> <select name=”part_brand” id=’part_brand’> <option value=”” <?php **$brand_names = wp_get_object_terms($post->ID, ‘brands’);** if (!count($brand_names)) echo “selected”; ?>>None</option> <?php foreach($part_brand as $brand) { if (!is_wp_error($brand_names) && !empty($brand_names) && !strcmp($brand->slug, $brand_names[0]->slug)) echo “<option value=”” . $brand->slug . “” selected>” . $brand->name . “</option>\n”; else echo “<option value=”” . $brand->slug . … Read more

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