PluginProbe
Social Media Auto Poster – Schedule & Publish to Buffer / 3.8.3
Social Media Auto Poster – Schedule & Publish to Buffer v3.8.3
6.2.3 6.2.2 6.2.1 6.2.0 6.1.2 6.1.1 6.1.0 6.0.9 6.0.8 6.0.7 6.0.6 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 6.0.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.8.8 All 124 releases
wp-to-buffer / includes / admin / activation.php

activation.php in Social Media Auto Poster – Schedule & Publish to Buffer 3.8.3, at includes/admin/activation.php

57 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Runs the installation and update routines when the plugin is activated.
4 *
5 * @since 3.0.0
6 *
7 * @param bool $network_wide Is network wide activation
8 */
9 function wp_to_buffer_activate( $network_wide ) {
10
11 // Initialise Plugin
12 $wp_to_buffer = WP_To_Buffer::get_instance();
13 $wp_to_buffer->initialize();
14
15 // Check if we are on a multisite install, activating network wide, or a single install
16 if ( ! is_multisite() || ! $network_wide ) {
17 // Single Site activation
18 $wp_to_buffer->get_class( 'install' )->install();
19 } else {
20 // Multisite network wide activation
21 $sites = get_sites( array(
22 'number' => 0,
23 ) );
24 foreach ( $sites as $site ) {
25 switch_to_blog( $site->blog_id );
26 $wp_to_buffer->get_class( 'install' )->install();
27 restore_current_blog();
28 }
29 }
30
31 }
32
33 /**
34 * Runs the installation and update routines when the plugin is activated
35 * on a WPMU site.
36 *
37 * @since 3.0.0
38 *
39 * @param mixed $site_or_blog_id WP_Site or Blog ID.
40 */
41 function wp_to_buffer_activate_new_site( $site_or_blog_id ) {
42
43 // Check if $site_or_blog_id is a WP_Site or a blog ID.
44 if ( is_a( $site_or_blog_id, 'WP_Site' ) ) {
45 $site_or_blog_id = $site_or_blog_id->blog_id;
46 }
47
48 // Initialise Plugin
49 $wp_to_buffer = WP_To_Buffer::get_instance();
50 $wp_to_buffer->initialize();
51
52 // Run installation routine
53 switch_to_blog( $site_or_blog_id );
54 $wp_to_buffer->get_class( 'install' )->install();
55 restore_current_blog();
56
57 }