Discussion:
value of $ID in wp-includes\post.php
Utkarsh Dixit
2014-02-10 13:21:21 UTC
Permalink
Hi,

In wordpress version 3.8 the file wp-includes\post.php in function
wp_insert_post() there are lines around 2727 - 2728

if ( ! empty( $ID ) )
{
.....
}

The variable $ID what does it denote here and where is it defined?
Madalin Ignisca
2014-02-10 13:36:45 UTC
Permalink
That variable exists if it is an already post and is created from
the $postarr array on extraction. It would be the ID of an existing post if
it is the case.
Post by Utkarsh Dixit
Hi,
In wordpress version 3.8 the file wp-includes\post.php in function
wp_insert_post() there are lines around 2727 - 2728
if ( ! empty( $ID ) )
{
.....
}
The variable $ID what does it denote here and where is it defined?
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
--
*Madalin Ignisca*
*web developer*
http://imadalin.ro/
Utkarsh Dixit
2014-02-10 13:53:37 UTC
Permalink
In which file (and function) is the $postarr extracted and its value
assigned to $ID. What if its a new post? What will be the value of $ID then
be?


On Mon, Feb 10, 2014 at 7:06 PM, Madalin Ignisca
Post by Madalin Ignisca
That variable exists if it is an already post and is created from
the $postarr array on extraction. It would be the ID of an existing post if
it is the case.
Post by Utkarsh Dixit
Hi,
In wordpress version 3.8 the file wp-includes\post.php in function
wp_insert_post() there are lines around 2727 - 2728
if ( ! empty( $ID ) )
{
.....
}
The variable $ID what does it denote here and where is it defined?
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
--
*Madalin Ignisca*
*web developer*
http://imadalin.ro/
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Madalin Ignisca
2014-02-10 14:02:19 UTC
Permalink
Line 2719 in posts.php, just above the lines you asked about it.

If empty, it doesn't matter, status becomes new, check line 2742.

You should read the full function as it's pretty selfexplanetory.
Post by Utkarsh Dixit
In which file (and function) is the $postarr extracted and its value
assigned to $ID. What if its a new post? What will be the value of $ID then
be?
On Mon, Feb 10, 2014 at 7:06 PM, Madalin Ignisca
Post by Madalin Ignisca
That variable exists if it is an already post and is created from
the $postarr array on extraction. It would be the ID of an existing post
if
Post by Madalin Ignisca
it is the case.
On Mon, Feb 10, 2014 at 3:21 PM, Utkarsh Dixit <
Post by Utkarsh Dixit
Hi,
In wordpress version 3.8 the file wp-includes\post.php in function
wp_insert_post() there are lines around 2727 - 2728
if ( ! empty( $ID ) )
{
.....
}
The variable $ID what does it denote here and where is it defined?
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
--
*Madalin Ignisca*
*web developer*
http://imadalin.ro/
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
--
*Madalin Ignisca*
*web developer*
http://imadalin.ro/
Utkarsh Dixit
2014-02-10 14:04:58 UTC
Permalink
Thanks.


On Mon, Feb 10, 2014 at 7:32 PM, Madalin Ignisca
Post by Madalin Ignisca
Line 2719 in posts.php, just above the lines you asked about it.
If empty, it doesn't matter, status becomes new, check line 2742.
You should read the full function as it's pretty selfexplanetory.
Post by Utkarsh Dixit
In which file (and function) is the $postarr extracted and its value
assigned to $ID. What if its a new post? What will be the value of $ID
then
Post by Utkarsh Dixit
be?
On Mon, Feb 10, 2014 at 7:06 PM, Madalin Ignisca
Post by Madalin Ignisca
That variable exists if it is an already post and is created from
the $postarr array on extraction. It would be the ID of an existing
post
Post by Utkarsh Dixit
if
Post by Madalin Ignisca
it is the case.
On Mon, Feb 10, 2014 at 3:21 PM, Utkarsh Dixit <
Post by Utkarsh Dixit
Hi,
In wordpress version 3.8 the file wp-includes\post.php in function
wp_insert_post() there are lines around 2727 - 2728
if ( ! empty( $ID ) )
{
.....
}
The variable $ID what does it denote here and where is it defined?
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
--
*Madalin Ignisca*
*web developer*
http://imadalin.ro/
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
--
*Madalin Ignisca*
*web developer*
http://imadalin.ro/
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Loading...