1 | <?php |
||
7 | class Jetpack_Sync_Functions { |
||
8 | |||
9 | public static function get_modules() { |
||
10 | require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-admin.php' ); |
||
11 | return Jetpack_Admin::init()->get_modules(); |
||
12 | } |
||
13 | |||
14 | public static function get_taxonomies() { |
||
15 | global $wp_taxonomies; |
||
16 | |||
17 | return $wp_taxonomies; |
||
18 | } |
||
19 | |||
20 | public static function get_post_types() { |
||
25 | |||
26 | public static function rest_api_allowed_post_types() { |
||
27 | /** This filter is already documented in class.json-api-endpoints.php */ |
||
30 | |||
31 | public static function rest_api_allowed_public_metadata() { |
||
35 | |||
36 | /** |
||
37 | * Finds out if a site is using a version control system. |
||
38 | * @return bool |
||
39 | **/ |
||
40 | public static function is_version_controlled() { |
||
48 | |||
49 | /** |
||
50 | * Returns true if the site has file write access false otherwise. |
||
51 | * @return bool |
||
52 | **/ |
||
53 | public static function file_system_write_access() { |
||
74 | |||
75 | public static function home_url() { |
||
76 | return self::preserve_scheme( 'home', home_url() ); |
||
77 | } |
||
78 | |||
79 | public static function site_url() { |
||
80 | return self::preserve_scheme( 'siteurl', site_url() ); |
||
81 | } |
||
82 | |||
83 | public static function main_network_site_url() { |
||
84 | return self::preserve_scheme( 'siteurl', network_site_url() ); |
||
85 | } |
||
86 | |||
87 | public static function preserve_scheme( $option, $current_url ) { |
||
88 | $option_url = get_option( $option ); |
||
89 | if ( $option_url === $current_url ) { |
||
90 | return $current_url; |
||
91 | } |
||
92 | $parsed_option_url = parse_url( $option_url ); |
||
93 | $parsed_current_url = parse_url( $current_url ); |
||
94 | if ( $parsed_current_url[ 'host' ] === $parsed_option_url[ 'host' ] ) { |
||
95 | return set_url_scheme( $current_url, $parsed_option_url['scheme'] ); |
||
96 | } |
||
97 | |||
98 | return $current_url; |
||
99 | } |
||
100 | |||
101 | public static function get_plugins() { |
||
102 | if ( ! function_exists( 'get_plugins' ) ) { |
||
103 | require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
||
104 | } |
||
105 | /** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */ |
||
106 | return apply_filters( 'all_plugins', get_plugins() ); |
||
107 | } |
||
108 | |||
109 | public static function wp_version() { |
||
113 | } |
||
114 |