1. Home
  2. Docs
  3. Function Reference
  4. Functions
  5. get_final_path()

get_final_path()

Return the file path of a Controller. This function takes Multisites and Child Themes into account.

Copy to Clipboard

Parameters

$folder

Folder if exists

$file

File path

$is_url

If true, return the URL instead of the file path (default false)

$is_relative

Whether to include directory or not (default false)

$is_multisites_ignored

Whether to ignore Multisite (default false)

$to_get_details

Whether to return file path details or just the path (default false)

Return

mixed

If $to_get_details is set to true, return an array:

Copy to Clipboard

If false, just return the file URI.

Example

Trying to find the mvc_front_something.class.php model. This will return /home/your_package/public_html/wp-content/themes/your_theme/mvc/models/mvc_front_something.class.php

Copy to Clipboard
Tags