WordPress at Your Fingertips
function is not described


PageController::get_path_from_id() public WC 1.0

Returns the path from an ID.

{} It's a method of the class: PageController{}

No Hooks.


String. Path for the given ID, or the ID on lookup miss.


$PageController = new PageController();
$PageController->get_path_from_id( $id );
$id(string) (required)
ID to get path for.

Code of PageController::get_path_from_id() WC 6.1.1

public function get_path_from_id( $id ) {
	if ( isset( $this->pages[ $id ] ) && isset( $this->pages[ $id ]['path'] ) ) {
		return $this->pages[ $id ]['path'];
	return $id;