AWECHAT_DEFAULT_ARTICLE_IMAGE,
'follow_tips_image' => AWECHAT_DEFAULT_FOLLOW_IMAGE,
'read_source_tips_image' => AWECHAT_DEFAULT_READSOURCE_IMAGE,
'post_tail' => '
END {biography} 长按二维码关注{author}
/>
$appid, 'secret' => $appsecret )); $account_type = $app->check_account_type(); $AUTH_SUBSCRIPTION_ACCOUNT = $app::AUTH_SUBSCRIPTION_ACCOUNT; $AUTH_SERVICE_ACCOUNT = $app::AUTH_SERVICE_ACCOUNT; } if ($account_type == $AUTH_SUBSCRIPTION_ACCOUN || $account_type == $AUTH_SERVICE_ACCOUNT) { return true; }else{ return false; } } public function posts_add_column($post_columns) { $post_columns['Awechat'] = __( 'Wechat Sync', 'Awechat' ); return $post_columns; } public function posts_render_column($column_name, $post_ID) { if ( $column_name == 'Awechat' ) { date_default_timezone_set('PRC'); $wechat_article_id = get_post_meta( $post_ID, '_wechat_article_id', true ); // if (!$wechat_article_id) return false; $wechat_article_url = get_post_meta( $post_ID, '_wechat_article_url', true ); if (!$wechat_article_url) $wechat_article_url = 'javascript:;'; $wechat_sync_log = get_post_meta( $post_ID, '_wechat_sync_log', true ); $icon_titles = array(); if (is_array($wechat_sync_log) && count($wechat_sync_log) > 0) { $is_sync_successful = !!$wechat_sync_log[ count($wechat_sync_log)-1 ]['success']; if (!$is_sync_successful) $icon_bg_position = 'background-position:24px 0;'; for ($i=count($wechat_sync_log)-1; $i >= 0; $i--) { if (count($wechat_sync_log) - $i >= 5) {array_push($icon_titles, '...'); break;} $is_sync_successful = !!$wechat_sync_log[$i]['success']; array_push($icon_titles, date('Y-m-d H:i:s', $wechat_sync_log[$i]['date']) . ': ' . ($is_sync_successful ? __('Sync Successfully!', 'Awechat') : __('Sync Failed!', 'Awechat').$wechat_sync_log[$i]['errcode'].'-'.$wechat_sync_log[$i]['errmsg']) ); } } if (!$wechat_article_id) $icon_bg_position .= 'filter:grayscale(100%);'; echo ''; } } }