###前提・実現したいこと
会員制SNSをbuddypressで作り、Facebookでのみ会員登録できるようにしたいんです。
新規登録の場合buddypressでの登録フォームを表示せずに、FBのバナーだけ表示しFBアカウントでログインします。
また、登録していないユーザーからはデモページとFBログインのバナーのみ見られるようにして、
登録済みのユーザーにはマイページが表示される切り替えをしたいです。
###エラー
ウィジェットにて「Social login」をページに載せましたが、「Insert text/html to add before the widget:」と
「Insert text/html to add after the widget:」の項目にのせるものがわからず空白にしています。
そのためか、エラーが出ます。
facebook.comのページに移動してから
「URLを読み込めません:このURLのドメインはアプリのドメインに含まれていません。このURLを読み込むには、アプリ設定のアプリドメインにすべてのドメインとサブドメインを追加してください。」
と表示されています。
###該当のソースコード
//テーマデフォルトここから <?php function meso_load_child_style() { global $theme_version; wp_enqueue_style( 'meso-child-css', get_stylesheet_directory_uri() . '/style.css', array(), $theme_version ); } add_action( 'wp_enqueue_scripts', 'meso_load_child_style',99 ); ?> //テーマデフォルトここまで //Handle data retrieved from a social network profile<font></font> function oa_social_login_store_extended_data ($user_data, $identity)<font></font> {<font></font> // $user_data is an object that represents the newly added user<font></font> // The format is similar to the data returned by $user_data = get_userdata ($user_id);<font></font> <font></font> // $identity is an object that contains the full social network profile<font></font> <font></font> //Example to store the gender<font></font> update_user_meta ($user_data->ID, 'gender', $identity->gender);<font></font> }<font></font> <font></font> //This action is called whenever Social Login adds a new user<font></font> add_action ('oa_social_login_action_after_user_insert', 'oa_social_login_store_extended_data', 10, 2); //Store data retrieved from a social network profile in BuddyPress Xprofile fields<font></font> function oa_social_login_store_xprofile ($user_data, $identity)<font></font> {<font></font> // $user_data is an object that represents the newly added user<font></font> // The format is similar to the data returned by $user_data = get_userdata ($user_id);<font></font> <font></font> // $identity is an object that contains the full social network profile<font></font> <font></font> //The following line is required to initialise the BuddyPress table names<font></font> do_action('bp_setup_globals');<font></font> <font></font> //Example to store the firstname/lastname<font></font> xprofile_set_field_data ('First Name', $user_data->ID, $identity->name->givenName);<font></font> xprofile_set_field_data ('Last Name', $user_data->ID, $identity->name->familyName);<font></font> }<font></font> add_action( 'oa_social_login_action_after_user_insert', 'oa_social_login_store_xprofile', 10, 2); //Use the email address for user_login<font></font> function oa_social_login_set_email_as_user_login ($user_fields)<font></font> {<font></font> if ( ! empty ($user_fields['user_email']))<font></font> {<font></font> if ( ! username_exists ($user_fields['user_email']))<font></font> {<font></font> $user_fields['user_login'] = $user_fields['user_email'];<font></font> }<font></font> }<font></font> <font></font> return $user_fields;<font></font> }<font></font> <font></font> // This filter is applied to new users<font></font> add_filter('oa_social_login_filter_new_user_fields', 'oa_social_login_set_email_as_user_login'); //Set custom roles for new users<font></font> function oa_social_login_set_new_user_role ($user_role)<font></font> {<font></font> //This is an example for a custom setting with one role<font></font> $user_role = 'author';<font></font> <font></font> //This is an example for a custom setting with two roles<font></font> $user_role = 'author editor';<font></font> <font></font> //The new user will be created with this role<font></font> return $user_role;<font></font> }<font></font> <font></font> //This filter is applied to the roles of new users<font></font> add_filter('oa_social_login_filter_new_user_role', 'oa_social_login_set_new_user_role');
###試したこと
http://docs.oneall.com/plugins/guide/social-login-wordpress/
このページにあるように、テーマのfunctions.phpにA.B.D.Eのソースを追加しました。
見よう見まねで追加したのでよく理解できていません。
facebook for developersで作ったアプリ名に変更する箇所があるのかと思うのですが、どこを変えたらいいのかわからず参考URLのソースをそのままペーストしました。
###補足情報(言語/FW/ツール等のバージョンなど)
mac,iPhonで作成と確認をしています。
使用テーマ:MesoColumn【https://ja.wordpress.org/themes/mesocolumn/】
sociallogin:oneall取得済み
facebook for developers:登録済み、アプリ作成済み
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。