AWECHAT_DEFAULT_ARTICLE_IMAGE, 'follow_tips_image' => AWECHAT_DEFAULT_FOLLOW_IMAGE, 'read_source_tips_image' => AWECHAT_DEFAULT_READSOURCE_IMAGE, 'post_tail' => '

END

{author}

{biography}

微信二维码

长按二维码关注

', ); update_option( self::$option_name, $options ); } public function settings_init(){ register_setting( self::$option_name, self::$option_name ); } public function add_plugin_page(){ // This page will be under "Settings" $page_title=__('WeChat Settings', 'Awechat'); $menu_title=__('WeChat Settings', 'Awechat'); $capability='manage_options'; $menu_slug=AWECHAT_PLUGIN_OPTIONNAME; add_options_page( $page_title, $menu_title, $capability, $menu_slug, array( $this, 'create_admin_page' ) ); } public function create_admin_page(){ // Set class property $options = get_option( self::$option_name ); if ($options['appid'] && $options['appsecret']) { require_once AWECHAT_PLUGIN_DIR . 'includes/officialAccount.php'; $app = new Awechat_oa(array( 'app_id' => $options['appid'], 'secret' => $options['appsecret'] )); $account_type = $app->check_account_type(); $account_type_name = $app->get_account_type_name(); if ($account_type != get_option( 'wechat_account_type_for_' . $options['appid'] )) { update_option( 'wechat_account_type_for_'.$options['appid'], $account_type ); } } $interface_url = $options['token']!=''?home_url().'/?'.$options['token']:'none'; wp_enqueue_media(); wp_register_script('Awechat-custom-upload', AWECHAT_PLUGIN_URL.'/assets/media_upload.js', array('jquery','media-upload','thickbox'),"2.0"); wp_enqueue_script('Awechat-custom-upload'); ?>


class="regular-checkbox"/>

以上HTML将会在每篇文章末尾展示。可以运用以下标签变量:
{author} : 文章作者名
{avatar} : 文章作者头像(输出img)
{biography} : 文章作者个人传记(在个人资料中设置)
{website} : 文章作者个人网站(在个人资料中设置)
{authorpage} : 文章作者所有文章页面URL
{qrcode} : 需要关注的公众号二维码图片地址

/>


/>

$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 ''; } } }