Changeset 5163 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php
- Timestamp:
- 03/22/2017 07:23:39 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php
r5159 r5163 259 259 260 260 return in_array( $view_id, wporg_support_get_compat_views() ); 261 } 262 263 /** 264 * Get current plugin or theme object in plugin- or theme-specific views. 265 * 266 * @return object|null Plugin or theme object on success, null on failure. 267 */ 268 function wporg_support_get_compat_object() { 269 if ( ! class_exists( 'WordPressdotorg\Forums\Plugin' ) ) { 270 return null; 271 } 272 273 $object = null; 274 $plugin_instance = WordPressdotorg\Forums\Plugin::get_instance(); 275 276 if ( ! empty( $plugin_instance->plugins->plugin ) ) { 277 $object = $plugin_instance->plugins->plugin; 278 279 /* translators: %s: link to plugin support or review forum */ 280 $object->prefixed_title = sprintf( __( 'Plugin: %s', 'wporg-forums' ), $object->post_title ); 281 $object->type = 'plugin'; 282 } elseif ( ! empty( $plugin_instance->themes->theme ) ) { 283 $object = $plugin_instance->themes->theme; 284 285 /* translators: %s: link to theme support or review forum */ 286 $object->prefixed_title = sprintf( __( 'Theme: %s', 'wporg-forums' ), $object->post_title ); 287 $object->type = 'theme'; 288 } 289 290 return $object; 261 291 } 262 292
Note: See TracChangeset
for help on using the changeset viewer.