Get post attachment with post id

yes use this code here you can get attachment id if(isset($_FILES[‘myimage’]) && ($_FILES[‘myimage’][‘size’] > 0)) { // Get the type of the uploaded file. This is returned as “type/extension” $arr_file_type = wp_check_filetype(basename($_FILES[‘myimage’][‘name’])); $uploaded_file_type = $arr_file_type[‘type’]; // Set an array containing a list of acceptable formats $allowed_file_types = array(‘image/jpg’, ‘image/jpeg’, ‘image/gif’, ‘image/png’); if (in_array($uploaded_file_type, $allowed_file_types)) { … Read more

Append USER ID to an outbound link?

You should be able to use get_current_user_id(). Note that it will return ‘0’ if the user isn’t logged in. <a href=”https://example.com/?user_id=<?php echo get_current_user_id(); ?>”>Link</a> Update 2: Got bored, made a plugin: https://github.com/AndyMardell/append-user-id/releases/tag/v1.0.0-alpha Download the zip and install 🙂 Submitted to WordPress but it’s still under review. Installation and Usage: https://github.com/AndyMardell/append-user-id#installation Update: you won’t be able … Read more

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