array( 'type' => 'object' ), 'shareable_slugs' => array( 'type' => 'array' ), 'shared_slugs' => array( 'type' => 'array' ), 'owners_by_module' => array( 'type' => 'object' ), ); } protected function required_input(): array { return array(); } protected function annotations(): array { return array( 'readonly' => true, 'destructive' => false, 'idempotent' => true ); } /** * @param array $input * @return array|WP_Error */ protected function run( array $input ) { $result = Module_Repository::get_sharing_settings(); if ( is_wp_error( $result ) ) { return $result; } $result['message'] = array() === $result['shared_slugs'] ? __( 'No Site Kit module is shared with any role, so only users with their own connected Google account can see this data.', 'acrossai-abilities-manager' ) : sprintf( /* translators: 1: number of shared modules, 2: number of shareable modules */ __( '%1$d of %2$d shareable Site Kit modules are shared with other roles.', 'acrossai-abilities-manager' ), count( $result['shared_slugs'] ), count( $result['shareable_slugs'] ) ); return $result; } }