Changeset 8530 for trunk/src/bp-activity/bp-activity-functions.php
- Timestamp:
- 06/15/2014 06:22:12 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-functions.php
r8529 r8530 16 16 * Check whether the $bp global lists an activity directory page. 17 17 * 18 * @since BuddyPress (1.5 )18 * @since BuddyPress (1.5.0) 19 19 * 20 20 * @global object $bp BuddyPress global settings … … 43 43 * add_filter( 'bp_activity_do_mentions', '__return_false' ); 44 44 * 45 * @since BuddyPress (1.8 )45 * @since BuddyPress (1.8.0) 46 46 * 47 47 * @uses apply_filters() To call 'bp_activity_do_mentions' hook. … … 56 56 * Locate usernames in an activity content string, as designated by an @ sign. 57 57 * 58 * @since BuddyPress (1.5) 59 * 60 * @param string $content The content of the activity, usually found in $activity->content. 61 * @return array|bool Associative array with user ID as key and username as value. Boolean false if no mentions found. 58 * @since BuddyPress (1.5.0) 59 * 60 * @param string $content The content of the activity, usually found in 61 * $activity->content. 62 * @return array|bool Associative array with user ID as key and username as 63 * value. Boolean false if no mentions found. 62 64 */ 63 65 function bp_activity_find_mentions( $content ) { … … 90 92 * Reset a user's unread mentions list and count. 91 93 * 92 * @since BuddyPress (1.5 )94 * @since BuddyPress (1.5.0) 93 95 * 94 96 * @uses bp_delete_user_meta() … … 109 111 * Currently, only used in {@link bp_activity_delete()}. 110 112 * 111 * @since BuddyPress (1.5 )113 * @since BuddyPress (1.5.0) 112 114 * 113 115 * @uses bp_activity_find_mentions() … … 143 145 * for @mentions. 144 146 * 145 * @since BuddyPress (1.7 )147 * @since BuddyPress (1.7.0) 146 148 * 147 149 * @uses bp_get_user_meta() … … 318 320 * Retreive the current action from a component and key. 319 321 * 320 * @since BuddyPress (1.1 )322 * @since BuddyPress (1.1.0) 321 323 * 322 324 * @global object $bp BuddyPress global settings. … … 340 342 * Fetch details of all registered activity types. 341 343 * 342 * @since BuddyPress (1.7 )344 * @since BuddyPress (1.7.0) 343 345 * 344 346 * @return array array( type => description ), ... … … 366 368 * Get a users favorite activity stream items. 367 369 * 368 * @since BuddyPress (1.2 )370 * @since BuddyPress (1.2.0) 369 371 * 370 372 * @uses bp_get_user_meta() … … 389 391 * Add an activity stream item as a favorite for a user. 390 392 * 391 * @since BuddyPress (1.2 )393 * @since BuddyPress (1.2.0) 392 394 * 393 395 * @uses is_user_logged_in() … … 454 456 * Remove an activity stream item as a favorite for a user. 455 457 * 456 * @since BuddyPress (1.2 )458 * @since BuddyPress (1.2.0) 457 459 * 458 460 * @uses is_user_logged_in() … … 523 525 * Check whether an activity item exists with a given content string. 524 526 * 525 * @since BuddyPress (1.1 )527 * @since BuddyPress (1.1.0) 526 528 * 527 529 * @uses BP_Activity_Activity::check_exists_by_content() {@link BP_Activity_Activity} … … 538 540 * Retrieve the last time activity was updated. 539 541 * 540 * @since BuddyPress (1.0 )542 * @since BuddyPress (1.0.0) 541 543 * 542 544 * @uses BP_Activity_Activity::get_last_updated() {@link BP_Activity_Activity} … … 552 554 * Retrieve the number of favorite activity stream items a user has. 553 555 * 554 * @since BuddyPress (1.2 )556 * @since BuddyPress (1.2.0) 555 557 * 556 558 * @uses BP_Activity_Activity::total_favorite_count() {@link BP_Activity_Activity} … … 618 620 * Get metadata for a given activity item. 619 621 * 620 * @since BuddyPress (1.2 )622 * @since BuddyPress (1.2.0) 621 623 * 622 624 * @uses apply_filters() To call the 'bp_activity_get_meta' hook. … … 643 645 * Update a piece of activity meta. 644 646 * 645 * @since BuddyPress (1.2 )647 * @since BuddyPress (1.2.0) 646 648 * 647 649 * @param int $activity_id ID of the activity item whose metadata is being … … 690 692 * Completely remove a user's activity data. 691 693 * 692 * @since BuddyPress (1.5 )694 * @since BuddyPress (1.5.0) 693 695 * 694 696 * @uses is_user_logged_in() … … 725 727 * Mark all of the user's activity as spam. 726 728 * 727 * @since BuddyPress (1.6 )729 * @since BuddyPress (1.6.0) 728 730 * 729 731 * @global object $wpdb WordPress database access object. … … 778 780 * Mark all of the user's activity as ham (not spam). 779 781 * 780 * @since BuddyPress (1.6 )782 * @since BuddyPress (1.6.0) 781 783 * 782 784 * @global object $wpdb WordPress database access object. … … 831 833 * Register the activity stream actions for updates 832 834 * 833 * @since BuddyPress (1.6 )835 * @since BuddyPress (1.6.0) 834 836 * 835 837 * @global object $bp BuddyPress global settings. … … 936 938 * - 'per_page' (false) 937 939 * 938 * @since BuddyPress (1.2 )940 * @since BuddyPress (1.2.0) 939 941 * 940 942 * @see BP_Activity_Activity::get() For more information on accepted arguments … … 1026 1028 * Fetch specific activity items. 1027 1029 * 1028 * @since BuddyPress (1.2 )1030 * @since BuddyPress (1.2.0) 1029 1031 * 1030 1032 * @see BP_Activity_Activity::get() For more information on accepted arguments … … 1072 1074 * Add an activity item. 1073 1075 * 1074 * @since BuddyPress (1.1 )1076 * @since BuddyPress (1.1.0) 1075 1077 * 1076 1078 * @uses wp_parse_args() … … 1171 1173 * Post an activity update. 1172 1174 * 1173 * @since BuddyPress (1.2 )1175 * @since BuddyPress (1.2.0) 1174 1176 * 1175 1177 * @global object $bp BuddyPress global settings. … … 1233 1235 * Add an activity comment. 1234 1236 * 1235 * @since BuddyPress (1.2 )1237 * @since BuddyPress (1.2.0) 1236 1238 * 1237 1239 * @global object $bp BuddyPress global settings. … … 1248 1250 * @type string $content The content of the comment. 1249 1251 * @type int $user_id Optional. The ID of the user making the comment. 1250 * 1252 * Defaults to the ID of the logged-in user. 1251 1253 * @type int $activity_id The ID of the "root" activity item, ie the oldest 1252 * 1254 * ancestor of the comment. 1253 1255 * @type int $parent_id Optional. The ID of the parent activity item, ie the 1254 * item to which the comment is an immediate reply. If1255 * not provided,this value defaults to the $activity_id.1256 * item to which the comment is an immediate reply. If not provided, 1257 * this value defaults to the $activity_id. 1256 1258 * } 1257 1259 * @return int|bool The ID of the comment on success, otherwise false. … … 1315 1317 * Fetch the activity_id for an existing activity entry in the DB. 1316 1318 * 1317 * @since BuddyPress (1.2 )1319 * @since BuddyPress (1.2.0) 1318 1320 * 1319 1321 * @see BP_Activity_Activity::get() For more information on accepted arguments. … … 1355 1357 * If you are deleting an activity comment please use bp_activity_delete_comment(); 1356 1358 * 1357 * @since BuddyPress (1.0 )1359 * @since BuddyPress (1.0.0) 1358 1360 * 1359 1361 * @see BP_Activity_Activity::get() For more information on accepted arguments. … … 1427 1429 * You should use bp_activity_delete() instead. 1428 1430 * 1429 * @since BuddyPress (1.1 )1431 * @since BuddyPress (1.1.0) 1430 1432 * @deprecated BuddyPress (1.2) 1431 1433 * … … 1455 1457 * Delete an activity item by activity id. 1456 1458 * 1457 * @since BuddyPress (1.1 )1459 * @since BuddyPress (1.1.0) 1458 1460 * 1459 1461 * @uses bp_activity_delete() … … 1471 1473 * You should use bp_activity_delete() instead. 1472 1474 * 1473 * @since BuddyPress (1.1 )1475 * @since BuddyPress (1.1.0) 1474 1476 * @deprecated BuddyPress (1.2) 1475 1477 * … … 1491 1493 * You should use bp_activity_delete() instead. 1492 1494 * 1493 * @since BuddyPress (1.1 )1495 * @since BuddyPress (1.1.0) 1494 1496 * @deprecated BuddyPress (1.2) 1495 1497 * … … 1507 1509 * Delete an activity comment. 1508 1510 * 1509 * @since BuddyPress (1.2 )1511 * @since BuddyPress (1.2.0) 1510 1512 * 1511 1513 * @uses apply_filters() To call the 'bp_activity_delete_comment_pre' hook. … … 1550 1552 * Delete an activity comment's children. 1551 1553 * 1552 * @since BuddyPress (1.2 )1554 * @since BuddyPress (1.2.0) 1553 1555 * 1554 1556 * @uses BP_Activity_Activity::get_child_comments() {@link BP_Activity_Activity} … … 1557 1559 * 1558 1560 * @param int $activity_id The ID of the "root" activity, ie the 1559 * 1561 * comment's oldest ancestor. 1560 1562 * @param int $comment_id The ID of the comment to be deleted. 1561 1563 */ … … 1578 1580 * have it available. 1579 1581 * 1580 * @since BuddyPress (1.2 )1582 * @since BuddyPress (1.2.0) 1581 1583 * 1582 1584 * @uses bp_get_root_domain() … … 1613 1615 * Hide a user's activity. 1614 1616 * 1615 * @since BuddyPress (1.2 )1617 * @since BuddyPress (1.2.0) 1616 1618 * 1617 1619 * @uses BP_Activity_Activity::hide_all_for_user() {@link BP_Activity_Activity} … … 1634 1636 * and removes the rest of the images from the string. 1635 1637 * 1636 * @since BuddyPress (1.2 )1638 * @since BuddyPress (1.2.0) 1637 1639 * 1638 1640 * @uses esc_attr() … … 1641 1643 * @param string $content The content of the activity item. 1642 1644 * @param string $link Optional. The unescaped URL that the image should link 1643 * 1645 * to. If absent, the image will not be a link. 1644 1646 * @param array $activity_args Optional. The args passed to the activity 1645 * 1647 * creation function (eg bp_blogs_record_activity()). 1646 1648 * @return string $content The content with images stripped and replaced with a 1647 * 1649 * single thumb. 1648 1650 */ 1649 1651 function bp_activity_thumbnail_content_images( $content, $link = false, $args = false ) { … … 1691 1693 * Fetch whether the current user is allowed to mark items as spam. 1692 1694 * 1693 * @since BuddyPress (1.6 )1695 * @since BuddyPress (1.6.0) 1694 1696 * 1695 1697 * @return bool True if user is allowed to mark activity items as spam. … … 1702 1704 * Mark an activity item as spam. 1703 1705 * 1704 * @since BuddyPress (1.6 )1706 * @since BuddyPress (1.6.0) 1705 1707 * 1706 1708 * @global object $bp BuddyPress global settings. … … 1708 1710 * @param BP_Activity_Activity $activity The activity item to be spammed. 1709 1711 * @param string $source Optional. Default is "by_a_person" (ie, a person has 1710 * manually marked the activity as spam). BP core also1711 * accepts'by_akismet'.1712 * manually marked the activity as spam). BP core also accepts 1713 * 'by_akismet'. 1712 1714 */ 1713 1715 function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) { … … 1742 1744 * Mark an activity item as ham. 1743 1745 * 1744 * @since BuddyPress (1.6 )1746 * @since BuddyPress (1.6.0) 1745 1747 * 1746 1748 * @global object $bp BuddyPress global settings. … … 1748 1750 * @param BP_Activity_Activity $activity The activity item to be hammed. 1749 1751 * @param string $source Optional. Default is "by_a_person" (ie, a person has 1750 * manually marked the activity as spam). BP core also1751 * accepts'by_akismet'.1752 * manually marked the activity as spam). BP core also accepts 1753 * 'by_akismet'. 1752 1754 */ 1753 1755 function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) { … … 1792 1794 * For that, see {@link bp_activity_comment_embed()}. 1793 1795 * 1794 * @since BuddyPress (1.5 )1796 * @since BuddyPress (1.5.0) 1795 1797 * 1796 1798 * @see BP_Embed … … 1816 1818 * the cache if they are not there yet. 1817 1819 * 1818 * @since BuddyPress (1.5 )1820 * @since BuddyPress (1.5.0) 1819 1821 * 1820 1822 * @see BP_Embed … … 1835 1837 * When a user clicks on a "Read More" item, make sure embeds are correctly parsed and shown for the expanded content. 1836 1838 * 1837 * @since BuddyPress (1.5 )1839 * @since BuddyPress (1.5.0) 1838 1840 * 1839 1841 * @see BP_Embed … … 1863 1865 * once the comments are done being processed. 1864 1866 * 1865 * @since BuddyPress (1.5 )1867 * @since BuddyPress (1.5.0) 1866 1868 * 1867 1869 * @see bp_activity_comment_embed() … … 1878 1880 * Used during {@link BP_Embed::parse_oembed()} via {@link bp_activity_embed()}. 1879 1881 * 1880 * @since BuddyPress (1.5 )1882 * @since BuddyPress (1.5.0) 1881 1883 * 1882 1884 * @see BP_Embed::parse_oembed() … … 1884 1886 * 1885 1887 * @param string $cache An empty string passed by BP_Embed::parse_oembed() for 1886 * 1888 * functions like this one to filter. 1887 1889 * @param int $id The ID of the activity item. 1888 1890 * @param string $cachekey The cache key generated in BP_Embed::parse_oembed(). … … 1898 1900 * Used during {@link BP_Embed::parse_oembed()} via {@link bp_activity_embed()}. 1899 1901 * 1900 * @since BuddyPress (1.5 )1902 * @since BuddyPress (1.5.0) 1901 1903 * 1902 1904 * @see BP_Embed::parse_oembed() … … 1904 1906 * 1905 1907 * @param string $cache An empty string passed by BP_Embed::parse_oembed() for 1906 * 1908 * functions like this one to filter. 1907 1909 * @param int $id The ID of the activity item. 1908 1910 * @param string $cachekey The cache key generated in BP_Embed::parse_oembed().
Note: See TracChangeset
for help on using the changeset viewer.