2017-02-06 6 views

答えて

0

あなたは埋め込みプラグインとしてあなたのテーマでメールプラグインプラグインを使用することはできません。しかし、TGMプラグインアクティベーションファイルを使用して、テーマにプラグインを含めることができます。

<?php 

require get_template_directory() . '/class-tgm-plugin-activation.php'; //add your file path where you put the file 

add_action('tgmpa_register', 'something_register_required_plugins'); 

function something_register_required_plugins() { 

    $plugins = array(

     array(
      'name'  => 'Mailchimp', 
      'slug'  => 'mailchimp', 
      'required' => true, 
     ), 

    ); 

    $config = array(
     'id'   => 'something',    // Unique ID for hashing notices for multiple instances of TGMPA. 
     'default_path' => '',      // Default absolute path to bundled plugins. 
     'menu'   => 'tgmpa-install-plugins', // Menu slug. 
     'parent_slug' => 'themes.php',   // Parent menu slug. 
     'capability' => 'edit_theme_options', // Capability needed to view plugin install page, should be a capability associated with the parent menu used. 
     'has_notices' => true,     // Show admin notices or not. 
     'dismissable' => true,     // If false, a user cannot dismiss the nag message. 
     'dismiss_msg' => '',      // If 'dismissable' is false, this message will be output at top of nag. 
     'is_automatic' => false,     // Automatically activate plugins after installation or not. 
     'message'  => '',      // Message to output right before the plugins table. 
    ); 

    tgmpa($plugins, $config); 
} 
?> 

これはmailchimpプラグインをインストールするユーザーに提案を作成します。.. TGM plugin activation classここからTGMクラスファイルのコピーをダウンロードして、ちょうどあなたのテーマディレクトリにclass-tgm-plugin-activation.phpファイルをコピーして、あなたのテーマのfunctions.phpファイルへのコードの下に追加wordpress.orgのリポジトリ

から
関連する問題