forked from scribu/wp-front-end-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.php
executable file
·40 lines (31 loc) · 1.11 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
// Acceptance test. Just drop this file into your mu-plugins folder.
add_action('loop_start', function( $wp_query ) {
if ( $wp_query !== $GLOBALS['wp_the_query'] )
return;
echo '<strong>Input post meta:</strong><br>';
echo html( 'div', editable_post_meta(get_the_ID(), 'price', 'input', false ) );
echo '<strong>Rich post meta:</strong><br>';
echo wpautop( editable_post_meta(get_the_ID(), 'degrees', 'rich', false ) );
echo '<strong>Dropdown post meta:</strong><br>';
echo html( 'div', editable_post_meta( get_the_ID(), 'my_key', array(
'type' => 'select',
'values' => array(
'val_1' => 'Title 1',
'val_2' => 'Title 2'
),
false
) ) );
echo '<strong>Input option:</strong><br>';
echo html( 'div', editable_option( array(
'key' => 'price',
'type' => 'input',
'echo' => false
) ) );
echo '<div style="overflow:hidden">';
echo '<strong>Editable image:</strong><br>';
editable_image( 'test', 'http://localhost/wp/wp-content/themes/twentyten/images/headers/fern.jpg' );
echo '</div>';
echo '<strong>Post thumbnail:</strong><br>';
echo get_the_post_thumbnail( get_the_ID() );
});