| @@ 49-68 (lines=20) @@ | ||
| 46 | * Returns true if the site has file write access false otherwise. |
|
| 47 | * @return string ( '1' | '0' ) |
|
| 48 | **/ |
|
| 49 | public static function file_system_write_access() { |
|
| 50 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
|
| 51 | require_once( ABSPATH . 'wp-admin/includes/file.php' ); |
|
| 52 | } |
|
| 53 | ||
| 54 | require_once( ABSPATH . 'wp-admin/includes/template.php' ); |
|
| 55 | ||
| 56 | $filesystem_method = get_filesystem_method(); |
|
| 57 | if ( $filesystem_method === 'direct' ) { |
|
| 58 | return 1; |
|
| 59 | } |
|
| 60 | ||
| 61 | ob_start(); |
|
| 62 | $filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() ); |
|
| 63 | ob_end_clean(); |
|
| 64 | if ( $filesystem_credentials_are_stored ) { |
|
| 65 | return 1; |
|
| 66 | } |
|
| 67 | ||
| 68 | return 0; |
|
| 69 | } |
|
| 70 | } |
|
| @@ 1044-1063 (lines=20) @@ | ||
| 1041 | * Returns true if the site has file write access false otherwise. |
|
| 1042 | * @return string ( '1' | '0' ) |
|
| 1043 | **/ |
|
| 1044 | public static function file_system_write_access() { |
|
| 1045 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
|
| 1046 | require_once( ABSPATH . 'wp-admin/includes/file.php' ); |
|
| 1047 | } |
|
| 1048 | ||
| 1049 | require_once( ABSPATH . 'wp-admin/includes/template.php' ); |
|
| 1050 | ||
| 1051 | $filesystem_method = get_filesystem_method(); |
|
| 1052 | if ( $filesystem_method === 'direct' ) { |
|
| 1053 | return 1; |
|
| 1054 | } |
|
| 1055 | ||
| 1056 | ob_start(); |
|
| 1057 | $filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() ); |
|
| 1058 | ob_end_clean(); |
|
| 1059 | if ( $filesystem_credentials_are_stored ) { |
|
| 1060 | return 1; |
|
| 1061 | } |
|
| 1062 | return 0; |
|
| 1063 | } |
|
| 1064 | ||
| 1065 | /** |
|
| 1066 | * Finds out if a site is using a version control system. |
|