當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Post::deactivate_post_type方法代碼示例

本文整理匯總了PHP中Post::deactivate_post_type方法的典型用法代碼示例。如果您正苦於以下問題:PHP Post::deactivate_post_type方法的具體用法?PHP Post::deactivate_post_type怎麽用?PHP Post::deactivate_post_type使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Post的用法示例。


在下文中一共展示了Post::deactivate_post_type方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: action_admin_theme_post_admin_cctypes

 /**
  * Respond to post requests on the admin_cctypes template
  *
  * @param AdminHandler $handler The admin handler object
  * @param Theme $theme The admin theme object
  */
 function action_admin_theme_post_admin_cctypes($handler, $theme)
 {
     $action = Controller::get_var('cct_action');
     switch ($action) {
         case 'addtype':
             Post::add_new_type($_POST['newtype']);
             $typeid = Post::type($_POST['newtype']);
             $handled = Options::get('cctypes_types');
             if (!is_array($handled)) {
                 $handled = array();
             }
             $handled[$typeid] = $typeid;
             array_unique($handled);
             Options::set('cctypes_types', $handled);
             Session::notice(_t('Added post type "' . $_POST['newtype'] . '".'));
             break;
         case 'deletetype':
             $typename = Post::type_name($_POST['deltype']);
             Post::deactivate_post_type($_POST['deltype']);
             $handled = Options::get('cctypes_types');
             if (isset($handled[$_POST['deltype']])) {
                 unset($handled[$_POST['deltype']]);
             }
             Options::set('cctypes_types', $handled);
             Session::notice(_t('Deactivated post type "' . $typename . '".'));
     }
     Utils::redirect();
 }
開發者ID:habari-extras,項目名稱:customctypes,代碼行數:34,代碼來源:customctypes.plugin.php

示例2: remove_template

 public function remove_template()
 {
     Post::deactivate_post_type('poll');
     $this->remove_template('widget', dirname(__FILE__) . '/widget.php');
     Stack::remove('template_header_javascript', Site::get_url('scripts') . '/jquery.js', 'jquery');
     Stack::remove('template_stylesheet', array(URL::get_from_filesystem(__FILE__) . '/widget.css', 'screen'), 'pollwigitcss');
     $this->remove_template('poll.single', dirname(__FILE__) . '/poll.single.php');
 }
開發者ID:habari-extras,項目名稱:polls,代碼行數:8,代碼來源:polls.plugin.php

示例3: action_plugin_deactivation

 public function action_plugin_deactivation($plugin_file)
 {
     Post::deactivate_post_type('link');
 }
開發者ID:habari-extras,項目名稱:linkblog,代碼行數:4,代碼來源:linkblog.plugin.php

示例4: uninstall

 /**
  * Remove stuff we installed
  **/
 public function uninstall()
 {
     Post::deactivate_post_type('project');
 }
開發者ID:habari-extras,項目名稱:mpango,代碼行數:7,代碼來源:mpango.plugin.php

示例5: action_plugin_deactivation

 /**
  * Hook on deactivation of this plugin
  */
 public function action_plugin_deactivation()
 {
     // when deactivating, don't destroy data, just turn it 'off'
     Post::deactivate_post_type('addon');
     ACL::destroy_token('manage_versions');
 }
開發者ID:habari-extras,項目名稱:addon_catalog,代碼行數:9,代碼來源:addon_catalog.plugin.php

示例6: action_plugin_deactivation

 public function action_plugin_deactivation($file)
 {
     if (realpath($file) == __FILE__) {
         Post::deactivate_post_type('snippet');
     }
 }
開發者ID:habari-extras,項目名稱:snippet,代碼行數:6,代碼來源:snippet.plugin.php

示例7: action_plugin_deactivation

 public function action_plugin_deactivation($plugin_file)
 {
     if (Plugins::id_from_file(__FILE__) == Plugins::id_from_file($plugin_file)) {
         Post::deactivate_post_type('podcast');
     }
 }
開發者ID:habari-extras,項目名稱:podcast,代碼行數:6,代碼來源:podcast.plugin.php

示例8: action_plugin_deactivation

 public function action_plugin_deactivation($file = '')
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         // @todo it has yet been decided whether or not this is a good idea - MellerTime
         /*
         // get all the posts of our update type, so we can delete them
         $posts = Posts::get( array( 'content_type' => 'plugin', 'nolimit' => true ) );
         
         foreach ( $posts as $post ) {
         
         	$post->delete();
         
         }
         */
         // deactivate our custom post type
         Post::deactivate_post_type('plugin');
     }
 }
開發者ID:ringmaster,項目名稱:plugin_directory,代碼行數:18,代碼來源:plugin_directory.plugin.php

示例9: uninstall

 /**
  * Set up needed permissions
  */
 private static function uninstall()
 {
     // Deactivate post types
     Post::deactivate_post_type('thread');
     Post::deactivate_post_type('forum');
     // Remove tokens
     ACL::destroy_token('forum_close_thread');
     ACL::destroy_token('forum_see_private');
 }
開發者ID:habari-extras,項目名稱:spreking,代碼行數:12,代碼來源:spreking.plugin.php


注:本文中的Post::deactivate_post_type方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。