The tag has no wiki summary.

learn more… | top users | synonyms (1)

2
votes
1answer
5k views

Custom page with variables in url. Nice url with add_rewrite_rule

Using WP3.1 I Have a custom page with a WP_Query and the query gets dynamic variables from the url. And i want safe variables and clean urls. Example: ...
14
votes
2answers
557 views

In Which Contexts are Plugins Responsible for Data Validation/Sanitization?

I want to make sure all of the data in my plugins/themes is handled securely before entering the database and before being output to the browser. My problem is that there are situations where the API ...
6
votes
2answers
2k views

What is the best way to sanitize data?

I've read several topics about this and different ppl have different views on the best practice. In terms of WP, how do I store data to DB the safest way? This is one insert I'm using now: ...
3
votes
1answer
742 views

What's the difference between esc_* functions?

I've read Professional WordPress and it says: esc_html function is used for scrubbing data that contains HTML. This function encodes special characters into their HTML entities esc_attr ...
2
votes
2answers
1k views

How to properly sanitize strings without $wpdb->prepare?

I'm working on an advanced search (which uses custom sql queries), and the query string is formed using variables. For example, if the person checks some options, only those conditions get added to ...
3
votes
1answer
503 views

esc_url removes white space. Can I change that to using '-'?

I'm using esc_url to sanitize my url. The only problem is that "my link" becomes "mylink". I wouldreally like it to become "my-link". Is there a way to change this?