| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Get Pronamic plugins |
| 5 |
* |
| 6 |
* @link https://developer.wordpress.org/reference/functions/get_plugins/ |
| 7 |
* @return array|false |
| 8 |
*/ |
| 9 |
function pronamic_client_get_plugins() { |
| 10 |
if ( ! function_exists( 'get_plugins' ) ) { |
| 11 |
return false; |
| 12 |
} |
| 13 |
|
| 14 |
$pronamic_plugins = []; |
| 15 |
|
| 16 |
$plugins = get_plugins(); |
| 17 |
|
| 18 |
foreach ( $plugins as $file => $plugin ) { |
| 19 |
if ( isset( $plugin['Author'] ) && false !== strpos( $plugin['Author'], 'Pronamic' ) ) { |
| 20 |
$pronamic_plugins[ $file ] = $plugin; |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
return $pronamic_plugins; |
| 25 |
} |
| 26 |
|
| 27 |
/** |
| 28 |
* Get Pronamic themes |
| 29 |
* |
| 30 |
* @return array |
| 31 |
*/ |
| 32 |
function pronamic_client_get_themes() { |
| 33 |
if ( ! function_exists( 'wp_get_themes' ) ) { |
| 34 |
return false; |
| 35 |
} |
| 36 |
|
| 37 |
$pronamic_themes = []; |
| 38 |
|
| 39 |
$themes = wp_get_themes(); |
| 40 |
|
| 41 |
foreach ( $themes as $slug => $theme ) { |
| 42 |
if ( isset( $theme['Author'] ) && false !== strpos( $theme['Author'], 'Pronamic' ) ) { |
| 43 |
$pronamic_themes[ $slug ] = $theme; |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
return $pronamic_themes; |
| 48 |
} |
| 49 |
|