Uploading avatar from the frontend

You only need to of these hooks show_user_profile to show the extra fields and personal_options_update to update, try: <?php ob_start(); include_once(“../../../wp-load.php”); get_header(); /* Get user info. */ global $current_user, $wp_roles; get_currentuserinfo(); /* Load the registration file. */ require_once( ABSPATH . WPINC . ‘/registration.php’ ); /* If profile was saved, update profile. */ if ( ‘POST’ … Read more

Create front end link to save post (or unpublish post) as draft

You can use wp_update_post() to change the status of a post. global $current_user; get_currentuserinfo(); $post_id = $_GET[‘post_id’]; $the_post = get_post( $post_id ); if ( $the_post->post_author == $current_user->ID && $the_post ) { $the_post->post_status=”draft”; wp_update_post( $the_post ); } Use wp_insert_post() with post_status => ‘draft’ to save a post.

Saving and displaying content on front end with wp_editor

You want to submit the data to admin_post_(action) and then handle the request. You may need jQuery to intercept the click and supply all the required data, but this shows you the main parts. HTML <form action=”http://www.example.com/wp-admin/admin-post.php” method=”post”> <input type=”hidden” name=”action” value=”add_foobar”> <input type=”hidden” name=”data” value=”foobarid”> <input type=”submit” value=”Submit”> </form> PHP add_action( ‘admin_post_foobar’, ‘prefix_admin_foobar’ ); … Read more

Add frontend “Restore” link

From your comment above, I believe you’re running into issues with the _wpnonce piece of the puzzle. Looking at the code in /wp-admin/post.php, it appears that the untrash instruction is checking for a valid WordPress nonce, and not getting one. This might do the trick: <?php function wpse_95348_undelete_post( $post_id ) { // no post? if( … 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

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