78 | | preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $name ); |
79 | | preg_match( '|Plugin URI:(.*)$|mi', $plugin_data, $uri ); |
80 | | preg_match( '|Version:(.*)|i', $plugin_data, $version ); |
81 | | preg_match( '|Description:(.*)$|mi', $plugin_data, $description ); |
82 | | preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name ); |
83 | | preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri ); |
84 | | preg_match( '|Text Domain:(.*)$|mi', $plugin_data, $text_domain ); |
85 | | preg_match( '|Domain Path:(.*)$|mi', $plugin_data, $domain_path ); |
86 | | |
87 | | foreach ( array( 'name', 'uri', 'version', 'description', 'author_name', 'author_uri', 'text_domain', 'domain_path' ) as $field ) { |
| 78 | $default_headers = array( |
| 79 | 'Name'=>'Plugin Name', |
| 80 | 'PluginURI'=>'Plugin URI', |
| 81 | 'Version'=>'Version', |
| 82 | 'Description'=>'Description', |
| 83 | 'Author'=>'Author', |
| 84 | 'AuthorURI'=>'Author URI', |
| 85 | 'TextDomain'=>'Text Domain', |
| 86 | 'DomainPath'=>'Domain Path' |
| 87 | ); |
| 88 | $extra_headers = apply_filters( 'plugin_headers', array()); |
| 89 | $all_headers = array_merge($extra_headers, $default_headers); |
| 90 | |
| 91 | foreach ( $all_headers as $field => $regex ) { |
| 92 | preg_match('/' . preg_quote($regex, '/') . ':(.*)$/mi', $plugin_data, ${$field}); |
| 93 | |