| 1 | $page_url = '/shop/';
|
|---|
| 2 | var_dump( url_to_postid( 'http://localhost' . $page_url ) );
|
|---|
| 3 | int(0)
|
|---|
| 4 | var_dump( get_page_by_path( $page_url ) );
|
|---|
| 5 | object(WP_Post)#11 (25) {
|
|---|
| 6 | ["ID"]=>
|
|---|
| 7 | int(38)
|
|---|
| 8 | ["post_author"]=>
|
|---|
| 9 | string(1) "1"
|
|---|
| 10 | ["post_date"]=>
|
|---|
| 11 | string(19) "2013-08-24 20:50:22"
|
|---|
| 12 | ["post_date_gmt"]=>
|
|---|
| 13 | string(19) "2013-08-24 20:50:22"
|
|---|
| 14 | ["post_content"]=>
|
|---|
| 15 | string(0) ""
|
|---|
| 16 | ["post_title"]=>
|
|---|
| 17 | string(4) "Shop"
|
|---|
| 18 | ["post_excerpt"]=>
|
|---|
| 19 | string(0) ""
|
|---|
| 20 | ["post_status"]=>
|
|---|
| 21 | string(7) "publish"
|
|---|
| 22 | ["comment_status"]=>
|
|---|
| 23 | string(6) "closed"
|
|---|
| 24 | ["ping_status"]=>
|
|---|
| 25 | string(4) "open"
|
|---|
| 26 | ["post_password"]=>
|
|---|
| 27 | string(0) ""
|
|---|
| 28 | ["post_name"]=>
|
|---|
| 29 | string(4) "shop"
|
|---|
| 30 | ["to_ping"]=>
|
|---|
| 31 | string(0) ""
|
|---|
| 32 | ["pinged"]=>
|
|---|
| 33 | string(0) ""
|
|---|
| 34 | ["post_modified"]=>
|
|---|
| 35 | string(19) "2013-08-24 20:50:22"
|
|---|
| 36 | ["post_modified_gmt"]=>
|
|---|
| 37 | string(19) "2013-08-24 20:50:22"
|
|---|
| 38 | ["post_content_filtered"]=>
|
|---|
| 39 | string(0) ""
|
|---|
| 40 | ["post_parent"]=>
|
|---|
| 41 | int(0)
|
|---|
| 42 | ["guid"]=>
|
|---|
| 43 | string(22) "http://localhost/shop/"
|
|---|
| 44 | ["menu_order"]=>
|
|---|
| 45 | int(0)
|
|---|
| 46 | ["post_type"]=>
|
|---|
| 47 | string(4) "page"
|
|---|
| 48 | ["post_mime_type"]=>
|
|---|
| 49 | string(0) ""
|
|---|
| 50 | ["comment_count"]=>
|
|---|
| 51 | string(1) "0"
|
|---|
| 52 | ["filter"]=>
|
|---|
| 53 | string(3) "raw"
|
|---|
| 54 | ["format_content"]=>
|
|---|
| 55 | NULL
|
|---|
| 56 | }
|
|---|