Changeset 13061 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php
- Timestamp:
- 12/15/2023 03:08:48 AM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php
r13035 r13061 726 726 * 727 727 * @param int|\WP_Post|null $post Optional. Post ID or post object. Defaults to global $post. 728 * @param 'view'|'edit' $context Optional. 'view' to check if preview is available for public viewing. 'edit' to also check if available for current user to test. Default: view. 728 729 * @return bool True if a preview is available and the current user is permitted to see it. 729 730 */ 730 public static function is_preview_available( $post = null ) {731 public static function is_preview_available( $post = null, $context = 'view' ) { 731 732 732 733 if ( self::preview_link( $post ) ) { 733 // Plugin committers can always use the plugin preview button if it exists.734 if ( current_user_can( 'plugin_admin_edit', $post ) ) {734 // Plugin committers can use the plugin preview button to test if a blueprint exists. 735 if ( 'edit' === $context && current_user_can( 'plugin_admin_edit', $post ) ) { 735 736 return true; 736 737 }
Note: See TracChangeset
for help on using the changeset viewer.