Skip to content

Instantly share code, notes, and snippets.

@richaber
Created June 27, 2022 15:23
Show Gist options
  • Save richaber/4df2e4935798ed7ce3ab429616cda2b1 to your computer and use it in GitHub Desktop.
Save richaber/4df2e4935798ed7ce3ab429616cda2b1 to your computer and use it in GitHub Desktop.
wp_upload_dir() example var dump

Array shape returned by wp_upload_dir().

https://developer.wordpress.org/reference/functions/wp_upload_dir/

<?php

$upload_dir = wp_upload_dir();

$upload_dir = [
    'path'    => '/Users/username/Local/sitename/app/public/wp-content/uploads/2022/06',
    'url'     => 'https://sitename.local/wp-content/uploads/2022/06',
    'subdir'  => '/2022/06',
    'basedir' => '/Users/username/Local/sitename/app/public/wp-content/uploads',
    'baseurl' => 'https://sitename.local/wp-content/uploads',
    'error'   => false,
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment