| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | function for_every_podcast_blog( $callback ) { |
||
| 12 | |||
| 13 | global $wpdb; |
||
| 14 | |||
| 15 | $plugin = basename( \PodloveSubscribeButton\PLUGIN_DIR ) . '/' . \PodloveSubscribeButton\PLUGIN_FILE_NAME; |
||
| 16 | $blogids = $wpdb->get_col( "SELECT blog_id FROM " . $wpdb->blogs ); |
||
| 17 | |||
| 18 | if ( ! is_array( $blogids ) ) |
||
| 19 | return; |
||
| 20 | |||
| 21 | foreach ( $blogids as $blog_id ) { |
||
| 22 | switch_to_blog( $blog_id ); |
||
| 23 | if ( is_plugin_active( $plugin ) ) { |
||
| 24 | $callback(); |
||
| 25 | } |
||
| 26 | restore_current_blog(); |
||
| 27 | } |
||
| 44 |