WordPress.org

Make WordPress Core

Ticket #10487: meta-testing.php

File meta-testing.php, 591 bytes (added by scribu, 12 years ago)

plugin for basic testing

Line 
1<?php
2/*
3Plugin Name: Meta Testing
4Version: 0.1
5*/
6
7// Comment meta
8var_dump(register_meta_type('comment'));
9
10add_metadata('comment', 1, 'cfoo', 'cbar', true);
11var_dump(get_metadata('comment', 1, 'cfoo', true));
12
13update_metadata('comment', 1, 'cfoo', 'craz', 'cbar');
14var_dump(get_metadata('comment', 1, 'cfoo', true));
15
16delete_metadata('comment', 1, 'cfoo');
17
18// Regular post_meta functions
19add_post_meta(1, 'foo', 'bar', true);
20var_dump(get_post_meta(1, 'foo', true));
21
22update_post_meta(1, 'foo', 'raz', 'bar');
23var_dump(get_post_meta(1, 'foo', true));
24
25delete_post_meta(1, 'foo', 'raz');