Support

Account

Home Forums General Issues Issue with post object and if/else Reply To: Issue with post object and if/else

  • Thanks, @gummiforweb; here’s the var_dump:
    object(WP_Post)#3438 (24) { ["ID"]=> int(96) ["post_author"]=> string(1) "4" ["post_date"]=> string(19) "2017-10-18 19:44:55" ["post_date_gmt"]=> string(19) "2017-10-18 19:44:55" ["post_content"]=> string(0) "" ["post_title"]=> string(20) "Announcement Pending" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(10) "pendingtba" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2017-10-18 19:45:44" ["post_modified_gmt"]=> string(19) "2017-10-18 19:45:44" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(58) "http://mytestingdomain.com/?post_type=location&p=96" ["menu_order"]=> int(0) ["post_type"]=> string(8) "location" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" }

    I see lots of stuff and honestly, I don’t really know what I’m looking for, but perhaps it’s no coincidence that the first thing in the list is the post number and id? That said, I do see the post title is showing correctly, so maybe instead of get_field I should try something that check’s the post title or ID?

    Actually that doesn’t make sense either, since I’m trying to use the post_object field on this post to figure out which related location post to pull info from. In other words, I can’t grab the post_title until I know which title I’m supposed to be looking for. Unless I’m missing something…Like I said before, I’m still pretty green with these PHP thingies so I certainly appreciate any help sorting through my mess here!