Changeset 5357 for sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-stickies-compat.php
- Timestamp:
- 04/18/2017 02:02:17 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-stickies-compat.php
r5301 r5357 32 32 add_filter( 'bbp_get_stickies', array( $this, 'get_compat_stickies' ), 10, 2 ); 33 33 34 // Make bbp_is_topic_sticky() recognize compat stickies. 35 add_filter( 'bbp_is_topic_sticky', array( $this, 'is_topic_sticky' ), 10, 2 ); 36 34 37 // Add topic toggle for compat authors. 35 38 add_action( 'bbp_get_request', array( $this, 'sticky_handler' ) ); … … 42 45 * Return empty array for super sticky topics in compat mode. 43 46 * 44 * @param array $stickies The super sticky topic ids45 * @return array An empty array 47 * @param array $stickies The super sticky topic IDs. 48 * @return array An empty array. 46 49 */ 47 50 public function get_super_stickies( $stickies ) { … … 52 55 * Return compat stickies for a given term. 53 56 * 54 * @param array $stickies The sticky topic ids55 * @param int $forum_id The forum id56 * @return array The sticky topic ids57 * @param array $stickies The sticky topic IDs. 58 * @param int $forum_id The forum ID. 59 * @return array The sticky topic IDs. 57 60 */ 58 61 public function get_compat_stickies( $stickies, $forum_id ) { … … 61 64 } 62 65 return $stickies; 66 } 67 68 /** 69 * Check whether a compat topic is sticky. 70 * 71 * @param bool $is_sticky Whether the topic is sticky. 72 * @param int $topic The topic ID. 73 * @return bool Whether the topic is sticky. 74 */ 75 public function is_topic_sticky( $is_sticky, $topic_id ) { 76 if ( $this->term && bbp_is_single_topic() ) { 77 $is_sticky = self::is_sticky( $this->term->term_id, $topic_id ); 78 } 79 return $is_sticky; 63 80 } 64 81
Note: See TracChangeset
for help on using the changeset viewer.