Function for generating a page url?
-
Is there a function that would generate the url of a page? I would like it to accept the page title as a parameter and have it return the url for the page, taking into account whether or not “pretty permalinks” are being used.
For example:
<?php echo mystery_func('my_page_title'); //#=> https://localhost/?page_id=55 ?>
I saw the get_page_by_title function in the Codex, but it returns an object and I can’t find where its methods/attributes are documented. Also, I saw the get_page_uri function but that just returns the page title given a page_id.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Function for generating a page url?’ is closed to new replies.