public static function meta_box_content()
 {
     $plugin = WaOauth\instance();
     $checked = self::get_setting(self::UNLOCK_SETTING_KEY) === 'true' ? 'checked' : '';
     $fieldOutput = "<label>Unlock </label>";
     $fieldOutput .= "<input type='hidden' value='false' name='bp_wa_oauth_unlock'>";
     $fieldOutput .= "<input type='checkbox' value='true' name='bp_wa_oauth_unlock' {$checked} />";
     $fieldValue = self::get_setting(self::REQUIRED_ROLE_SETTING_KEY);
     $fieldOutput .= "<br><br>";
     $fieldOutput .= "<label>Required role to view content </label>";
     $fieldOutput .= "<select name='bp_wa_oauth_required_role'>";
     $options = $plugin->settings->get_wa_user_roles();
     foreach ($options as $option) {
         $selected = $option['system_key'] === $fieldValue ? 'selected' : '';
         $fieldOutput .= "<option value='" . $option['system_key'] . "' {$selected} >" . $option['system_key'] . "</option>";
     }
     $fieldOutput .= "</select>";
     print $fieldOutput;
 }
Beispiel #2
0
 public static function enqueue_login_script()
 {
     $plugin = WaOauth\instance();
     $script_src = $plugin->plugin_url . 'js/bp-wa-oauth-login.js';
     wp_enqueue_script('bp-wa-oauth-login', $script_src);
 }