| @@ 1804-1815 (lines=12) @@ | ||
| 1801 | * @package GeoDirectory |
|
| 1802 | * @return mixed|void Returns max upload file size. |
|
| 1803 | */ |
|
| 1804 | function geodir_max_upload_size() |
|
| 1805 | {
|
|
| 1806 | $max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
|
|
| 1807 | ||
| 1808 | if ($max_filesize > 0 && $max_filesize < 1) {
|
|
| 1809 | $max_filesize = (int)($max_filesize * 1024) . 'kb'; |
|
| 1810 | } else {
|
|
| 1811 | $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb'; |
|
| 1812 | } |
|
| 1813 | /** Filter documented in geodirectory-functions/general_functions.php **/ |
|
| 1814 | return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
|
|
| 1815 | } |
|
| 1816 | } |
|
| 1817 | ||
| 1818 | ||
| @@ 1739-1756 (lines=18) @@ | ||
| 1736 | * @package GeoDirectory |
|
| 1737 | * @return string|void Max upload size. |
|
| 1738 | */ |
|
| 1739 | function geodir_max_upload_size() {
|
|
| 1740 | $max_filesize = (float) get_option( 'geodir_upload_max_filesize', 2 ); |
|
| 1741 | ||
| 1742 | if ( $max_filesize > 0 && $max_filesize < 1 ) {
|
|
| 1743 | $max_filesize = (int) ( $max_filesize * 1024 ) . 'kb'; |
|
| 1744 | } else {
|
|
| 1745 | $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb'; |
|
| 1746 | } |
|
| 1747 | ||
| 1748 | /** |
|
| 1749 | * Filter default image upload size limit. |
|
| 1750 | * |
|
| 1751 | * @since 1.0.0 |
|
| 1752 | * |
|
| 1753 | * @param string $max_filesize Max file upload size. Ex. 10mb, 512kb. |
|
| 1754 | */ |
|
| 1755 | return apply_filters( 'geodir_default_image_upload_size_limit', $max_filesize ); |
|
| 1756 | } |
|
| 1757 | ||
| 1758 | /** |
|
| 1759 | * Check if dummy folder exists or not. |
|