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