Uploading PDF files from the front-end

I have done a simple function for that, but i allow all types of media. So this could be a start: function insert_attachment( $file_handler, $post_id, $settpdf=”false” ) { // check to make sure its a successful upload if ( $_FILES[$file_handler][‘error’] !== UPLOAD_ERR_OK ) __return_false(); require_once( ABSPATH . ‘wp-admin’ . ‘/includes/image.php’ ); require_once( ABSPATH . ‘wp-admin’ … Read more

Get all media files for current author

Media are just posts – so just query posts. This is untested: $args = array( ‘author’ => $author_id, ‘post_type’ => ‘attachment’, ); $query = new WP_Query( $args ); I’m not sure if you want currently logged in user or the author of the post currently in the loop – either way you can set $author_id … Read more

Front-end CSS Library for plugin [closed]

Achieving unaltered style via plugin for multiple themes is pretty difficult to achieve. How about this? Use any library among these e.g. Bootstrap in your plugin and then remove/comment the global properties from them. Since you will be author of the plugin, you can repeat the same thing in your plugin before releasing next update.

Why insert post function do not set the modified author without administrator panel?

the_modified_author() displays the name of the user whose ID has been stored in the _edit_last post meta field. If you want to update the ID after another user has updated the post, you can use something like update_post_meta( $post_ID, ‘_edit_last’, get_current_user_id() );. Then the new user’s name will be displayed when using the_modified_author(). Replace get_current_user_id() … Read more

Front end ajax user login session issue

You are not setting an authentication cookie. The second parameter of the wp_signon function is set to false. This function sets an authentication cookie. Users will not be logged in if it is not sent. $user_signon = wp_signon( $info, true ); That should give you the result you desire

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