function _xfac_save_comment($comment) { if (!empty($GLOBALS['XFAC_SKIP_xfac_save_comment'])) { return array(); } $postSyncRecords = xfac_sync_getRecordsByProviderTypeAndSyncId('', 'thread', $comment->comment_post_ID); $commentSyncRecords = xfac_sync_getRecordsByProviderTypeAndSyncId('', 'post', $comment->comment_ID); $xfPosts = array(); foreach ($postSyncRecords as $postSyncRecord) { $commentSyncRecord = null; foreach ($commentSyncRecords as $_commentSyncRecord) { if (!empty($_commentSyncRecord->syncData['post']['thread_id']) and $_commentSyncRecord->syncData['post']['thread_id'] == $postSyncRecord->provider_content_id) { $commentSyncRecord = $_commentSyncRecord; } } $xfPost = xfac_syncComment_pushComment($comment, $postSyncRecord, $commentSyncRecord); if (!empty($xfPost)) { $xfPosts[] = $xfPost; } } if (empty($xfPosts)) { // not pushed yet $config = xfac_option_getConfig(); if (!empty($config)) { xfac_search_indexComment($config, $comment); } } return $xfPosts; }
function xfac_post_meta_box_info($post) { $config = xfac_option_getConfig(); $meta = xfac_option_getMeta($config); $records = xfac_sync_getRecordsByProviderTypeAndSyncId('', 'thread', $post->ID); require xfac_template_locateTemplate('post_meta_box_info.php'); }