Changeset 690769
- Timestamp:
- 04/02/2013 07:35:35 PM (13 years ago)
- File:
-
- 1 edited
-
jetpack/trunk/modules/notes.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
jetpack/trunk/modules/notes.php
r685049 r690769 44 44 45 45 add_action( 'init', array( &$this, 'action_init' ) ); 46 47 //post types that support comments48 $filt_post_types = array();49 foreach ( get_post_types() as $post_type ) {50 if ( post_type_supports( $post_type, 'comments' ) ) {51 $filt_post_types[] = $post_type;52 }53 }54 55 Jetpack_Sync::sync_posts( __FILE__, array(56 'post_types' => $filt_post_types,57 'post_stati' => array( 'publish' ),58 ) );59 Jetpack_Sync::sync_comments( __FILE__, array(60 'post_types' => $filt_post_types,61 'post_stati' => array( 'publish' ),62 'comment_stati' => array( 'approve', 'approved', '1', 'hold', 'unapproved', 'unapprove', '0', 'spam', 'trash' ),63 ) );64 46 } 65 47 … … 106 88 107 89 function action_init() { 90 //syncing must wait until after init so 91 //post types that support comments 92 $filt_post_types = array(); 93 $all_post_types = get_post_types(); 94 foreach ( $all_post_types as $post_type ) { 95 if ( post_type_supports( $post_type, 'comments' ) ) { 96 $filt_post_types[] = $post_type; 97 } 98 } 99 100 Jetpack_Sync::sync_posts( __FILE__, array( 101 'post_types' => $filt_post_types, 102 'post_stati' => array( 'publish' ), 103 ) ); 104 Jetpack_Sync::sync_comments( __FILE__, array( 105 'post_types' => $filt_post_types, 106 'post_stati' => array( 'publish' ), 107 'comment_stati' => array( 'approve', 'approved', '1', 'hold', 'unapproved', 'unapprove', '0', 'spam', 'trash' ), 108 ) ); 109 108 110 if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) 109 111 return;
Note: See TracChangeset
for help on using the changeset viewer.