_post_hook() - Hook used to schedule publication for a post marked for the future. * * The $post properties used and must exist are 'ID' and 'post_date_gmt'. * * @package WordPress * @subpackage Post * @since 2.3 * * @param int $post_id Not Used. Can be set to null. * @param object $post Object type containing the post information */ function _future_post_hook($deprecated = '', $post) { wp_clear_scheduled_hook( 'publish_future_post', $post->ID ); wp_schedule_single_event(strtotime($post->post_date_gmt. ' GMT'), 'publish_future_post', array($post->ID)); } /** * _publish_post_hook() - Hook {@internal Missing Short Description}} * * {@internal Missing Long Description}} * * @package WordPress * @subpackage Post * @since 2.3 * * @uses $wpdb * @uses XMLRPC_REQUEST * @uses APP_REQUEST * @uses do_action Calls 'xmlprc_publish_post' action if XMLRPC_REQUEST is defined. Calls 'app_publish_post' * action if APP_REQUEST is defined. * * @param int $post_id The ID in the database table of the post being published */ function _publish_post_hook($post_id) { global $wpdb; if ( defined('XMLRPC_REQUEST') ) do_action('xmlrpc_publish_post', $post_id); if ( defined('APP_REQUEST') ) do_action('app_publish_post', $post_id); if ( defined('WP_IMPORTING') ) return; $data = array( 'post_id' => $post_id, 'meta_value' => '1' ); if ( get_option('default_pingback_flag') ) $wpdb->insert( $wpdb->postmeta, $data + array( 'meta_key' => '_pingme' ) ); $wpdb->insert( $wpdb->postmeta, $data + array( 'meta_key' => '_encloseme' ) ); wp_schedule_single_event(time(), 'do_pings'); } /** * _save_post_hook() - Hook used to prevent page/post cache and rewrite rules from staying dirty * * Does two things. If the post is a page and has a template then it will update/add that * template to the meta. For both pages and posts, it will clean the post cache to make sure * that the cache updates to the changes done recently. For pages, the rewrite rules of * WordPress are flushed to allow for any changes. * * The $post parameter, only uses 'post_type' property and 'page_template' property. * * @package WordPress * @subpackage Post * @since 2.3 * * @uses $wp_rewrite Flushes Rewrite Rules. * * @param int $post_id The ID in the database table for the $post * @param object $post Object type containing the post information */ function _save_post_hook($post_id, $post) { if ( $post->post_type == 'page' ) { if ( !empty($post->page_template) ) if ( ! update_post_meta($post_id, '_wp_page_template', $post->page_template)) add_post_meta($post_id, '_wp_page_template', $post->page_template, true); clean_page_cache($post_id); global $wp_rewrite; $wp_rewrite->flush_rules(); } else { clean_post_cache($post_id); } } // // Private // function _get_post_ancestors(&$_post) { global $wpdb; if ( isset($_post->ancestors) ) return; $_post->ancestors = array(); if ( empty($_post->post_parent) || $_post->ID == $_post->post_parent ) return; $id = $_post->ancestors[] = $_post->post_parent; while ( $ancestor = $wpdb->get_var( $wpdb->prepare("SELECT `post_parent` FROM $wpdb->posts WHERE ID = %d LIMIT 1", $id) ) ) { if ( $id == $ancestor ) break; $id = $_post->ancestors[] = $ancestor; } } ?>
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web62/html/wp-includes/post.php:13) in /var/www/web62/html/xmlrpc.php on line 21
WordPress http://wordpress.org/ http://www.blueten-therapie.de