2013-01-25 45 views
0

我在我的Wordpress插件中有一個PHP類,它是在網站中激活的。我想使用一個方法(doc_export函數),該方法在另一個插件(也在同一個網站中激活)在此類中定義。我添加這一個,它似乎工作:PHP:這是使用在類下定義的函數的正確方法嗎?

<?php 
     // Export doc 
     if (defined('DOC_ADMIN_MODE')) { 

      $my_Documentation = new Class_Documentation; 
      $mydocexport = $my_Documentation->doc_export(); 
      $mydocexport_file = ABSPATH . '_export/' . basename($site['site_url']) . '/doc.xml'; 
      file_put_contents($mydocexport_file, $mydocexport); 
     } 
?> 

我想知道這是否正確的做法..謝謝。

回答

相關問題