>3 年之前 css-selection.js 77628cf8bf first comm 3 年之前 css-shapes.js 77628cf8bf first comm 3 年之前 css-snappoints.js 77628cf8bf first comm 3 年之前 css-sticky.js 77628cf8bf first comm 3 年之前 css-subgrid.js 77628cf8bf first comm 3 年之前 css-supports-api.js 77628cf8bf first comm 3 年之前 css-table.js 77628cf8bf first comm 3 年之前 css-text-align-last.js 77628cf8bf first comm 3 年之前 css-text-box-trim.js 77628cf8bf first comm 3 年之前 css-text-indent.js 77628cf8bf first comm 3 年之前 css-text-justify.js 77628cf8bf first comm 3 年之前 css-text-orientation.js 77628cf8bf first comm 3 年之前 css-text-spacing.js 77628cf8bf first comm 3 年之前 css-textshadow.js 77628cf8bf first comm 3 年之前 css-touch-action.js 77628cf8bf first comm 3 年之前 css-transitions.js 77628cf8bf first comm 3 年之前 css-unicode-bidi.js 77628cf8bf first comm 3 年之前 css-unset-value.js 77628cf8bf first comm 3 年之前 css-variables.js 77628cf8bf first comm 3 年之前 css-when-else.js 77628cf8bf first comm 3 年之前 css-widows-orphans.js 77628cf8bf first comm 3 年之前 css-width-stretch.js 77628cf8bf first comm 3 年之前 css-writing-mode.js 77628cf8bf first comm 3 年之前 css-zoom.js 77628cf8bf first comm 3 年之前 css3-attr.js 77628cf8bf first comm 3 年之前 css3-boxsizing.js 77628cf8bf first comm 3 年之前 css3-colors.js 77628cf8bf first comm 3 年之前 css3-cursors-grab.js 77628cf8bf first comm 3 年之前 css3-cursors-newer.js 77628cf8bf first comm 3 年之前 css3-cursors.js 77628cf8bf first comm 3 年之前 css3-tabsize.js 77628cf8bf first comm 3 年之前 currentcolor.js 77628cf8bf first comm 3 年之前 custom-elements.js 77628cf8bf first comm 3 年之前 custom-elementsv1.js 77628cf8bf first comm 3 年之前 customevent.js 77628cf8bf first comm 3 年之前 datalist.js 77628cf8bf first comm 3 年之前 dataset.js 77628cf8bf first comm 3 年之前 datauri.js 77628cf8bf first comm 3 年之前 date-tolocaledatestring.js 77628cf8bf first comm 3 年之前 declarative-shadow-dom.js 77628cf8bf first comm 3 年之前 decorators.js 77628cf8bf first comm 3 年之前 details.js 77628cf8bf first comm 3 年之前 deviceorientation.js 77628cf8bf first comm 3 年之前 devicepixelratio.js 77628cf8bf first comm 3 年之前 dialog.js 77628cf8bf first comm 3 年之前 dispatchevent.js 77628cf8bf first comm 3 年之前 dnssec.js 77628cf8bf first comm 3 年之前 do-not-track.js 77628cf8bf first comm 3 年之前 document-currentscript.js 77628cf8bf first comm 3 年之前 document-evaluate-xpath.js 77628cf8bf first comm 3 年之前 document-execcommand.js 77628cf8bf first comm 3 年之前 document-policy.js 77628cf8bf first comm 3 年之前 document-scrollingelement.js 77628cf8bf first comm 3 年之前 documenthead.js 77628cf8bf first comm 3 年之前 dom-manip-convenience.js 77628cf8bf first comm 3 年之前 dom-range.js 77628cf8bf first comm 3 年之前 domcontentloaded.js 77628cf8bf first comm 3 年之前 dommatrix.js 77628cf8bf first comm 3 年之前 download.js 77628cf8bf first comm 3 年之前 dragndrop.js 77628cf8bf first comm 3 年之前 element-closest.js 77628cf8bf first comm 3 年之前 element-from-point.js 77628cf8bf first comm 3 年之前 element-scroll-methods.js 77628cf8bf first comm 3 年之前 eme.js 77628cf8bf first comm 3 年之前 eot.js 77628cf8bf first comm 3 年之前 es5.js 77628cf8bf first comm 3 年之前 es6-class.js 77628cf8bf first comm 3 年之前 es6-generators.js 77628cf8bf first comm 3 年之前 es6-module-dynamic-import.js 77628cf8bf first comm 3 年之前 es6-module.js 77628cf8bf first comm 3 年之前 es6-number.js 77628cf8bf first comm 3 年之前 es6-string-includes.js 77628cf8bf first comm 3 年之前 es6.js 77628cf8bf first comm 3 年之前 eventsource.js 77628cf8bf first comm 3 年之前 extended-system-fonts.js 77628cf8bf first comm 3 年之前 feature-policy.js 77628cf8bf first comm 3 年之前 fetch.js 77628cf8bf first comm 3 年之前 fieldset-disabled.js 77628cf8bf first comm 3 年之前 fileapi.js 77628cf8bf first comm 3 年之前 filereader.js 77628cf8bf first comm 3 年之前 filereadersync.js 77628cf8bf first comm 3 年之前 filesystem.js 77628cf8bf first comm 3 年之前 flac.js 77628cf8bf first comm 3 年之前 flexbox-gap.js 77628cf8bf first comm 3 年之前 flexbox.js 77628cf8bf first comm 3 年之前 flow-root.js 77628cf8bf first comm 3 年之前 focusin-focusout-events.js 77628cf8bf first comm 3 年之前 font-family-system-ui.js 77628cf8bf first comm 3 年之前 font-feature.js 77628cf8bf first comm 3 年之前 font-kerning.js 77628cf8bf first comm 3 年之前 font-loading.js 77628cf8bf first comm 3 年之前 font-size-adjust.js 77628cf8bf first comm 3 年之前 font-smooth.js 77628cf8bf first comm 3 年之前 font-unicode-range.js 77628cf8bf first comm 3 年之前 font-variant-alternates.js 77628cf8bf first comm 3 年之前 font-variant-numeric.js 77628cf8bf first comm 3 年之前 fontface.js 77628cf8bf first comm 3 年之前 form-attribute.js 77628cf8bf first comm 3 年之前 form-submit-attributes.js 77628cf8bf first comm 3 年之前 form-validation.js 77628cf8bf first comm 3 年之前 forms.js 77628cf8bf first comm 3 年之前 fullscreen.js 77628cf8bf first comm 3 年之前 gamepad.js 77628cf8bf first comm 3 年之前 geolocation.js 77628cf8bf first comm 3 年之前 getboundingclientrect.js 77628cf8bf first comm 3 年之前 getcomputedstyle.js 77628cf8bf first comm 3 年之前 getelementsbyclassname.js 77628cf8bf first comm 3 年之前 getrandomvalues.js 77628cf8bf first comm 3 年之前 gyroscope.js 77628cf8bf first comm 3 年之前 hardwareconcurrency.js 77628cf8bf first comm 3 年之前 hashchange.js 77628cf8bf first comm 3 年之前 heif.js 77628cf8bf first comm 3 年之前 hevc.js 77628cf8bf first comm 3 年之前 hidden.js 77628cf8bf first comm 3 年之前 high-resolution-time.js 77628cf8bf first comm 3 年之前 history.js 77628cf8bf first comm 3 年之前 html-media-capture.js 77628cf8bf first comm 3 年之前 html5semantic.js 77628cf8bf first comm 3 年之前 http-live-streaming.js 77628cf8bf first comm 3 年之前 http2.js 77628cf8bf first comm 3 年之前 http3.js 77628cf8bf first comm 3 年之前 iframe-sandbox.js 77628cf8bf first comm 3 年之前 iframe-seamless.js 77628cf8bf first comm 3 年之前 iframe-srcdoc.js 77628cf8bf first comm 3 年之前 imagecapture.js 77628cf8bf first comm 3 年之前 ime.js 77628cf8bf first comm 3 年之前 img-naturalwidth-naturalheight.js 77628cf8bf first comm 3 年之前 import-maps.js 77628cf8bf first comm 3 年之前 imports.js 77628cf8bf first comm 3 年之前 indeterminate-checkbox.js 77628cf8bf first comm 3 年之前 indexeddb.js 77628cf8bf first comm 3 年之前 indexeddb2.js 77628cf8bf first comm 3 年之前 inline-block.js 77628cf8bf first comm 3 年之前 innertext.js 77628cf8bf first comm 3 年之前 input-autocomplete-onoff.js 77628cf8bf first comm 3 年之前 input-color.js 77628cf8bf first comm 3 年之前 input-datetime.js 77628cf8bf first comm 3 年之前 input-email-tel-url.js 77628cf8bf first comm 3 年之前 input-event.js 77628cf8bf first comm 3 年之前 input-file-accept.js 77628cf8bf first comm 3 年之前 input-file-directory.js 77628cf8bf first comm 3 年之前 input-file-multiple.js 77628cf8bf first comm 3 年之前 input-inputmode.js 77628cf8bf first comm 3 年之前 input-minlength.js 77628cf8bf first comm 3 年之前 input-number.js 77628cf8bf first comm 3 年之前 input-pattern.js 77628cf8bf first comm 3 年之前 input-placeholder.js 77628cf8bf first comm 3 年之前 input-range.js 77628cf8bf first comm 3 年之前 input-search.js 77628cf8bf first comm 3 年之前 input-selection.js 77628cf8bf first comm 3 年之前 insert-adjacent.js 77628cf8bf first comm 3 年之前 insertadjacenthtml.js 77628cf8bf first comm 3 年之前 internationalization.js 77628cf8bf first comm 3 年之前 intersectionobserver-v2.js 77628cf8bf first comm 3 年之前 intersectionobserver.js 77628cf8bf first comm 3 年之前 intl-pluralrules.js 77628cf8bf first comm 3 年之前 intrinsic-width.js 77628cf8bf first comm 3 年之前 jpeg2000.js 77628cf8bf first comm 3 年之前 jpegxl.js 77628cf8bf first comm 3 年之前 jpegxr.js 77628cf8bf first comm 3 年之前 js-regexp-lookbehind.js 77628cf8bf first comm 3 年之前 json.js 77628cf8bf first comm 3 年之前 justify-content-space-evenly.js 77628cf8bf first comm 3 年之前 kerning-pairs-ligatures.js 77628cf8bf first comm 3 年之前 keyboardevent-charcode.js 77628cf8bf first comm 3 年之前 keyboardevent-code.js 77628cf8bf first comm 3 年之前 keyboardevent-getmodifierstate.js 77628cf8bf first comm 3 年之前 keyboardevent-key.js 77628cf8bf first comm 3 年之前 keyboardevent-location.js 77628cf8bf first comm 3 年之前 keyboardevent-which.js 77628cf8bf first comm 3 年之前 lazyload.js 77628cf8bf first comm 3 年之前 let.js 77628cf8bf first comm 3 年之前 link-icon-png.js 77628cf8bf first comm 3 年之前 link-icon-svg.js 77628cf8bf first comm 3 年之前 link-rel-dns-prefetch.js 77628cf8bf first comm 3 年之前 link-rel-modulepreload.js 77628cf8bf first comm 3 年之前 link-rel-preconnect.js 77628cf8bf first comm 3 年之前 link-rel-prefetch.js 77628cf8bf first comm 3 年之前 link-rel-preload.js 77628cf8bf first comm 3 年之前 link-rel-prerender.js 77628cf8bf first comm 3 年之前 loading-lazy-attr.js 77628cf8bf first comm 3 年之前 localecompare.js 77628cf8bf first comm 3 年之前 magnetometer.js 77628cf8bf first comm 3 年之前 matchesselector.js 77628cf8bf first comm 3 年之前 matchmedia.js 77628cf8bf first comm 3 年之前 mathml.js 77628cf8bf first comm 3 年之前 maxlength.js 77628cf8bf first comm 3 年之前 mdn-css-unicode-bidi-isolate-override.js 77628cf8bf first comm 3 年之前 mdn-css-unicode-bidi-isolate.js 77628cf8bf first comm 3 年之前 mdn-css-unicode-bidi-plaintext.js 77628cf8bf first comm 3 年之前 mdn-text-decoration-color.js 77628cf8bf first comm 3 年之前 mdn-text-decoration-line.js 77628cf8bf first comm 3 年之前 mdn-text-decoration-shorthand.js 77628cf8bf first comm 3 年之前 mdn-text-decoration-style.js 77628cf8bf first comm 3 年之前 media-fragments.js 77628cf8bf first comm 3 年之前 mediacapture-fromelement.js 77628cf8bf first comm 3 年之前 mediarecorder.js 77628cf8bf first comm 3 年之前 mediasource.js 77628cf8bf first comm 3 年之前 menu.js 77628cf8bf first comm 3 年之前 meta-theme-color.js 77628cf8bf first comm 3 年之前 meter.js 77628cf8bf first comm 3 年之前 midi.js 77628cf8bf first comm 3 年之前 minmaxwh.js 77628cf8bf first comm 3 年之前 mp3.js 77628cf8bf first comm 3 年之前 mpeg-dash.js 77628cf8bf first comm 3 年之前 mpeg4.js 77628cf8bf first comm 3 年之前 multibackgrounds.js 77628cf8bf first comm 3 年之前 multicolumn.js 77628cf8bf first comm 3 年之前 mutation-events.js 77628cf8bf first comm 3 年之前 mutationobserver.js 77628cf8bf first comm 3 年之前 namevalue-storage.js 77628cf8bf first comm 3 年之前 native-filesystem-api.js 77628cf8bf first comm 3 年之前 nav-timing.js 77628cf8bf first comm 3 年之前 netinfo.js 77628cf8bf first comm 3 年之前 notifications.js 77628cf8bf first comm 3 年之前 object-entries.js 77628cf8bf first comm 3 年之前 object-fit.js 77628cf8bf first comm 3 年之前 object-observe.js 77628cf8bf first comm 3 年之前 object-values.js 77628cf8bf first comm 3 年之前 objectrtc.js 77628cf8bf first comm 3 年之前 offline-apps.js 77628cf8bf first comm 3 年之前 offscreencanvas.js 77628cf8bf first comm 3 年之前 ogg-vorbis.js 77628cf8bf first comm 3 年之前 ogv.js 77628cf8bf first comm 3 年之前 ol-reversed.js 77628cf8bf first comm 3 年之前 once-event-listener.js 77628cf8bf first comm 3 年之前 online-status.js 77628cf8bf first comm 3 年之前 opus.js 77628cf8bf first comm 3 年之前 orientation-sensor.js 77628cf8bf first comm 3 年之前 outline.js 77628cf8bf first comm 3 年之前 pad-start-end.js 77628cf8bf first comm 3 年之前 page-transition-events.js 77628cf8bf first comm 3 年之前 pagevisibility.js 77628cf8bf first comm 3 年之前 passive-event-listener.js 77628cf8bf first comm 3 年之前 passwordrules.js 77628cf8bf first comm 3 年之前 path2d.js 77628cf8bf first comm 3 年之前 payment-request.js 77628cf8bf first comm 3 年之前 pdf-viewer.js 77628cf8bf first comm 3 年之前 permissions-api.js 77628cf8bf first comm 3 年之前 permissions-policy.js 77628cf8bf first comm 3 年之前 picture-in-picture.js 77628cf8bf first comm 3 年之前 picture.js 77628cf8bf first comm 3 年之前 ping.js 77628cf8bf first comm 3 年之前 png-alpha.js 77628cf8bf first comm 3 年之前 pointer-events.js 77628cf8bf first comm 3 年之前 pointer.js 77628cf8bf first comm 3 年之前 pointerlock.js 77628cf8bf first comm 3 年之前 portals.js 77628cf8bf first comm 3 年之前 prefers-color-scheme.js 77628cf8bf first comm 3 年之前 prefers-reduced-motion.js 77628cf8bf first comm 3 年之前 progress.js 77628cf8bf first comm 3 年之前 promise-finally.js 77628cf8bf first comm 3 年之前 promises.js 77628cf8bf first comm 3 年之前 proximity.js 77628cf8bf first comm 3 年之前 proxy.js 77628cf8bf first comm 3 年之前 publickeypinning.js 77628cf8bf first comm 3 年之前 push-api.js 77628cf8bf first comm 3 年之前 queryselector.js 77628cf8bf first comm 3 年之前 readonly-attr.js 77628cf8bf first comm 3 年之前 referrer-policy.js 77628cf8bf first comm 3 年之前 registerprotocolhandler.js 77628cf8bf first comm 3 年之前 rel-noopener.js 77628cf8bf first comm 3 年之前 rel-noreferrer.js 77628cf8bf first comm 3 年之前 rellist.js 77628cf8bf first comm 3 年之前 rem.js 77628cf8bf first comm 3 年之前 requestanimationframe.js 77628cf8bf first comm 3 年之前 requestidlecallback.js 77628cf8bf first comm 3 年之前 resizeobserver.js 77628cf8bf first comm 3 年之前 resource-timing.js 77628cf8bf first comm 3 年之前 rest-parameters.js 77628cf8bf first comm 3 年之前 rtcpeerconnection.js 77628cf8bf first comm 3 年之前 ruby.js 77628cf8bf first comm 3 年之前 run-in.js 77628cf8bf first comm 3 年之前 same-site-cookie-attribute.js 77628cf8bf first comm 3 年之前 screen-orientation.js 77628cf8bf first comm 3 年之前 script-async.js 77628cf8bf first comm 3 年之前 script-defer.js 77628cf8bf first comm 3 年之前 scrollintoview.js 77628cf8bf first comm 3 年之前 scrollintoviewifneeded.js 77628cf8bf first comm 3 年之前 sdch.js 77628cf8bf first comm 3 年之前 selection-api.js 77628cf8bf first comm 3 年之前 server-timing.js 77628cf8bf first comm 3 年之前 serviceworkers.js 77628cf8bf first comm 3 年之前 setimmediate.js 77628cf8bf first comm 3 年之前 shadowdom.js 77628cf8bf first comm 3 年之前 shadowdomv1.js 77628cf8bf first comm 3 年之前 sharedarraybuffer.js 77628cf8bf first comm 3 年之前 sharedworkers.js 77628cf8bf first comm 3 年之前 sni.js 77628cf8bf first comm 3 年之前 spdy.js 77628cf8bf first comm 3 年之前 speech-recognition.js 77628cf8bf first comm 3 年之前 speech-synthesis.js 77628cf8bf first comm 3 年之前 spellcheck-attribute.js 77628cf8bf first comm 3 年之前 sql-storage.js 77628cf8bf first comm 3 年之前 srcset.js 77628cf8bf first comm 3 年之前 stream.js 77628cf8bf first comm 3 年之前 streams.js 77628cf8bf first comm 3 年之前 stricttransportsecurity.js 77628cf8bf first comm 3 年之前 style-scoped.js 77628cf8bf first comm 3 年之前 subresource-bundling.js 77628cf8bf first comm 3 年之前 subresource-integrity.js 77628cf8bf first comm 3 年之前 svg-css.js 77628cf8bf first comm 3 年之前 svg-filters.js 77628cf8bf first comm 3 年之前 svg-fonts.js 77628cf8bf first comm 3 年之前 svg-fragment.js 77628cf8bf first comm 3 年之前 svg-html.js 77628cf8bf first comm 3 年之前 svg-html5.js 77628cf8bf first comm 3 年之前 svg-img.js 77628cf8bf first comm 3 年之前 svg-smil.js 77628cf8bf first comm 3 年之前 svg.js 77628cf8bf first comm 3 年之前 sxg.js 77628cf8bf first comm 3 年之前 tabindex-attr.js 77628cf8bf first comm 3 年之前 template-literals.js 77628cf8bf first comm 3 年之前 template.js 77628cf8bf first comm 3 年之前 temporal.js 77628cf8bf first comm 3 年之前 testfeat.js 77628cf8bf first comm 3 年之前 text-decoration.js 77628cf8bf first comm 3 年之前 text-emphasis.js 77628cf8bf first comm 3 年之前 text-overflow.js 77628cf8bf first comm 3 年之前 text-size-adjust.js 77628cf8bf first comm 3 年之前 text-stroke.js 77628cf8bf first comm 3 年之前 textcontent.js 77628cf8bf first comm 3 年之前 textencoder.js 77628cf8bf first comm 3 年之前 tls1-1.js 77628cf8bf first comm 3 年之前 tls1-2.js 77628cf8bf first comm 3 年之前 tls1-3.js 77628cf8bf first comm 3 年之前 touch.js 77628cf8bf first comm 3 年之前 transforms2d.js 77628cf8bf first comm 3 年之前 transforms3d.js 77628cf8bf first comm 3 年之前 trusted-types.js 77628cf8bf first comm 3 年之前 ttf.js 77628cf8bf first comm 3 年之前 typedarrays.js 77628cf8bf first comm 3 年之前 u2f.js 77628cf8bf first comm 3 年之前 unhandledrejection.js 77628cf8bf first comm 3 年之前 upgradeinsecurerequests.js 77628cf8bf first comm 3 年之前 url-scroll-to-text-fragment.js 77628cf8bf first comm 3 年之前 url.js 77628cf8bf first comm 3 年之前 urlsearchparams.js 77628cf8bf first comm 3 年之前 use-strict.js 77628cf8bf first comm 3 年之前 user-select-none.js 77628cf8bf first comm 3 年之前 user-timing.js 77628cf8bf first comm 3 年之前 variable-fonts.js 77628cf8bf first comm 3 年之前 vector-effect.js 77628cf8bf first comm 3 年之前 vibration.js 77628cf8bf first comm 3 年之前 video.js 77628cf8bf first comm 3 年之前 videotracks.js 77628cf8bf first comm 3 年之前 viewport-unit-variants.js 77628cf8bf first comm 3 年之前 viewport-units.js 77628cf8bf first comm 3 年之前 wai-aria.js 77628cf8bf first comm 3 年之前 wake-lock.js 77628cf8bf first comm 3 年之前 wasm.js 77628cf8bf first comm 3 年之前 wav.js 77628cf8bf first comm 3 年之前 wbr-element.js 77628cf8bf first comm 3 年之前 web-animation.js 77628cf8bf first comm 3 年之前 web-app-manifest.js 77628cf8bf first comm 3 年之前 web-bluetooth.js 77628cf8bf first comm 3 年之前 web-serial.js 77628cf8bf first comm 3 年之前 web-share.js 77628cf8bf first comm 3 年之前 webauthn.js 77628cf8bf first comm 3 年之前 webcodecs.js 77628cf8bf first comm 3 年之前 webgl.js 77628cf8bf first comm 3 年之前 webgl2.js 77628cf8bf first comm 3 年之前 webgpu.js 77628cf8bf first comm 3 年之前 webhid.js 77628cf8bf first comm 3 年之前 webkit-user-drag.js 77628cf8bf first comm 3 年之前 webm.js 77628cf8bf first comm 3 年之前 webnfc.js 77628cf8bf first comm 3 年之前 webp.js 77628cf8bf first comm 3 年之前 websockets.js 77628cf8bf first comm 3 年之前 webtransport.js 77628cf8bf first comm 3 年之前 webusb.js 77628cf8bf first comm 3 年之前 webvr.js 77628cf8bf first comm 3 年之前 webvtt.js 77628cf8bf first comm 3 年之前 webworkers.js 77628cf8bf first comm 3 年之前 webxr.js 77628cf8bf first comm 3 年之前 will-change.js 77628cf8bf first comm 3 年之前 woff.js 77628cf8bf first comm 3 年之前 woff2.js 77628cf8bf first comm 3 年之前 word-break.js 77628cf8bf first comm 3 年之前 wordwrap.js 77628cf8bf first comm 3 年之前 x-doc-messaging.js 77628cf8bf first comm 3 年之前 x-frame-options.js 77628cf8bf first comm 3 年之前 xhr2.js 77628cf8bf first comm 3 年之前 xhtml.js 77628cf8bf first comm 3 年之前 xhtmlsmil.js 77628cf8bf first comm 3 年之前 xml-serializer.js 77628cf8bf first comm 3 年之前 tum/whitesports - Gogs: Simplico Git Service

