- add
/.github/workflows/ci.yml
- see preset below that supports
phpunit
,npm
,mysql
,postgres
,sqlite
- push with new version tag to github
- add a badge to
README.MD
:[![build status](https://github.com/username/repo/actions/workflows/ci.yml/badge.svg)](https://github.com/username/repo/actions)
- enjoy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="de"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5, minimum-scale=1" /> | |
<title>hcaptcha</title> | |
<script> | |
class App { | |
init() { | |
window.addEventListener('load', (e) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply_filters('the_content', get_the_content()); |
- this example is fully compatible with google identity services (this means compatible also from march 2023, when the old js api is deprecated)
- https://developers.google.com/identity/protocols/oauth2/web-server#php
- https://stackoverflow.com/questions/72619167/clarification-on-google-authentication-and-authorization-with-oauth-in-2022
- https://www.youtube.com/watch?v=C0DUNy6RjNw
- https://stackoverflow.com/questions/72418822/google-identity-services-how-to-refresh-access-token-for-google-api-after-one
- https://stackoverflow.com/questions/72080698/refresh-google-oauth2-token-automatically
- https://developers.google.com/identity/oauth2/web/guides/choose-authorization-model?hl=en
- if you want to store sensitive information very easily on the server (and not on the client) and don't want to use a database
- a session cookie is stored on the client to identify the user
- the session cookie ends until the user closes the browser (but it can be extended)
- sessions can also be used on backends that are called via javascript
session_start();
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this should be run e.g. on a rest api route | |
// don't run this on admin_init hook (since it conflicts with the users session) | |
add_action('rest_api_init', function () { | |
register_rest_route('v1', '/debug', [ | |
'methods' => \WP_REST_Server::READABLE, | |
'permission_callback' => function (\WP_REST_Request $request) { return true; }, | |
'callback' => function (\WP_REST_Request $request) { | |
global $sitepress; | |
// insert post in default language | |
$sitepress->switch_lang('de'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="de"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5, minimum-scale=1" /> | |
<title>.</title> | |
<script> | |
document.addEventListener('DOMContentLoaded', () => { | |
document.body.insertAdjacentHTML('beforeend', '<div class="smooth-cursor"></div>'); | |
let smoothCursor = document.querySelector('.smooth-cursor'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add this ONCE, then open up the backend, then remove this again (because this modifies the database!) | |
$role_object = get_role( 'editor' ); | |
$role_object->add_cap( 'wpml_manage_string_translation' ); | |
// alternative: Capability Manager Enhanced |