프리미엄 WP 테마 플러그인 무료 다운로드

함수를 통해 특정 플러그인 활성화하기/비활성화기

질문 제출 Forums 자유게시판 함수를 통해 특정 플러그인 활성화하기/비활성화기

Viewing 0 reply threads
  • Author
    Posts

    • Word Cracker
      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/

Viewing 0 reply threads

The forum ‘자유게시판’ is closed to new topics and replies.