Ticket #38617: 38617.diff
File 38617.diff, 18.3 KB (added by , 8 years ago) |
---|
-
src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
594 594 'description' => __( 'Limit result set to attachments of a particular media type.' ), 595 595 'type' => 'string', 596 596 'enum' => array_keys( $media_types ), 597 'validate_callback' => 'rest_validate_request_arg',598 597 ); 599 598 600 599 $params['mime_type'] = array( -
src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
1102 1102 'type' => 'string', 1103 1103 'format' => 'ipv4', 1104 1104 'context' => array( 'edit' ), 1105 'arg_options' => array( 1106 'default' => '127.0.0.1', 1107 ), 1105 'default' => '127.0.0.1', 1108 1106 ), 1109 1107 'author_name' => array( 1110 1108 'description' => __( 'Display name for the object author.' ), … … 1176 1174 'description' => __( 'The id for the parent of the object.' ), 1177 1175 'type' => 'integer', 1178 1176 'context' => array( 'view', 'edit', 'embed' ), 1179 'arg_options' => array( 1180 'default' => 0, 1181 ), 1177 'default' => 0, 1182 1178 ), 1183 1179 'post' => array( 1184 1180 'description' => __( 'The id of the associated post object.' ), 1185 1181 'type' => 'integer', 1186 1182 'context' => array( 'view', 'edit' ), 1187 'arg_options' => array( 1188 'default' => 0, 1189 ), 1183 'default' => 0, 1190 1184 ), 1191 1185 'status' => array( 1192 1186 'description' => __( 'State of the object.' ), … … 1252 1246 'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.' ), 1253 1247 'type' => 'string', 1254 1248 'format' => 'date-time', 1255 'validate_callback' => 'rest_validate_request_arg',1256 1249 ); 1257 1250 1258 1251 $query_params['author'] = array( 1259 1252 'description' => __( 'Limit result set to comments assigned to specific user ids. Requires authorization.' ), 1260 'sanitize_callback' => 'wp_parse_id_list',1261 1253 'type' => 'array', 1254 'items' => array( 1255 'type' => 'integer', 1256 ), 1262 1257 ); 1263 1258 1264 1259 $query_params['author_exclude'] = array( 1265 1260 'description' => __( 'Ensure result set excludes comments assigned to specific user ids. Requires authorization.' ), 1266 'sanitize_callback' => 'wp_parse_id_list',1267 1261 'type' => 'array', 1262 'items' => array( 1263 'type' => 'integer', 1264 ), 1268 1265 ); 1269 1266 1270 1267 $query_params['author_email'] = array( 1271 1268 'default' => null, 1272 1269 'description' => __( 'Limit result set to that from a specific author email. Requires authorization.' ), 1273 1270 'format' => 'email', 1274 'sanitize_callback' => 'sanitize_email',1275 1271 'type' => 'string', 1276 1272 ); 1277 1273 … … 1279 1275 'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.' ), 1280 1276 'type' => 'string', 1281 1277 'format' => 'date-time', 1282 'validate_callback' => 'rest_validate_request_arg',1283 1278 ); 1284 1279 1285 1280 $query_params['exclude'] = array( 1286 1281 'description' => __( 'Ensure result set excludes specific ids.' ), 1287 1282 'type' => 'array', 1283 'items' => array( 1284 'type' => 'integer', 1285 ), 1288 1286 'default' => array(), 1289 'sanitize_callback' => 'wp_parse_id_list',1290 1287 ); 1291 1288 1292 1289 $query_params['include'] = array( 1293 1290 'description' => __( 'Limit result set to specific ids.' ), 1294 1291 'type' => 'array', 1292 'items' => array( 1293 'type' => 'integer', 1294 ), 1295 1295 'default' => array(), 1296 'sanitize_callback' => 'wp_parse_id_list',1297 1296 ); 1298 1297 1299 1298 $query_params['karma'] = array( 1300 1299 'default' => null, 1301 1300 'description' => __( 'Limit result set to that of a particular comment karma. Requires authorization.' ), 1302 'sanitize_callback' => 'absint',1303 1301 'type' => 'integer', 1304 'validate_callback' => 'rest_validate_request_arg',1305 1302 ); 1306 1303 1307 1304 $query_params['offset'] = array( 1308 1305 'description' => __( 'Offset the result set by a specific number of comments.' ), 1309 1306 'type' => 'integer', 1310 'sanitize_callback' => 'absint',1311 'validate_callback' => 'rest_validate_request_arg',1312 1307 ); 1313 1308 1314 1309 $query_params['order'] = array( 1315 1310 'description' => __( 'Order sort attribute ascending or descending.' ), 1316 1311 'type' => 'string', 1317 'sanitize_callback' => 'sanitize_key',1318 'validate_callback' => 'rest_validate_request_arg',1319 1312 'default' => 'desc', 1320 1313 'enum' => array( 1321 1314 'asc', … … 1326 1319 $query_params['orderby'] = array( 1327 1320 'description' => __( 'Sort collection by object attribute.' ), 1328 1321 'type' => 'string', 1329 'sanitize_callback' => 'sanitize_key',1330 'validate_callback' => 'rest_validate_request_arg',1331 1322 'default' => 'date_gmt', 1332 1323 'enum' => array( 1333 1324 'date', … … 1343 1334 $query_params['parent'] = array( 1344 1335 'default' => array(), 1345 1336 'description' => __( 'Limit result set to resources of specific parent ids.' ), 1346 'sanitize_callback' => 'wp_parse_id_list',1347 1337 'type' => 'array', 1338 'items' => array( 1339 'type' => 'integer', 1340 ), 1348 1341 ); 1349 1342 1350 1343 $query_params['parent_exclude'] = array( 1351 1344 'default' => array(), 1352 1345 'description' => __( 'Ensure result set excludes specific parent ids.' ), 1353 'sanitize_callback' => 'wp_parse_id_list',1354 1346 'type' => 'array', 1347 'items' => array( 1348 'type' => 'integer', 1349 ), 1355 1350 ); 1356 1351 1357 1352 $query_params['post'] = array( 1358 1353 'default' => array(), 1359 1354 'description' => __( 'Limit result set to resources assigned to specific post ids.' ), 1360 1355 'type' => 'array', 1361 'sanitize_callback' => 'wp_parse_id_list', 1356 'items' => array( 1357 'type' => 'integer', 1358 ), 1362 1359 ); 1363 1360 1364 1361 $query_params['status'] = array( -
src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
1974 1974 'items' => array( 1975 1975 'type' => 'integer', 1976 1976 ), 1977 'arg_options' => array(1978 'sanitize_callback' => 'wp_parse_id_list',1979 ),1980 1977 'context' => array( 'view', 'edit' ), 1981 1978 ); 1982 1979 $schema['properties'][ $base . '_exclude' ] = array( … … 1985 1982 'items' => array( 1986 1983 'type' => 'integer', 1987 1984 ), 1988 'arg_options' => array(1989 'sanitize_callback' => 'wp_parse_id_list',1990 ),1991 1985 'context' => array( 'view', 'edit' ), 1992 1986 ); 1993 1987 } … … 2012 2006 'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.' ), 2013 2007 'type' => 'string', 2014 2008 'format' => 'date-time', 2015 'validate_callback' => 'rest_validate_request_arg',2016 2009 ); 2017 2010 2018 2011 if ( post_type_supports( $this->post_type, 'author' ) ) { 2019 2012 $params['author'] = array( 2020 2013 'description' => __( 'Limit result set to posts assigned to specific authors.' ), 2021 2014 'type' => 'array', 2015 'items' => array( 2016 'type' => 'integer', 2017 ), 2022 2018 'default' => array(), 2023 'sanitize_callback' => 'wp_parse_id_list',2024 2019 ); 2025 2020 $params['author_exclude'] = array( 2026 2021 'description' => __( 'Ensure result set excludes posts assigned to specific authors.' ), 2027 2022 'type' => 'array', 2023 'items' => array( 2024 'type' => 'integer', 2025 ), 2028 2026 'default' => array(), 2029 'sanitize_callback' => 'wp_parse_id_list',2030 2027 ); 2031 2028 } 2032 2029 … … 2034 2031 'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.' ), 2035 2032 'type' => 'string', 2036 2033 'format' => 'date-time', 2037 'validate_callback' => 'rest_validate_request_arg',2038 2034 ); 2039 2035 2040 2036 $params['exclude'] = array( 2041 2037 'description' => __( 'Ensure result set excludes specific ids.' ), 2042 2038 'type' => 'array', 2039 'items' => array( 2040 'type' => 'integer', 2041 ), 2043 2042 'default' => array(), 2044 'sanitize_callback' => 'wp_parse_id_list',2045 2043 ); 2046 2044 2047 2045 $params['include'] = array( 2048 2046 'description' => __( 'Limit result set to specific ids.' ), 2049 2047 'type' => 'array', 2048 'items' => array( 2049 'type' => 'integer', 2050 ), 2050 2051 'default' => array(), 2051 'sanitize_callback' => 'wp_parse_id_list',2052 2052 ); 2053 2053 2054 2054 if ( 'page' === $this->post_type || post_type_supports( $this->post_type, 'page-attributes' ) ) { 2055 2055 $params['menu_order'] = array( 2056 2056 'description' => __( 'Limit result set to resources with a specific menu_order value.' ), 2057 2057 'type' => 'integer', 2058 'sanitize_callback' => 'absint',2059 'validate_callback' => 'rest_validate_request_arg',2060 2058 ); 2061 2059 } 2062 2060 2063 2061 $params['offset'] = array( 2064 2062 'description' => __( 'Offset the result set by a specific number of items.' ), 2065 2063 'type' => 'integer', 2066 'sanitize_callback' => 'absint',2067 'validate_callback' => 'rest_validate_request_arg',2068 2064 ); 2069 2065 2070 2066 $params['order'] = array( … … 2072 2068 'type' => 'string', 2073 2069 'default' => 'desc', 2074 2070 'enum' => array( 'asc', 'desc' ), 2075 'validate_callback' => 'rest_validate_request_arg',2076 2071 ); 2077 2072 2078 2073 $params['orderby'] = array( … … 2087 2082 'title', 2088 2083 'slug', 2089 2084 ), 2090 'validate_callback' => 'rest_validate_request_arg',2091 2085 ); 2092 2086 2093 2087 if ( 'page' === $this->post_type || post_type_supports( $this->post_type, 'page-attributes' ) ) { … … 2100 2094 $params['parent'] = array( 2101 2095 'description' => __( 'Limit result set to those of particular parent ids.' ), 2102 2096 'type' => 'array', 2103 'sanitize_callback' => 'wp_parse_id_list', 2097 'items' => array( 2098 'type' => 'integer', 2099 ), 2104 2100 'default' => array(), 2105 2101 ); 2106 2102 $params['parent_exclude'] = array( 2107 2103 'description' => __( 'Limit result set to all items except those of a particular parent id.' ), 2108 2104 'type' => 'array', 2109 'sanitize_callback' => 'wp_parse_id_list', 2105 'items' => array( 2106 'type' => 'integer', 2107 ), 2110 2108 'default' => array(), 2111 2109 ); 2112 2110 } … … 2114 2112 $params['slug'] = array( 2115 2113 'description' => __( 'Limit result set to posts with a specific slug.' ), 2116 2114 'type' => 'string', 2117 'validate_callback' => 'rest_validate_request_arg',2118 2115 ); 2119 2116 2120 2117 $params['status'] = array( … … 2134 2131 $params[ $base ] = array( 2135 2132 'description' => sprintf( __( 'Limit result set to all items that have the specified term assigned in the %s taxonomy.' ), $base ), 2136 2133 'type' => 'array', 2137 'sanitize_callback' => 'wp_parse_id_list', 2134 'items' => array( 2135 'type' => 'integer', 2136 ), 2138 2137 'default' => array(), 2139 2138 ); 2140 2139 } … … 2143 2142 $params['sticky'] = array( 2144 2143 'description' => __( 'Limit result set to items that are sticky.' ), 2145 2144 'type' => 'boolean', 2146 'sanitize_callback' => 'rest_parse_request_arg',2147 2145 ); 2148 2146 } 2149 2147 -
src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php
301 301 $new_params['type'] = array( 302 302 'description' => __( 'Limit results to resources associated with a specific post type.' ), 303 303 'type' => 'string', 304 'validate_callback' => 'rest_validate_request_arg',305 304 ); 306 305 return $new_params; 307 306 } -
src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
887 887 $query_params['exclude'] = array( 888 888 'description' => __( 'Ensure result set excludes specific ids.' ), 889 889 'type' => 'array', 890 'items' => array( 891 'type' => 'integer', 892 ), 890 893 'default' => array(), 891 'sanitize_callback' => 'wp_parse_id_list',892 894 ); 893 895 894 896 $query_params['include'] = array( 895 897 'description' => __( 'Limit result set to specific ids.' ), 896 898 'type' => 'array', 899 'items' => array( 900 'type' => 'integer', 901 ), 897 902 'default' => array(), 898 'sanitize_callback' => 'wp_parse_id_list',899 903 ); 900 904 901 905 if ( ! $taxonomy->hierarchical ) { 902 906 $query_params['offset'] = array( 903 907 'description' => __( 'Offset the result set by a specific number of items.' ), 904 908 'type' => 'integer', 905 'sanitize_callback' => 'absint',906 'validate_callback' => 'rest_validate_request_arg',907 909 ); 908 910 } 909 911 910 912 $query_params['order'] = array( 911 913 'description' => __( 'Order sort attribute ascending or descending.' ), 912 914 'type' => 'string', 913 'sanitize_callback' => 'sanitize_key',914 915 'default' => 'asc', 915 916 'enum' => array( 916 917 'asc', 917 918 'desc', 918 919 ), 919 'validate_callback' => 'rest_validate_request_arg',920 920 ); 921 921 922 922 $query_params['orderby'] = array( 923 923 'description' => __( 'Sort collection by resource attribute.' ), 924 924 'type' => 'string', 925 'sanitize_callback' => 'sanitize_key',926 925 'default' => 'name', 927 926 'enum' => array( 928 927 'id', … … 933 932 'description', 934 933 'count', 935 934 ), 936 'validate_callback' => 'rest_validate_request_arg',937 935 ); 938 936 939 937 $query_params['hide_empty'] = array( 940 938 'description' => __( 'Whether to hide resources not assigned to any posts.' ), 941 939 'type' => 'boolean', 942 940 'default' => false, 943 'sanitize_callback' => 'rest_sanitize_request_arg',944 'validate_callback' => 'rest_validate_request_arg',945 941 ); 946 942 947 943 if ( $taxonomy->hierarchical ) { 948 944 $query_params['parent'] = array( 949 945 'description' => __( 'Limit result set to resources assigned to a specific parent.' ), 950 946 'type' => 'integer', 951 'sanitize_callback' => 'absint',952 'validate_callback' => 'rest_validate_request_arg',953 947 ); 954 948 } 955 949 … … 957 951 'description' => __( 'Limit result set to resources assigned to a specific post.' ), 958 952 'type' => 'integer', 959 953 'default' => null, 960 'validate_callback' => 'rest_validate_request_arg',961 954 ); 962 955 963 956 $query_params['slug'] = array( 964 957 'description' => __( 'Limit result set to resources with a specific slug.' ), 965 958 'type' => 'string', 966 'validate_callback' => 'rest_validate_request_arg',967 959 ); 968 960 969 961 return $query_params; -
src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
1022 1022 'type' => 'string', 1023 1023 ), 1024 1024 'context' => array( 'edit' ), 1025 'arg_options' => array(1026 'sanitize_callback' => 'wp_parse_slug_list',1027 ),1028 1025 ), 1029 1026 'password' => array( 1030 1027 'description' => __( 'Password for the resource (never included).' ), … … 1091 1088 $query_params['exclude'] = array( 1092 1089 'description' => __( 'Ensure result set excludes specific ids.' ), 1093 1090 'type' => 'array', 1091 'items' => array( 1092 'type' => 'integer', 1093 ), 1094 1094 'default' => array(), 1095 'sanitize_callback' => 'wp_parse_id_list',1096 1095 ); 1097 1096 1098 1097 $query_params['include'] = array( 1099 1098 'description' => __( 'Limit result set to specific ids.' ), 1100 1099 'type' => 'array', 1100 'items' => array( 1101 'type' => 'integer', 1102 ), 1101 1103 'default' => array(), 1102 'sanitize_callback' => 'wp_parse_id_list',1103 1104 ); 1104 1105 1105 1106 $query_params['offset'] = array( 1106 1107 'description' => __( 'Offset the result set by a specific number of items.' ), 1107 1108 'type' => 'integer', 1108 'sanitize_callback' => 'absint',1109 'validate_callback' => 'rest_validate_request_arg',1110 1109 ); 1111 1110 1112 1111 $query_params['order'] = array( 1113 1112 'default' => 'asc', 1114 1113 'description' => __( 'Order sort attribute ascending or descending.' ), 1115 1114 'enum' => array( 'asc', 'desc' ), 1116 'sanitize_callback' => 'sanitize_key',1117 1115 'type' => 'string', 1118 'validate_callback' => 'rest_validate_request_arg',1119 1116 ); 1120 1117 1121 1118 $query_params['orderby'] = array( … … 1130 1127 'email', 1131 1128 'url', 1132 1129 ), 1133 'sanitize_callback' => 'sanitize_key',1134 1130 'type' => 'string', 1135 'validate_callback' => 'rest_validate_request_arg',1136 1131 ); 1137 1132 1138 1133 $query_params['slug'] = array( 1139 1134 'description' => __( 'Limit result set to resources with a specific slug.' ), 1140 1135 'type' => 'string', 1141 'validate_callback' => 'rest_validate_request_arg',1142 1136 ); 1143 1137 1144 1138 $query_params['roles'] = array( 1145 1139 'description' => __( 'Limit result set to resources matching at least one specific role provided. Accepts csv list or single role.' ), 1146 1140 'type' => 'array', 1147 'sanitize_callback' => 'wp_parse_slug_list', 1141 'items' => array( 1142 'type' => 'string', 1143 ), 1148 1144 ); 1149 1145 1150 1146 return $query_params;