Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7784309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:04:29+00:00 2026-06-01T20:04:29+00:00

When inserting an image via media uploader into a wordpress Post, is there a

  • 0

When inserting an image via media uploader into a wordpress Post, is there a way to know all the properties of that image the same way wp has global $post which shows all properties of the post it’s in?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:04:30+00:00Added an answer on June 1, 2026 at 8:04 pm

    Not sure if this is quite what you mean but a WP attachment (be it an image or any other type of uploaded media) is treated as a post. Therefore you can run get_posts to get an array of attachment objects that match your criteria. Then use a foreach loop to display whatever data you need from these objects e.g.:

    $args = array(
        'post_type' => 'attachment',
    );
    $attachments = get_posts($args);
    if ($attachments) {
        foreach ($attachments as $attachment) {
             echo apply_filters('the_title', $attachment->post_title);
             the_attachment_link($attachment->ID, false);
        }
    }
    

    You can also use any other parameters of the WP_Query class to build your query within get_posts and narrow down the attachements that you’re after – you will need to specify attachement as the post type though

    Resources you want to check out:

    http://codex.wordpress.org/Template_Tags/get_posts

    http://codex.wordpress.org/Function_Reference/the_attachment_link (also look at the related functions at the bottom)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP form that is inserting information into a database. It all
i am successfully inserting images into my jar file but all images go to
While inserting rows into SQL Server CE in WP7 I'm getting a SQLCeException that
I'm loading image tags via AJAX and inserting them with the conventional .html(content) function
I'm inserting some data into a div container via ajax. When its just straight
There's a gotcha when inserting img's dynamically via scripts. Take the following code to
Right I seem to be having a issue inserting a image into a database
I am inserting an image into a div container with css like this: .ft-folder-closed:before
When inserting copy into an HTML document I get from sources such as word
When inserting a row into a table with an auto increment primary key column,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.