• 글쓴이
  • #8539

    wordcracker
    Keymaster

    함수를 사용하여 특정 플러그인을 활성화하는 방법

    // Activate BuddyPress
    // example on admin init, control about register_activation_hook() 
    add_action( 'admin_init', 'fb_activate_plugins' );
    // the exmple function
    function fb_activate_plugins() {
     
     If ( ! Current_user_can('activate_plugins') )
      wp_die(__('You do not have sufficient permissions to activate plugins for this site.'));
     $plugins = FALSE;
     $plugins = get_option('active_plugins'); // get active plugins
     
     If ( $plugins ) {
      // plugins to active
      $pugins_to_active = array(
       'buddypress/BP-loader.php'
      );
      
      foreach ( $pugins_to_active as $plugin ) {
       If ( ! In_array( $plugin, $plugins ) ) {
        array_push( $plugins, $plugin );
        update_option( 'active_plugins', $plugins );
       }
      }
      
     } // end if $plugins
     
    }

    참고: http://wpengineer.com/2300/activate-wordpress-plugins-automatically-via-a-function/

    함수를 통해 특정 플러그인 비활성화하는 방법
    참고: http://subharanjan.com/selectively-disable-plugins-on-wordpress-for-a-specific-request/

답변은 로그인 후 가능합니다.