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

  • SEARCH
  • Home
  • 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 7801283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:53:56+00:00 2026-06-02T00:53:56+00:00

This code: $_post = &get_post($post->ID); $classname = ($_post->iconsize[0] <= 128 ? ‘small’ : ”)

  • 0

This code:

 $_post = &get_post($post->ID); 
 $classname = ($_post->iconsize[0] <= 128 ? 'small' : '') . 'attachment'; 

sometimes produces this error:

[Sun Apr 15 08:51:35 2012] [error] [client 180.76.5.150] PHP Notice:  Undefined property: stdClass::$iconsize in /srv/www/virtual/myblog.com/htdocs/wp-content/themes/mimbo/attachment.php on line 8

I would like to modify the line to add the property_exists check on the property and default to ” if it doesn’t exist but am a little unfamiliar with the syntax dealing with properties. How would the line look?

  • 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-02T00:53:58+00:00Added an answer on June 2, 2026 at 12:53 am

    Just use isset:

    if(isset($_post->iconsize)) {
        // ...
    }
    

    So:

    <?php
    $_post = &get_post($post->ID);
    $classname = (isset($_post->iconsize) && $_post->iconsize[0] <= 128 ? 'small' : '') . 'attachment';
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Take this code: <?php if (isset($_POST['action']) && !empty($_POST['action'])) { $action = $_POST['action']; } if
i'm using this code to post to my application page: $page_info = $facebook->api(/344722062246773?fields=access_token); $attachment2
I've written this code to try and send a url as a post value
I have this code that works well: {livre:empty_name} $.ajax({ url: sent.php, type: post, dataType:
I try to update my profile image and use this code: $connection->post('account/update_profile_image', array('image' =>
If the user manually clicks the 'submit' button, i use this code: if (isset($_POST['submit_findall']))
I have this PHP code in a loop for every post on the admin
I have a problem with this is code: Set oXmlHTTP = CreateObject(Microsoft.XMLHTTP) oXmlHTTP.Open POST,
I've tried to move WCF to NetDataContractSerializer using the code in this post: http://lunaverse.wordpress.com/2007/05/09/remoting-using-wcf-and-nhibernate
This is my code that works perfectly to post one object to my server.

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.