Changeset 10088
- Timestamp:
- 07/22/2020 03:06:25 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-block-plugin-checker.php
r10085 r10088 55 55 56 56 /** 57 * Magic accessor method, for read-only access to internals. 58 * 59 * @param string $name Property name. 60 */ 61 public function __get( $name ) { 62 if ( property_exists( $this, $name ) ) { 63 return $this->$name; 64 } 65 } 66 67 /** 57 68 * Getter function for results. 58 69 */ … … 69 80 70 81 return $out; 82 } 83 84 /** 85 * Return a trac/github browser link to a file in the plugin. 86 * 87 * @param string $file The file pathname. 88 */ 89 public function get_browser_url( $file ) { 90 if ( !empty( $this->repo_url ) ) { 91 $file = $this->relative_filename( $file ); 92 if ( 0 === strpos( $this->repo_url, 'https://github.com' ) ) { 93 return str_replace( '.git/trunk', '/blob/master', $this->repo_url ) . '/' . $file; 94 } elseif ( 0 === strpos( $this->repo_url, 'https://plugins.svn.wordpress.org' ) ) { 95 return str_replace( 'https://plugins.svn.wordpress.org', 'https://plugins.trac.wordpress.org/browser', $this->repo_url ) . '/' . $file; 96 } 97 } 71 98 } 72 99
Note: See TracChangeset
for help on using the changeset viewer.