wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
_publish_post_hook is private and should not be used in themes or plugins directly.
_publish_post_hook › WordPress Function
Seit2.3.0
Veraltetn/v
› _publish_post_hook ( $post_id )
Zugriff: |
|
Parameter: |
|
Definiert in: |
|
Codex: |
Hook to schedule pings and enclosures when a post is published.
Uses XMLRPC_REQUEST and WP_IMPORTING constants.Ähnliche Funktionen: wp_publish_post, _save_post_hook, _future_post_hook, wp_set_post_lock, get_plugin_page_hook
Quellcode
function _publish_post_hook( $post_id ) { if ( defined( 'XMLRPC_REQUEST' ) ) { /** * Fires when _publish_post_hook() is called during an XML-RPC request. * * @since 2.1.0 * * @param int $post_id Post ID. */ do_action( 'xmlrpc_publish_post', $post_id ); } if ( defined( 'WP_IMPORTING' ) ) { return; } if ( get_option( 'default_pingback_flag' ) ) { add_post_meta( $post_id, '_pingme', '1', true ); } add_post_meta( $post_id, '_encloseme', '1', true ); $to_ping = get_to_ping( $post_id ); if ( ! empty( $to_ping ) ) { add_post_meta( $post_id, '_trackbackme', '1' ); } if ( ! wp_next_scheduled( 'do_pings' ) ) { wp_schedule_single_event( time(), 'do_pings' ); } }