Ejemplo n.º 1
0
	/**
	 * Sets the content gateway pages publish status
	 * 
	 * @since 1.1
	 *
	 * @param string $mode The publish status (publish or draft)
	 * @return void
	 **/
	function pages_status ($mode) {
		global $wpdb;
		$status = array('publish','draft');
		if (!in_array($mode,$status)) return;

		$_ = array();
		$pages = ecart_locate_pages();
		foreach ($pages as $page) if (!empty($page['id'])) $_[] = $page['id'];
		if (!empty($_)) $wpdb->query("UPDATE $wpdb->posts SET post_status='$mode' WHERE 0<FIND_IN_SET(ID,'".join(',',$_)."')");
	}
Ejemplo n.º 2
0
	/**
	 * Relocates the Ecart-installed pages and indexes any changes
	 *
	 * @since 1.0
	 *
	 * @param boolean $update (optional) Used in a filter callback context
	 * @param boolean $updates (optional) Used in an action callback context
	 * @return boolean The update status
	 **/
	function pages_index ($update=false,$updates=false) {
		global $wpdb;
		$pages = $this->Settings->get('pages');
		$pages = ecart_locate_pages();
		$this->Settings->save('pages',$pages);
		if ($update) return $update;
	}