Changeset 10768 for sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/watchlist.php
- Timestamp:
- 03/05/2021 12:05:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/watchlist.php
r10187 r10768 3 3 class WPorg_Handbook_Watchlist { 4 4 5 private static $post_types = array( 'handbook' );5 private static $post_types; 6 6 7 7 public static function init() { … … 10 10 11 11 public static function on_init() { 12 self::$post_types = (array) apply_filters( 'handbook_post_types', self::$post_types ); 13 self::$post_types = array_map( array( __CLASS__, 'append_suffix' ), self::$post_types ); 12 self::$post_types = WPorg_Handbook_Init::get_post_types(); 14 13 15 14 add_action( 'p2_action_links', array(__CLASS__, 'display_action_link'), 100 ); 16 15 add_filter( 'o2_filter_post_actions', array( __CLASS__, 'add_o2_action_link' ) ); 17 16 add_filter( 'o2_filter_post_action_html', array( __CLASS__, 'get_o2_action_link' ), 10, 2 ); 18 }19 20 /**21 * Appends '-handbook' to the dynamic post type, if not already 'handbook'.22 *23 * @param string $t Hanbook post type name.24 * @return string25 */26 private static function append_suffix( $t ) {27 if ( in_array( $t, array( 'handbook', 'page' ) ) ) {28 return $t;29 }30 31 return $t . '-handbook';32 17 } 33 18
Note: See TracChangeset
for help on using the changeset viewer.