当前位置: 首页>>代码示例>>PHP>>正文


PHP option::delete方法代码示例

本文整理汇总了PHP中option::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP option::delete方法的具体用法?PHP option::delete怎么用?PHP option::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在option的用法示例。


在下文中一共展示了option::delete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: check_update

 /**
  * Adds notifications if there are new theme version available.
  * Runs on time a day
  *
  * @return void
  */
 public static function check_update()
 {
     $lastChecked = (int) option::get('theme_last_checked');
     $temp_version = get_transient('wpzoom_temp_theme_version');
     // force a check if we think theme was updated
     if (!$temp_version) {
         set_transient('wpzoom_temp_theme_version', WPZOOM::$themeVersion);
     } else {
         if (version_compare($temp_version, WPZOOM::$themeVersion, '!=')) {
             $lastChecked = 0;
             set_transient('wpzoom_temp_theme_version', WPZOOM::$themeVersion);
         }
     }
     if ($lastChecked == 0 || $lastChecked + 60 * 60 * 24 < time()) {
         if (self::has_update()) {
             option::set('theme_status', 'needs_update');
         } else {
             option::delete('theme_status');
         }
         option::set('theme_last_checked', time());
     }
     if (option::get('theme_status') == 'needs_update' && current_user_can('update_themes')) {
         add_action('admin_notices', array(__CLASS__, 'notification'));
     }
 }
开发者ID:aaronfrey,项目名称:PepperLillie-FiveVirtues,代码行数:31,代码来源:theme-updater.php

示例2: ajax

 public static function ajax()
 {
     if ($_POST['type'] == 'framework-notification-hide') {
         option::set('framework_last_checked', time() + 60 * 60 * 48);
         option::delete('framework_status');
         die;
     }
     if ($_POST['type'] == 'theme-notification-hide') {
         option::set('theme_last_checked', time() + 60 * 60 * 48);
         option::delete('theme_status');
         die;
     }
     die;
 }
开发者ID:siriuzwhite,项目名称:alpha,代码行数:14,代码来源:updater.php

示例3: real_del

            $mark = new mark();
            $markData = array('source' => 'topic', 'source_id' => $topic_ids, 'state' => $state, 'type_state' => 'team');
            $mark->update_mark_state($markData);
            if ($state == 0) {
                //删除话题搜索
                $this->teamApi->delete_search($topic_ids, 'topic');
            } elseif ($state == 1) {
                //插入话题搜索
                $this->teamApi->add_search($topic_ids, 'topic');
            }
            //删除话题
            $this->topic->update(array('state' => $state, 'type_state' => 'team'), $topic_ids);
        }
    }
    /**
	 * 删除小组所有信息
	 * @param String $ids
	 */
    public function real_del()
    {
        $team_ids = trim(urldecode($this->input['team_id']));
        //删除小组的关注
        $option = new option();
        $attenData = array('source' => 'team', 'source_id' => $team_ids, 'action' => 'attention');
        $option->delete($attenData);
        //删除小组的标签
        $mark = new mark();
        $markData = array('source' => 'team', 'source_id' => $team_ids, 'action' => 'team_tag');
        $mark->delete_source_id_mark($markData);
        //删除小组的主题标签
        $themeMarkData = array('source' => 'team', 'source_id' => $team_ids, 'action' => 'team_theme');
        $mark->delete_source_id_mark($themeMarkData);
        //删除小组下的行动召集者
        $this->team->del_apply($team_ids);
        //删除小组下的黑名单
开发者ID:h3len,项目名称:Project,代码行数:35,代码来源:team_update.php

示例4: update_init

 /**
  * Checks if we are going to make an update and updates current framework to latest version
  */
 public static function update_init()
 {
     global $r;
     if (!isset($_GET['page'])) {
         return;
     }
     $requestedPage = strtolower(strip_tags(trim($_REQUEST['page'])));
     if ($requestedPage != 'wpzoom_update') {
         return;
     }
     $fsmethod = get_filesystem_method();
     $fs = WP_Filesystem();
     if ($fs == false) {
         function framework_update_filesystem_warning()
         {
             $method = get_filesystem_method();
             echo "<p>Failed: Filesystem preventing downloads. ({$method})</p>";
         }
         add_action('admin_notices', 'framework_update_filesystem_warning');
         return;
     }
     if (isset($_POST['wpzoom-update-do'])) {
         $action = strtolower(trim(strip_tags($_POST['wpzoom-update-do'])));
         if ($action == 'update') {
             $fwUrl = 'http://framework.wpzoom.com/wpzoom-framework.zip';
             $fwFile = download_url($fwUrl);
             if (is_wp_error($fwUrl)) {
                 $error = $fwFile->get_error_code();
                 if ($error == 'http_no_url') {
                     $r = "<p>Failed: Invalid URL Provided</p>";
                 } else {
                     $r = "<p>Failed: Upload - {$error}</p>";
                 }
                 function framework_update_warning()
                 {
                     global $r;
                     echo "<p>{$r}</p>";
                 }
                 add_action('admin_notices', 'framework_update_warning');
                 return;
             }
         }
         global $wp_filesystem;
         $to = WPZOOM::get_wpzoom_root();
         $dounzip = unzip_file($fwFile, $to);
         unlink($fwFile);
         if (is_wp_error($dounzip)) {
             $error = $dounzip->get_error_code();
             $data = $dounzip->get_error_data($error);
             if ($error == 'incompatible_archive') {
                 //The source file was not found or is invalid
                 function framework_update_no_archive_warning()
                 {
                     echo "<p>Failed: Incompatible archive</p>";
                 }
                 add_action('admin_notices', 'framework_update_no_archive_warning');
             }
             if ($error == 'empty_archive') {
                 function framework_update_empty_archive_warning()
                 {
                     echo "<p>Failed: Empty Archive</p>";
                 }
                 add_action('admin_notices', 'framework_update_empty_archive_warning');
             }
             if ($error == 'mkdir_failed') {
                 function framework_update_mkdir_warning()
                 {
                     echo "<p>Failed: mkdir Failure</p>";
                 }
                 add_action('admin_notices', 'framework_update_mkdir_warning');
             }
             if ($error == 'copy_failed') {
                 function framework_update_copy_fail_warning()
                 {
                     echo "<p>Failed: Copy Failed</p>";
                 }
                 add_action('admin_notices', 'update_copy_fail_warning');
             }
             return;
         }
         function framework_updated_success()
         {
             echo '<div class="updated fade"><p>New framework successfully downloaded, extracted and updated.</p></div>';
         }
         add_action('admin_notices', 'framework_updated_success');
         remove_action('admin_notices', array('WPZOOM', 'notification'));
         option::delete('framework_status');
         option::set('framework_last_checked', time());
     }
 }
开发者ID:siriuzwhite,项目名称:alpha,代码行数:93,代码来源:framework-updater.php

示例5: explode

        $start = false;
        $changelog = WPZOOM_Framework_Updater::get_changelog();
        $changelog = explode("\n", $changelog);
        foreach ($changelog as $line) {
            if (preg_match("/v ((?:\\d+(?!\\.\\*)\\.)+)(\\d+)?(\\.\\*)?/i", $line)) {
                $start = true;
                echo '<h4>' . $line . '</h4>';
            } elseif ($start && trim($line)) {
                echo '<pre>' . $line . '</pre>';
            }
        }
        ?>
            </div>
            <?php 
    }
    ?>
        <?php 
} else {
    ?>
            <p>&rarr; <strong>You are using latest framework version:</strong> <?php 
    echo $localVersion;
    ?>
</p>
            <?php 
    option::delete('framework_status');
    ?>
        <?php 
}
?>
</div><!-- end .wrap -->
开发者ID:aaronfrey,项目名称:PepperLillie-FiveVirtues,代码行数:30,代码来源:update.php

示例6: audit

		$this->addItem($result);
		$this->output();
	}
	*/
    /*
	//批量审核话题数据
	public function audit()
	{	
		$topic_ids = $this->validate_data();
		$result = $this->topic->update(array('state' => 1), $topic_ids);
		$this->setXmlNode('topic_info', 'topic');
		$this->addItem($result);
		$this->output();
	}
	*/
    /*
	//批量打回(屏蔽)话题数据
	public function back()
	{
		$topic_ids = $this->validate_data();
		$result = $this->topic->update(array('state' => -1), $topic_ids);
		$this->setXmlNode('topic_info', 'topic');
		$this->addItem($result);
		$this->output();
	}
开发者ID:h3len,项目名称:Project,代码行数:25,代码来源:topic_update.php


注:本文中的option::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。