PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.1
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.1
16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 All 504 releases
jetpack / json-endpoints / jetpack / class.jetpack-json-api-translations-endpoint.php

class.jetpack-json-api-translations-endpoint.php in Jetpack – WP Security, Backup, Speed, & Growth 16.3-a.1, at json-endpoints/jetpack/class.jetpack-json-api-translations-endpoint.php

52 lines 979 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit( 0 );
5 }
6
7 /**
8 * Translations endpoint class.
9 *
10 * GET /sites/%s/translations
11 * POST /sites/%s/translations
12 * POST /sites/%s/translations/update
13 *
14 * @phan-constructor-used-for-side-effects
15 */
16 class Jetpack_JSON_API_Translations_Endpoint extends Jetpack_JSON_API_Endpoint {
17 /**
18 * Needed capabilities.
19 *
20 * @var array
21 */
22 protected $needed_capabilities = array( 'update_core', 'update_plugins', 'update_themes' );
23
24 /**
25 * The log.
26 *
27 * @var array
28 */
29 protected $log;
30
31 /**
32 * If we're successful.
33 *
34 * @var bool
35 */
36 protected $success;
37
38 /**
39 * API Endpoint.
40 *
41 * @return array
42 */
43 public function result() {
44 return array(
45 'translations' => wp_get_translation_updates(),
46 'autoupdate' => Jetpack_Options::get_option( 'autoupdate_translations', false ),
47 'log' => $this->log,
48 'success' => $this->success,
49 );
50 }
51 }
52