Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter jonesb

    (@jonesb)

    We can access it by using a url that points to the directory where it is uploaded to. It looks like it defaults to using the directory wp-content/uploads/dlm_uploads/. Does that make sense?

    Thread Starter jonesb

    (@jonesb)

    Thanks, but I think that refers to code that is called after $post_date_gmt has already been set to ‘0000-00-00 00:00:00’. In WP 4.9.7, it looks like the code in that ticket occurs on line 3282. The code I’m referring to occurs on line 3272.

    This is my first time looking at WordPress core code, and I don’t have that much experience with PHP, so I might be mistaken, but it looks like the following happens when calling wp_insert_post() with an ID of zero and no value for post_date and post_date_gmt (line numbers are from /wp-includes/post.php):
    1. $post_date is set to current_time(‘mysql’) on line 3251
    2. for a draft, $post_date_gmt is set to ‘0000-00-00 00:00:00’ on line 3276
    2a. for a published post, $post_date_gmt is set to get_gmt_from_date($post_date)
    3. $post_modified is set to $post_date on line 3286
    4. $post_modified_gmt is set to $post_date_gmt on line 3287
    5. $post_modified and $post_modified_gmt are passed through to the database at some later point.

    The issue I’m wondering about is in parts 2 and 2a above. Why is only the post_modified field set to the current date while the post_modified_gmt field is not?

    I hope that’s clear, and not too much information. And thanks again for your quick response.

    Thread Starter jonesb

    (@jonesb)

    sorry, i hadn’t read the forum rules. here’s a link to the php:
    http://pastebin.com/7bAY3yqU

Viewing 3 replies - 1 through 3 (of 3 total)