Changeset 1416129
- Timestamp:
- 05/13/2016 08:13:08 AM (10 years ago)
- Location:
- step-by-step-social-count-cache/trunk
- Files:
-
- 3 edited
-
readme.txt (modified) (2 diffs)
-
sbs-social-count-cache.php (modified) (3 diffs)
-
views/options.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
step-by-step-social-count-cache/trunk/readme.txt
r1370117 r1416129 4 4 Tags: cache, count, sns, social 5 5 Requires at least: 4.2.4 6 Tested up to: 4. 4.27 Stable tag: 1.5. 16 Tested up to: 4.5.2 7 Stable tag: 1.5.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 109 109 == Changelog == 110 110 111 1.5.2 112 タグのカスタマイズ時に生成されるURLをエンティティ化。FacebookのAccess Tokenが誤っている場合、エラーメッセージを表示するように変更。 113 111 114 1.5 112 115 count.jsoon APIを利用してTwitterのカウントを取得可能に変更。 -
step-by-step-social-count-cache/trunk/sbs-social-count-cache.php
r1370117 r1416129 4 4 Plugin URI: https://wordpress.org/plugins/step-by-step-social-count-cache/ 5 5 Description: ソーシャルブックマークのカウントをキャッシュするプラグイン 6 Version: 1.5. 16 Version: 1.5.2 7 7 Author: oxynotes 8 8 Author URI: http://oxynotes.com … … 986 986 * @param int 各SNSのカウント 987 987 * @return str ブランケットのタグを置き換えたボタンのタグ 988 989 * since 1.5.2 エスケープ対応(#等を含むと正常に動作しなかった) 988 990 */ 989 991 function tag_rep( $arg, $count ) { 990 992 $url = get_permalink(); 991 993 $site_title = get_bloginfo( 'name' ); 992 $title = get_the_title(); 994 995 // html_entity_decode()を挟まないと"や'が文字参照で表示されてしまうので注意 996 $title = urlencode( html_entity_decode( get_the_title(), ENT_COMPAT, 'UTF-8' ) ); 993 997 994 998 $search = array( '[[url]]', '[[site_title]]', '[[title]]', '[[count]]' ); … … 998 1002 return $rep_txt; 999 1003 } 1000 1001 1004 1002 1005 -
step-by-step-social-count-cache/trunk/views/options.php
r1370114 r1416129 30 30 settings_errors('app-token-empty'); // 引数でエラーのスラッグを指定するとエラーを限定できる 31 31 32 } else { // tokenが正しいかチェック 33 34 $url = site_url(); // テスト用に適当にURLを取得 35 $graph_url = 'https://graph.facebook.com/v2.4/' . rawurlencode($url) . '?access_token=' . $this->sbs_facebook_app_token; 36 $result = wp_remote_get( $graph_url, array( 'timeout' => 5 ) ); // たまに異常に重い時があるので注意 37 $decoded_response = json_decode( $result["body"], true ); // jsonをデコード。trueで連想配列に変換 38 39 if( $decoded_response["error"]["type"] == "OAuthException" ) { 40 // FacebookのApp Tokenが間違っている場合にエラーメッセージ 41 add_settings_error( 42 'app-token-invalid', 43 'app-token-invalid', 44 __('FacebookのApp Tokenが誤っています。値を確認してください。', 'sbs_social_count_cache'), 45 'error' 46 ); 47 settings_errors('app-token-invalid'); 48 } 32 49 } 33 50
Note: See TracChangeset
for help on using the changeset viewer.