By: Jonas Nordström, @windyjonas
Date: 2013-04-16
esc_attr( $text );
Encodes the <, >, &, " and ' (less than, greater than, ampersand, double quote and single quote) characters. Will never double encode entities.
Example:
<?php | |
/* | |
* Converts CSV to JSON | |
* Example uses Google Spreadsheet CSV feed | |
* csvToArray function I think I found on php.net | |
*/ | |
header('Content-type: application/json'); | |
// Set your CSV feed |
x | y | z | lp_x | lp_y | lp_z | hp_x | hp_y | hp_z | ||
---|---|---|---|---|---|---|---|---|---|---|
0.235458 | -0.597702 | -0.724487 | 0.232433 | -0.593757 | -0.717156 | 0.003025 | -0.003945 | -0.007332 | ||
0.235458 | -0.597702 | -0.724487 | 0.232735 | -0.594152 | -0.717889 | 0.002723 | -0.003550 | -0.006598 | ||
0.217346 | -0.597702 | -0.724487 | 0.231197 | -0.594507 | -0.718549 | -0.013850 | -0.003195 | -0.005939 | ||
0.217346 | -0.579590 | -0.724487 | 0.229812 | -0.593015 | -0.719143 | -0.012465 | 0.013425 | -0.005345 | ||
0.199234 | -0.579590 | -0.724487 | 0.226754 | -0.591673 | -0.719677 | -0.027520 | 0.012083 | -0.004810 | ||
0.199234 | -0.597702 | -0.760712 | 0.224002 | -0.592276 | -0.723781 | -0.024768 | -0.005426 | -0.036931 | ||
0.163010 | -0.579590 | -0.706375 | 0.217903 | -0.591007 | -0.722040 | -0.054893 | 0.011417 | 0.015665 | ||
0.108673 | -0.597702 | -0.724487 | 0.206980 | -0.591676 | -0.722285 | -0.098307 | -0.006026 | -0.002203 | ||
0.090561 | -0.615814 | -0.724487 | 0.195338 | -0.594090 | -0.722505 | -0.104777 | -0.021724 | -0.001982 |
<?php | |
// Please see https://github.com/Lewiscowles1986/WordPressSVGPlugin from now on |
// the main app file | |
import express from "express"; | |
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db) | |
import authenticate from "./authentication"; // middleware for doing authentication | |
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request | |
const app = express(), | |
api = express.Router(); | |
// first middleware will setup db connection |
If you use server rendering, keep in mind that neither useLayoutEffect
nor useEffect
can run until the JavaScript is downloaded.
You might see a warning if you try to useLayoutEffect
on the server. Here's two common ways to fix it.
If this effect isn't important for first render (i.e. if the UI still looks valid before it runs), then useEffect
instead.
function MyComponent() {