Changeset 6287 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-commit-subscriptions.php
- Timestamp:
- 12/19/2017 04:22:37 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-commit-subscriptions.php
r3510 r6287 1 1 <?php 2 2 namespace WordPressdotorg\Plugin_Directory\API\Routes; 3 3 4 use WordPressdotorg\Plugin_Directory\Plugin_Directory; 4 5 use WordPressdotorg\Plugin_Directory\API\Base; … … 14 15 public function __construct() { 15 16 register_rest_route( 'plugins/v1', '/plugin/(?P<plugin_slug>[^/]+)/commit-subscription', array( 16 'methods' => \WP_REST_Server::READABLE,17 'callback' => array( $this, 'subscribe' ),18 'args' => array(17 'methods' => \WP_REST_Server::READABLE, 18 'callback' => array( $this, 'subscribe' ), 19 'args' => array( 19 20 'plugin_slug' => array( 20 21 'validate_callback' => array( $this, 'validate_plugin_slug_callback' ), 21 22 ), 22 'subscribe' => array( 23 'validate_callback' => function( $bool ) { return is_numeric( $bool ); }, 23 'subscribe' => array( 24 'validate_callback' => function( $bool ) { 25 return is_numeric( $bool ); 26 }, 24 27 ), 25 28 'unsubscribe' => array( 26 'validate_callback' => function( $bool ) { return is_numeric( $bool ); }, 29 'validate_callback' => function( $bool ) { 30 return is_numeric( $bool ); 31 }, 27 32 ), 28 33 ), 29 'permission_callback' => 'is_user_logged_in' 34 'permission_callback' => 'is_user_logged_in', 30 35 ) ); 31 36 } … … 42 47 43 48 $result = array( 44 "location"=> $location,49 'location' => $location, 45 50 ); 46 51
Note: See TracChangeset
for help on using the changeset viewer.