QM_Util::standard_dir PHP Method

standard_dir() public static method

public static standard_dir ( $dir, $abspath_replace = null )
        public static function standard_dir($dir, $abspath_replace = null)
        {
            $dir = wp_normalize_path($dir);
            if (is_string($abspath_replace)) {
                if (!self::$abspath) {
                    self::$abspath = wp_normalize_path(ABSPATH);
                }
                $dir = str_replace(self::$abspath, $abspath_replace, $dir);
            }
            return $dir;
        }

Usage Example

Beispiel #1
0
 public function process()
 {
     global $template;
     $template_path = QM_Util::standard_dir($template);
     $stylesheet_directory = QM_Util::standard_dir(get_stylesheet_directory());
     $template_directory = QM_Util::standard_dir(get_template_directory());
     $template_file = str_replace(array($stylesheet_directory, $template_directory), '', $template_path);
     $template_file = ltrim($template_file, '/');
     $this->data['template_path'] = $template_path;
     $this->data['template_file'] = $template_file;
     $this->data['stylesheet'] = get_stylesheet();
     $this->data['template'] = get_template();
     if (isset($this->data['body_class'])) {
         asort($this->data['body_class']);
     }
 }
All Usage Examples Of QM_Util::standard_dir