Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <pre style="margin-top: 100px"><?php
- // put test urls in variable below, one url per line
- // IMPORTANT! make sure that when you will paste this snippet into your file
- // there will be no spaces/tabs before and after every url
- $urls = "http://localhost/konrad/32beta1/translated-page/
- http://localhost/konrad/32beta1/pl/only-polish/
- http://localhost/konrad/32beta1/pl/hello-world/
- http://localhost/konrad/32beta1/hello-world/
- http://localhost/konrad/32beta1/pl/translated-page-pl/
- http://localhost/konrad/32beta1/mycpt/cpt-dupl/
- http://localhost/konrad/32beta1/pl/mycpt/cpt-dupl/
- http://localhost/konrad/32beta1/mycpt/some-cpt-en/
- http://localhost/konrad/32beta1/pl/mycpt/some-cpt-pl/
- http://localhost/konrad/32beta1/2014/05/
- http://localhost/konrad/32beta1/mycpt/";
- $urls = explode("\n", $urls);
- foreach ($urls as $url) {
- $getPostID = url_to_postid(trim($url));
- echo $url . " → ";
- echo $getPostID;
- echo "\n";
- }
- ?></pre>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement