Browse
For agents
About
TablePress – Tables in WordPress made easy
/
2.2
TablePress – Tables in WordPress made easy
v2.2
Switch version
3.3.4
3.3.3
3.3.2
3.3.1
trunk
1.12
1.14
1.9.2
2.0.4
2.1.7
2.1.8
2.2
2.2.1
2.2.2
2.2.3
2.2.4
2.2.5
2.3
2.3.1
2.3.2
2.4
2.4.1
2.4.2
2.4.3
2.4.4
All 44 releases
Overview
Code
tablepress
/
blocks
/
table
/
src
/
example.js
example.js
in TablePress – Tables in WordPress made easy 2.2, at blocks/table/src/example.js
27 lines
474 B
Find file
t
No matching file
Up and down to move
Enter to open
Esc to close
Raw
Download
Zip
View raw
1
/**
2
* JavaScript code for the TablePress table block in the block editor.
3
*
4
*
@
package
TablePress
5
*
@
subpackage
Blocks
6
*
@
author
Tobias Bäthge
7
*
@
since
2.0.0
8
*/
9
10
/*
globals tp
*/
11
12
let
example
=
null
;
13
14
const
table_ids
=
Object
.
keys
(
tp
.
tables
)
;
15
16
if
(
table_ids
.
length
)
{
17
const
random_table_id
=
table_ids
[
Math
.
floor
(
Math
.
random
(
)
*
table_ids
.
length
)
]
;
18
example
=
{
19
attributes
:
{
20
id
:
random_table_id
,
21
parameters
:
'
'
,
22
}
,
23
}
;
24
}
25
26
export
default
example
;
27