Changeset 13300 for trunk/src/bp-messages/bp-messages-template.php
- Timestamp:
- 07/22/2022 09:32:13 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/bp-messages-template.php
r13295 r13300 1505 1505 * @since 3.0.0 Added `$args` parameter. 1506 1506 * 1507 * @param array|string $args See {@link bp_get_send_message_button()}. 1507 * @see bp_get_send_message_button_args() for description of parameters. 1508 * 1509 * @param array|string $args See {@link bp_get_send_message_button_args()}. 1508 1510 */ 1509 1511 function bp_send_message_button( $args = '' ) { 1510 1512 echo bp_get_send_message_button( $args ); 1511 1513 } 1512 /** 1513 * Generate the 'Private Message' button for member profile headers.1514 * 1515 * @since 1.2.01516 * @since 3.0.0 Added `$args` parameter.1514 1515 /** 1516 * Get the arguments for the private message button. 1517 * 1518 * @since 11.0.0 1517 1519 * 1518 1520 * @param array|string $args { 1519 * All arguments are optional. See {@link BP_Button} for complete 1520 * descriptions. 1521 * @type string $id Default: 'private_message'. 1522 * @type string $component Default: 'messages'. 1523 * @type bool $must_be_logged_in Default: true. 1524 * @type bool $block_self Default: true. 1525 * @type string $wrapper_id Default: 'send-private-message'. 1526 * @type string $link_href Default: the private message link for 1527 * the current member in the loop. 1528 * @type string $link_text Default: 'Private Message'. 1529 * @type string $link_class Default: 'send-message'. 1521 * All arguments are optional. See {@link BP_Button} for complete 1522 * descriptions. 1523 * @type string $id Default: 'private_message'. 1524 * @type string $component Default: 'messages'. 1525 * @type bool $must_be_logged_in Default: true. 1526 * @type bool $block_self Default: true. 1527 * @type string $wrapper_id Default: 'send-private-message'. 1528 * @type string $link_href Default: the private message link for 1529 * the current member in the loop. 1530 * @type string $link_title Default: 'Send a private message to this member.'. 1531 * @type string $link_text Default: 'Private Message'. 1532 * @type string $link_class Default: 'send-message'. 1530 1533 * } 1531 * @return string 1532 */ 1533 function bp_get_send_message_button( $args = '' ) { 1534 1535 $r = bp_parse_args( 1534 * @return array The arguments for the public message button. 1535 */ 1536 function bp_get_send_message_button_args( $args = '' ) { 1537 $button_args = bp_parse_args( 1536 1538 $args, 1537 1539 array( … … 1543 1545 'link_href' => bp_get_send_private_message_link(), 1544 1546 'link_text' => __( 'Private Message', 'buddypress' ), 1547 'link_title' => __( 'Send a private message to this member.', 'buddypress' ), 1545 1548 'link_class' => 'send-message', 1546 1549 ) 1547 1550 ); 1548 1551 1549 // Note: 'bp_get_send_message_button' is a legacy filter. Use 1550 // 'bp_get_send_message_button_args' instead. See #4536. 1551 return apply_filters( 'bp_get_send_message_button', 1552 1553 /** 1554 * Filters the "Private Message" button for member profile headers. 1555 * 1556 * @since 1.8.0 1557 * 1558 * @param array $value See {@link BP_Button}. 1559 */ 1560 bp_get_button( apply_filters( 'bp_get_send_message_button_args', $r ) ) 1552 /** 1553 * Filters the "Private Message" button for member profile headers. 1554 * 1555 * @since 1.8.0 1556 * 1557 * @param array $button_args See {@link BP_Button}. 1558 */ 1559 return apply_filters( 'bp_get_send_message_button_args', $button_args ); 1560 } 1561 1562 /** 1563 * Generate the 'Private Message' button for member profile headers. 1564 * 1565 * @since 1.2.0 1566 * @since 3.0.0 Added `$args` parameter. 1567 * @since 11.0.0 uses `bp_get_send_message_button_args()`. 1568 * 1569 * @see bp_get_send_message_button_args() for description of parameters. 1570 * 1571 * @param array|string $args See {@link bp_get_send_message_button_args()}. 1572 * @return string 1573 */ 1574 function bp_get_send_message_button( $args = '' ) { 1575 $button_args = bp_get_send_message_button_args( $args ); 1576 1577 if ( ! array_filter( $button_args ) ) { 1578 return ''; 1579 } 1580 1581 /** This filter is documented in wp-includes/deprecated.php */ 1582 $button = apply_filters_deprecated( 1583 'bp_get_send_message_button', 1584 array( bp_get_button( $button_args ) ), 1585 '1.8.0', 1586 'bp_get_send_message_button_args' 1561 1587 ); 1588 1589 return $button; 1562 1590 } 1563 1591
Note: See TracChangeset
for help on using the changeset viewer.