Built-in data validation function for URLs

Use esc_url( $url ) for URLs that should be displayed and esc_url_raw( $url ) if the URL should be sent to the database. The first will replace bare ampersands & with &. The second is a wrapper for the first; it will just suppress the escaping of ampersands. Both functions will check the protocol. See … Read more

Restrict backend but allow to use post.php?action=delete&post=POSTID from front-end

This will allow you to access post.php and still restrict the back-end. You need have action, action name as delete, post key and value, and wpnonce kay and value. Otherwise, it will redirect you to homepage. function disable_wp_admin() { if ( ! is_admin() ) return; if ( current_user_can( ‘manage_options’ ) ) return; if (( current_user_can( … Read more

Front-end update_post_meta with ajax

You should check out this document on WordPress.org: http://codex.wordpress.org/AJAX_in_Plugins It gives you everything you need to create front-facing XHR functionality. Make sure to set a nopriv hook for those who aren’t logged in. http://codex.wordpress.org/AJAX_in_Plugins#Ajax_on_the_Viewer-Facing_Side Also the JS variable ajaxurl is only set on the backend. You will need to define that yourself on the front-end. … Read more

Frontend tagging for both default and custom post type in wordpress

Notice: completely update code after OP update answer. Assuming you want to update in front-end the taxonomy ‘post_tag’ (the standard tags) fro standard post and a taxonomy called ‘research-sections’ for a custom post type called ‘research’. Probably you have to put the form in both single.php and single-research.php and in both you have to some … Read more

wp_editor doesn’t work in front end area

You need to first define the $settings and the $editor_id and the $content variables. Then you can call wp_editor(). Something like this should work for you: // default settings $content=”This content gets loaded first.”; $editor_id = ‘my_frontend_editor’; $settings = array( ‘wpautop’ => true, // use wpautop? ‘media_buttons’ => true, // show insert/upload button(s) ‘textarea_name’ => … Read more