Ticket #20397: 20397.patch
| File 20397.patch, 4.9 KB (added by maxcutler, 14 months ago) |
|---|
-
wp-includes/class-wp-xmlrpc-server.php
1438 1438 $blog_id = (int) $args[0]; 1439 1439 $username = $args[1]; 1440 1440 $password = $args[2]; 1441 $taxonomy _name= $args[3];1441 $taxonomy = $args[3]; 1442 1442 $term_id = (int) $args[4]; 1443 1443 1444 1444 if ( ! $user = $this->login( $username, $password ) ) … … 1446 1446 1447 1447 do_action( 'xmlrpc_call', 'wp.deleteTerm' ); 1448 1448 1449 if ( ! taxonomy_exists( $taxonomy _name) )1449 if ( ! taxonomy_exists( $taxonomy ) ) 1450 1450 return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); 1451 1451 1452 $taxonomy = get_taxonomy( $taxonomy _name);1452 $taxonomy = get_taxonomy( $taxonomy ); 1453 1453 1454 1454 if ( ! current_user_can( $taxonomy->cap->delete_terms ) ) 1455 1455 return new IXR_Error( 401, __( 'You are not allowed to delete terms in this taxonomy.' ) ); 1456 1456 1457 $term = get_term( $term_id, $taxonomy _name );1457 $term = get_term( $term_id, $taxonomy->name ); 1458 1458 1459 1459 if ( is_wp_error( $term ) ) 1460 1460 return new IXR_Error( 500, $term->get_error_message() ); … … 1462 1462 if ( ! $term ) 1463 1463 return new IXR_Error( 404, __( 'Invalid term ID.' ) ); 1464 1464 1465 $result = wp_delete_term( $term_id, $taxonomy _name );1465 $result = wp_delete_term( $term_id, $taxonomy->name ); 1466 1466 1467 1467 if ( is_wp_error( $result ) ) 1468 1468 return new IXR_Error( 500, $term->get_error_message() ); … … 1481 1481 * - int $blog_id 1482 1482 * - string $username 1483 1483 * - string $password 1484 * - string $taxonomy _name1484 * - string $taxonomy 1485 1485 * - string $term_id 1486 1486 * @return array contains: 1487 1487 * - 'term_id' … … 1500 1500 $blog_id = (int) $args[0]; 1501 1501 $username = $args[1]; 1502 1502 $password = $args[2]; 1503 $taxonomy _name= $args[3];1503 $taxonomy = $args[3]; 1504 1504 $term_id = (int) $args[4]; 1505 1505 1506 1506 if ( ! $user = $this->login( $username, $password ) ) … … 1508 1508 1509 1509 do_action( 'xmlrpc_call', 'wp.getTerm' ); 1510 1510 1511 if ( ! taxonomy_exists( $taxonomy _name) )1511 if ( ! taxonomy_exists( $taxonomy ) ) 1512 1512 return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); 1513 1513 1514 $taxonomy = get_taxonomy( $taxonomy _name);1514 $taxonomy = get_taxonomy( $taxonomy ); 1515 1515 1516 1516 if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) 1517 1517 return new IXR_Error( 401, __( 'You are not allowed to assign terms in this taxonomy.' ) ); 1518 1518 1519 $term = get_term( $term_id , $taxonomy _name, ARRAY_A );1519 $term = get_term( $term_id , $taxonomy->name, ARRAY_A ); 1520 1520 1521 1521 if ( is_wp_error( $term ) ) 1522 1522 return new IXR_Error( 500, $term->get_error_message() ); … … 1538 1538 * - int $blog_id 1539 1539 * - string $username 1540 1540 * - string $password 1541 * - string $taxonomy _name1541 * - string $taxonomy 1542 1542 * - array $filter optional 1543 1543 * @return array terms 1544 1544 */ … … 1548 1548 $blog_id = (int) $args[0]; 1549 1549 $username = $args[1]; 1550 1550 $password = $args[2]; 1551 $taxonomy _name= $args[3];1551 $taxonomy = $args[3]; 1552 1552 $filter = isset( $args[4] ) ? $args[4] : array(); 1553 1553 1554 1554 if ( ! $user = $this->login( $username, $password ) ) … … 1556 1556 1557 1557 do_action( 'xmlrpc_call', 'wp.getTerms' ); 1558 1558 1559 if ( ! taxonomy_exists( $taxonomy _name) )1559 if ( ! taxonomy_exists( $taxonomy ) ) 1560 1560 return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); 1561 1561 1562 $taxonomy = get_taxonomy( $taxonomy _name);1562 $taxonomy = get_taxonomy( $taxonomy ); 1563 1563 1564 1564 if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) 1565 1565 return new IXR_Error( 401, __( 'You are not allowed to assign terms in this taxonomy.' ) ); … … 1587 1587 if ( isset( $filter['search'] ) ) 1588 1588 $query['search'] = $filter['search']; 1589 1589 1590 $terms = get_terms( $taxonomy _name, $query );1590 $terms = get_terms( $taxonomy->name, $query ); 1591 1591 1592 1592 if ( is_wp_error( $terms ) ) 1593 1593 return new IXR_Error( 500, $terms->get_error_message() ); … … 1609 1609 * - int $blog_id 1610 1610 * - string $username 1611 1611 * - string $password 1612 * - string $taxonomy _name1612 * - string $taxonomy 1613 1613 * @return array (@see get_taxonomy()) 1614 1614 */ 1615 1615 function wp_getTaxonomy( $args ) { … … 1618 1618 $blog_id = (int) $args[0]; 1619 1619 $username = $args[1]; 1620 1620 $password = $args[2]; 1621 $taxonomy _name= $args[3];1621 $taxonomy = $args[3]; 1622 1622 1623 1623 if ( ! $user = $this->login( $username, $password ) ) 1624 1624 return $this->error; 1625 1625 1626 1626 do_action( 'xmlrpc_call', 'wp.getTaxonomy' ); 1627 1627 1628 if ( ! taxonomy_exists( $taxonomy _name) )1628 if ( ! taxonomy_exists( $taxonomy ) ) 1629 1629 return new IXR_Error( 403, __( 'Invalid taxonomy.' ) ); 1630 1630 1631 $taxonomy = get_taxonomy( $taxonomy _name);1631 $taxonomy = get_taxonomy( $taxonomy ); 1632 1632 1633 1633 if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) 1634 1634 return new IXR_Error( 401, __( 'You are not allowed to assign terms in this taxonomy.' ) );