Açıklama Yok

class.wpcom-json-api-site-user-endpoint.php 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <?php
  2. new WPCOM_JSON_API_Site_User_Endpoint( array(
  3. 'description' => 'Get details of a user of a site by ID.',
  4. 'group' => '__do_not_document', //'users'
  5. 'stat' => 'sites:1:user',
  6. 'method' => 'GET',
  7. 'path' => '/sites/%s/users/%d',
  8. 'path_labels' => array(
  9. '$site' => '(int|string) Site ID or domain',
  10. '$user_id' => '(int) User ID',
  11. ),
  12. 'response_format' => WPCOM_JSON_API_Site_User_Endpoint::$user_format,
  13. 'example_request' => 'https://public-api.wordpress.com/rest/v1/sites/30434183/user/23',
  14. 'example_request_data' => array(
  15. 'headers' => array(
  16. 'authorization' => 'Bearer YOUR_API_TOKEN'
  17. ),
  18. ),
  19. 'example_response' => '{
  20. "ID": 18342963,
  21. "login": "binarysmash",
  22. "email": false,
  23. "name": "binarysmash",
  24. "URL": "http:\/\/binarysmash.wordpress.com",
  25. "avatar_URL": "http:\/\/0.gravatar.com\/avatar\/a178ebb1731d432338e6bb0158720fcc?s=96&d=identicon&r=G",
  26. "profile_URL": "http:\/\/en.gravatar.com\/binarysmash",
  27. "roles": [ "administrator" ]
  28. }'
  29. ) );
  30. new WPCOM_JSON_API_Site_User_Endpoint( array(
  31. 'description' => 'Get details of a user of a site by login.',
  32. 'group' => 'users',
  33. 'stat' => 'sites:1:user',
  34. 'method' => 'GET',
  35. 'path' => '/sites/%s/users/login:%s',
  36. 'path_labels' => array(
  37. '$site' => '(int|string) The site ID or domain.',
  38. '$user_id' => '(string) The user\'s login.',
  39. ),
  40. 'response_format' => WPCOM_JSON_API_Site_User_Endpoint::$user_format,
  41. 'example_request' => 'https://public-api.wordpress.com/rest/v1/sites/30434183/user/login:binarysmash',
  42. 'example_request_data' => array(
  43. 'headers' => array(
  44. 'authorization' => 'Bearer YOUR_API_TOKEN'
  45. ),
  46. ),
  47. 'example_response' => '{
  48. "ID": 18342963,
  49. "login": "binarysmash",
  50. "email": false,
  51. "name": "binarysmash",
  52. "URL": "http:\/\/binarysmash.wordpress.com",
  53. "avatar_URL": "http:\/\/0.gravatar.com\/avatar\/a178ebb1731d432338e6bb0158720fcc?s=96&d=identicon&r=G",
  54. "profile_URL": "http:\/\/en.gravatar.com\/binarysmash",
  55. "roles": [ "administrator" ]
  56. }'
  57. ) );
  58. new WPCOM_JSON_API_Site_User_Endpoint( array(
  59. 'description' => 'Update details of a user of a site.',
  60. 'group' => 'users',
  61. 'stat' => 'sites:1:user',
  62. 'method' => 'POST',
  63. 'path' => '/sites/%s/users/%d',
  64. 'path_labels' => array(
  65. '$site' => '(int|string) The site ID or domain.',
  66. '$user_id' => '(int) The user\'s ID.',
  67. ),
  68. 'request_format' => WPCOM_JSON_API_Site_User_Endpoint::$user_format,
  69. 'response_format' => WPCOM_JSON_API_Site_User_Endpoint::$user_format,
  70. 'example_request' => 'https://public-api.wordpress.com/rest/v1/sites/30434183/user/23',
  71. 'example_request_data' => array(
  72. 'headers' => array(
  73. 'authorization' => 'Bearer YOUR_API_TOKEN'
  74. ),
  75. 'body' => array(
  76. 'roles' => array(
  77. array(
  78. 'administrator',
  79. )
  80. ),
  81. 'first_name' => 'Rocco',
  82. 'last_name' => 'Tripaldi',
  83. )
  84. ),
  85. 'example_response' => '{
  86. "ID": 18342963,
  87. "login": "binarysmash",
  88. "email": false,
  89. "name": "binarysmash",
  90. "URL": "http:\/\/binarysmash.wordpress.com",
  91. "avatar_URL": "http:\/\/0.gravatar.com\/avatar\/a178ebb1731d432338e6bb0158720fcc?s=96&d=identicon&r=G",
  92. "profile_URL": "http:\/\/en.gravatar.com\/binarysmash",
  93. "roles": [ "administrator" ]
  94. }'
  95. ) );
  96. class WPCOM_JSON_API_Site_User_Endpoint extends WPCOM_JSON_API_Endpoint {
  97. public static $user_format = array(
  98. 'ID' => '(int) The ID of the user',
  99. 'login' => '(string) The login username of the user',
  100. 'email' => '(string) The email of the user',
  101. 'name' => '(string) The name to display for the user',
  102. 'first_name' => '(string) The first name of the user',
  103. 'last_name' => '(string) The last name of the user',
  104. 'nice_name' => '(string) The nice_name to display for the user',
  105. 'URL' => '(string) The primary blog of the user',
  106. 'avatar_URL' => '(url) Gravatar image URL',
  107. 'profile_URL' => '(url) Gravatar Profile URL',
  108. 'site_ID' => '(int) ID of the user\'s primary blog',
  109. 'roles' => '(array|string) The role or roles of the user',
  110. );
  111. // /sites/%s/users/%d -> $blog_id, $user_id
  112. function callback( $path = '', $blog_id = 0, $user_id = 0 ) {
  113. $blog_id = $this->api->switch_to_blog_and_validate_user( $this->api->get_blog_id( $blog_id ) );
  114. if ( is_wp_error( $blog_id ) ) {
  115. return $blog_id;
  116. }
  117. if ( ! current_user_can_for_blog( $blog_id, 'list_users' ) ) {
  118. return new WP_Error( 'unauthorized', 'User cannot view users for specified site', 403 );
  119. }
  120. // Get the user by ID or login
  121. $get_by = false !== strpos( $path, '/users/login:' ) ? 'login' : 'id';
  122. $user = get_user_by( $get_by, $user_id );
  123. if ( ! $user ) {
  124. return new WP_Error( 'unknown_user', 'Unknown user', 404 );
  125. }
  126. if ( ! is_user_member_of_blog( $user->ID, $blog_id ) ) {
  127. return new WP_Error( 'unknown_user_for_site', 'Unknown user for site', 404 );
  128. }
  129. if ( 'GET' === $this->api->method ) {
  130. return $this->get_user( $user->ID );
  131. } else if ( 'POST' === $this->api->method ) {
  132. if ( ! current_user_can_for_blog( $blog_id, 'promote_users' ) ) {
  133. return new WP_Error( 'unauthorized_no_promote_cap', 'User cannot promote users for specified site', 403 );
  134. }
  135. return $this->update_user( $user_id, $blog_id );
  136. } else {
  137. return new WP_Error( 'bad_request', 'An unsupported request method was used.' );
  138. }
  139. }
  140. public function get_user( $user_id ) {
  141. $the_user = $this->get_author( $user_id, true );
  142. if ( $the_user && ! is_wp_error( $the_user ) ) {
  143. $userdata = get_userdata( $user_id );
  144. $the_user->roles = ! is_wp_error( $userdata ) ? array_values( $userdata->roles ) : array();
  145. }
  146. return $the_user;
  147. }
  148. /**
  149. * Updates user data
  150. *
  151. * @return array
  152. */
  153. public function update_user( $user_id, $blog_id ) {
  154. $input = $this->input();
  155. $user['ID'] = $user_id;
  156. $is_wpcom = defined( 'IS_WPCOM' ) && IS_WPCOM;
  157. if ( get_current_user_id() == $user_id && isset( $input['roles'] ) ) {
  158. return new WP_Error( 'unauthorized', 'You cannot change your own role', 403 );
  159. }
  160. if ( $is_wpcom && $user_id !== get_current_user_id() && $user_id == wpcom_get_blog_owner( $blog_id ) ) {
  161. return new WP_Error( 'unauthorized_edit_owner', 'Current user can not edit blog owner', 403 );
  162. }
  163. if ( ! $is_wpcom ) {
  164. foreach ( $input as $key => $value ) {
  165. if ( ! is_array( $value ) ) {
  166. $value = trim( $value );
  167. }
  168. $value = wp_unslash( $value );
  169. switch ( $key ) {
  170. case 'first_name':
  171. case 'last_name':
  172. $user[ $key ] = $value;
  173. break;
  174. case 'display_name':
  175. case 'name':
  176. $user[ 'display_name' ] = $value;
  177. break;
  178. }
  179. }
  180. }
  181. if ( isset( $input[ 'roles' ] ) ) {
  182. // For now, we only use the first role in the array.
  183. if ( is_array( $input['roles'] ) ) {
  184. $user['role'] = $input['roles'][0];
  185. } else if ( is_string( $input['roles'] ) ) {
  186. $user['role'] = $input['roles'];
  187. } else {
  188. return new WP_Error( 'invalid_input', __( 'The roles property must be a string or an array.', 'jetpack' ), 400 );
  189. }
  190. $editable_roles = array_keys( get_editable_roles() );
  191. if ( ! in_array( $user['role'], $editable_roles ) ) {
  192. return new WP_Error( 'invalid_input', sprintf( __( '%s is not a valid role.', 'jetpack' ), $editable_roles ), 400 );
  193. }
  194. }
  195. $result = wp_update_user( $user );
  196. if ( is_wp_error( $result ) ) {
  197. return $result;
  198. }
  199. return $this->get_user( $user_id );
  200. }
  201. }