it was just missing $upload_dir['path'] . "https://wordpress.stackexchange.com/" . $upload_file_name
in
$uploaded_file['attach_id'] = wp_insert_attachment($attachment, $upload_dir['path'] . "https://wordpress.stackexchange.com/" . $upload_file_name);
require_once(ABSPATH . 'wp-admin/includes/image.php');
//Generate the metadata for the attachment, and update the database record.
$attach_data = wp_generate_attachment_metadata($uploaded_file['attach_id'], $upload_dir['path'] . "https://wordpress.stackexchange.com/" . $upload_file_name);
Related Posts:
- How can i force Display names to be the same as Usernames?
- Average Account Age
- Auto populate a user custom field from another user custom field
- Get all user meta_keys and then group users by matching values
- Where the Nickname is being used in WordPress
- How to get user-meta from Social Login registered users?
- How to create custom LOGIN and REGISTRATION forms?
- delete_user_meta Delete one value out of array
- Will WordPress username displayed somewhere in the site?
- Displaying a Welcome Message to a Woocommerce User
- update_user_meta add value on the top on existing value
- How to keep users unique id stored in session in addition to IP in WordPress plugin?
- WordPress Central User Database
- wp_set_auth_cookie causes 403 error in the wooCommerce checkout
- Custom User meta field display
- How to create multiple users at once?
- Shortcode to update user meta
- WordPress /users/me endpoint request forbidden
- Linking form to user meta fields
- User updating their profile wipes my custom fields
- How To Export User’s Custom Fields in CSV or XLSX
- Searchable Semi Random Number Generator on User Profiles
- User / membership Plugin [closed]
- Confusing problem with displaying message recipient metadata
- Users Ultra: Hide asterisk for required registration fields?
- Need help getting a certain value out of a multi dimensional array
- User register hook can’t access form request
- Create Unique and Customized User ID for Website Members in WordPress
- Issues with creating user profile for a subscriber, but with different profile page and functionalities
- Adding fields to the “Add New User” screen in the dashboard
- Is there a way (plugin?) to restrict a user to being able to edit just one page?
- Keep one user logged for a year?
- How to get users by a custom field / by user meta data?
- How do you add a custom option to user data?
- Show User Their Password
- generate unique number when registering a user
- How to turn off email you receive when registered?
- Removing WordPress Plugin Menu Item for a specific user
- How WordPress autosave can save plugin fields?
- Plugin allowing for artists, events and venues
- How to remove duplicate Custom Fields?
- Make the checkbox meta field checked by default
- Set user ID at time of wp_create_user
- Reset WordPress website
- Auto delete WordPress users according to time
- How to associate more than one user to a post?
- Saving Custom Post types and fields to a custom table
- WordPress Registration Email by Role
- How to create user groups and allow custom posts and plugin modify/access to specific group?
- Assign / update custom field value for all posts (How can I assign only to posts without custom field value?)
- Create custom registration form for WordPress Multisite
- is there a way to link one of the field in ACF field group, to a field in a media attachment page? [closed]
- How to create an input field, and base the output on spreadsheet data? [closed]
- User registration
- Change label for registration Fields
- update_user_meta() misfires sometimes
- Redirect to another page using contact form 7? [closed]
- edit_user_profile and show_user_profile are not firing inside a class
- Every new post/draft has a custom field variable “yst_is_cornerstone” showing
- How to get all posts belongs to a user between a certain date
- Specific way to allow WordPress users to view their current password? And edit it?
- Sticky option for custom post types without using custom fields or plugins
- How to add fields in custom registration form, validate it and aave to db? [closed]
- check for duplicate user meta data before updating
- Search users with custom meta data
- Add user meta after a user has registered and logged In [closed]
- how to make dynamic subdomain for each user registering?
- The add_action(‘register_form’) isn’t effecting my registration form
- How to add an extra, independent set of custom fields?
- Completely remove ability to create users?
- How can I add user profile fields to my mailpress mailout
- Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)
- need to find duplicated meta value in custom filed and view the posts that have the same value
- Help with autofilling field
- how to find out which plugin disable custom field for post
- Register PODS Custom Field with WPGraphQL [closed]
- Create multiple posts when a custom post is created
- Meta Key array building with multiple input values from fields
- Custom plugin issue – Notice: Trying to get property of non-object in
- Simulate Update User button click
- Saving data only when payment is successful
- Update User Meta Via Ajax
- User Following System
- Autofill advanced custom field with user data
- Storing data to database and user registration
- Modifying meta keys in User Meta Pro using user_meta_pre_user_register not working
- Problem with conditional woocommerce custom checkout field
- Paid Memberships Pro, Display User Limit
- Do something with thumbnail image on post publish
- Custom Widget not Available after Plugin Installation
- Private WordPress blog, requires user registration approval, and allowing users to login with OpenID
- WordPress Meta Query: Relation is not working correctly
- How can i do custom author list?
- Converting a themes featured image to WordPress featured image
- file upload user profile
- Integrating WordPress Content into a jQuery Slider
- Outputting custom field query from a plugin to the website header
- How to give different user access to different people?
- Share or sync user table data with another user table
- WordPress isn’t sending welcome email with the password reset