BP_REST_Media_Endpoint::get_item_schema()
Get the media schema, conforming to JSON Schema.
Description
Return
(array)
Source
File: bp-media/classes/class-bp-rest-media-endpoint.php
1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 | public function get_item_schema() { $schema = array ( 'title' => 'bp_media' , 'type' => 'object' , 'properties' => array ( 'id' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'A unique numeric ID for the Media.' , 'buddyboss' ), 'readonly' => true, 'type' => 'integer' , ), 'blog_id' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'Current Site ID.' , 'buddyboss' ), 'readonly' => true, 'type' => 'integer' , ), 'attachment_id' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'Unique identifier for the media object.' , 'buddyboss' ), 'readonly' => true, 'type' => 'integer' , ), 'user_id' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'The ID for the author of the media.' , 'buddyboss' ), 'readonly' => true, 'type' => 'integer' , ), 'title' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'The Media title.' , 'buddyboss' ), 'readonly' => true, 'type' => 'string' , ), 'album_id' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'A unique numeric ID for the Album.' , 'buddyboss' ), 'readonly' => true, 'type' => 'integer' , ), 'group_id' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'A unique numeric ID for the Group.' , 'buddyboss' ), 'readonly' => true, 'type' => 'integer' , ), 'activity_id' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'A unique numeric ID for the activity.' , 'buddyboss' ), 'readonly' => true, 'type' => 'integer' , ), 'privacy' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'Privacy of the media.' , 'buddyboss' ), 'enum' => array ( 'public' , 'loggedin' , 'onlyme' , 'friends' , 'grouponly' , 'message' ), 'readonly' => true, 'type' => 'string' , ), 'menu_order' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'Order of the item.' , 'buddyboss' ), 'readonly' => true, 'type' => 'integer' , ), 'date_created' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'The date the media was created, in the site\'s timezone.' , 'buddyboss' ), 'readonly' => true, 'type' => 'string' , 'format' => 'date-time' , ), 'attachment_data' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'Wordpress Media Data.' , 'buddyboss' ), 'readonly' => true, 'type' => 'object' , 'properties' => array ( 'full' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'Media URL with full image size.' , 'buddyboss' ), 'readonly' => true, 'type' => 'string' , ), 'thumb' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'Media URL with thumbnail image size.' , 'buddyboss' ), 'readonly' => true, 'type' => 'string' , ), 'activity_thumb' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'Media URL for the activity image size.' , 'buddyboss' ), 'readonly' => true, 'type' => 'string' , ), 'meta' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'Meta items for the media.' , 'buddyboss' ), 'readonly' => true, 'type' => 'object' , ), ), ), 'user_email' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'The user\'s email id to create a media.' , 'buddyboss' ), 'readonly' => true, 'type' => 'string' , ), 'user_nicename' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'The User\'s nice name to create a media.' , 'buddyboss' ), 'readonly' => true, 'type' => 'string' , ), 'user_login' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'The User\'s login name to create a media.' , 'buddyboss' ), 'readonly' => true, 'type' => 'string' , ), 'display_name' => array ( 'context' => array ( 'embed' , 'view' , 'edit' ), 'description' => __( 'The User\'s display name to create a media.' , 'buddyboss' ), 'readonly' => true, 'type' => 'string' , ), ), ); /** * Filters the media schema. * * @param array $schema The endpoint schema. */ return apply_filters( 'bp_rest_media_schema' , $this ->add_additional_fields_schema( $schema ) ); } |
Changelog
Version | Description |
---|---|
0.1.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.