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


PHP Posts::update_scheduled_posts_cronjob方法代码示例

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


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

示例1: undelete_post

 /**
  * function undelete_post
  * This function reverts a post's status from 'deleted' to whatever
  * it previously was.
  **/
 private function undelete_post($post_id)
 {
     $post = Post::get(array('id' => $post_id, 'status' => Post::status('any')));
     if ($post->status == Post::status('deleted')) {
         $post->status = $post->info->prior_status ? $post->info->prior_status : Post::status('draft');
         unset($post->info->prior_status);
         $post->update();
         EventLog::log(sprintf(_t('Post %1$s (%2$s) restored.'), $post->id, $post->slug), 'info', 'content', 'habari');
         //scheduled post
         if ($post->status == Post::status('scheduled')) {
             Posts::update_scheduled_posts_cronjob();
         }
         return true;
     } else {
         return false;
     }
 }
开发者ID:anupom,项目名称:my-blog,代码行数:22,代码来源:undelete.plugin.php

示例2: delete

	/**
	 * function delete
	 * Deletes an existing post
	 */
	public function delete()
	{
		$allow = true;
		$allow = Plugins::filter( 'post_delete_allow', $allow, $this );
		if ( ! $allow ) {
			return;
		}
		// invoke plugins
		Plugins::act( 'post_delete_before', $this );

		// delete all the tags associated with this post
		Tags::save_associations( new Terms(), $this->id );

		// Delete all comments associated with this post
		if ( $this->comments->count() > 0 ) {
			$this->comments->delete();
		}
		// Delete all info records associated with this post
			$this->info->delete_all();
		// Delete all post_tokens associated with this post
		$this->delete_tokens();

		$result = parent::deleteRecord( DB::table( 'posts' ), array( 'slug'=>$this->slug ) );
		EventLog::log( sprintf( _t( 'Post %1$s (%2$s) deleted.' ), $this->id, $this->slug ), 'info', 'content', 'habari' );

		//scheduled post
		if ( $this->status == Post::status( 'scheduled' ) ) {
			Posts::update_scheduled_posts_cronjob();
		}

		// invoke plugins on the after_post_delete action
		Plugins::act( 'post_delete_after', $this );
		return $result;
	}
开发者ID:rynodivino,项目名称:system,代码行数:38,代码来源:post.php


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