| 1 | <?php |
||
| 7 | class Jetpack_Sync_Functions { |
||
| 8 | |||
| 9 | public static function get_modules() { |
||
| 13 | |||
| 14 | public static function get_taxonomies() { |
||
| 19 | |||
| 20 | public static function get_post_types() { |
||
| 21 | global $wp_post_types; |
||
| 22 | |||
| 23 | return $wp_post_types; |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Finds out if a site is using a version control system. |
||
| 28 | * @return bool |
||
| 29 | **/ |
||
| 30 | public static function is_version_controlled() { |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Returns true if the site has file write access false otherwise. |
||
| 41 | * @return bool |
||
| 42 | **/ |
||
| 43 | public static function file_system_write_access() { |
||
| 44 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
||
| 45 | require_once( ABSPATH . 'wp-admin/includes/file.php' ); |
||
| 46 | } |
||
| 47 | |||
| 48 | require_once( ABSPATH . 'wp-admin/includes/template.php' ); |
||
| 49 | |||
| 50 | $filesystem_method = get_filesystem_method(); |
||
| 51 | if ( $filesystem_method === 'direct' ) { |
||
| 52 | return true; |
||
| 53 | } |
||
| 54 | |||
| 55 | ob_start(); |
||
| 56 | $filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() ); |
||
| 57 | ob_end_clean(); |
||
| 58 | if ( $filesystem_credentials_are_stored ) { |
||
| 59 | return true; |
||
| 60 | } |
||
| 61 | |||
| 62 | return false; |
||
| 63 | } |
||
| 64 | |||
| 65 | public static function wp_version() { |
||
| 69 | } |