本文整理汇总了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();
}
示例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');
}
示例3: action_plugin_deactivation
public function action_plugin_deactivation($plugin_file)
{
Post::deactivate_post_type('link');
}
示例4: uninstall
/**
* Remove stuff we installed
**/
public function uninstall()
{
Post::deactivate_post_type('project');
}
示例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');
}
示例6: action_plugin_deactivation
public function action_plugin_deactivation($file)
{
if (realpath($file) == __FILE__) {
Post::deactivate_post_type('snippet');
}
}
示例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');
}
}
示例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');
}
}
示例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');
}