Changeset 43378 for trunk/src/wp-includes/post.php
- Timestamp:
- 06/21/2018 09:06:50 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r43011 r43378 1991 1991 1992 1992 /** 1993 * Registers a meta key for posts. 1994 * 1995 * @since 5.0.0 1996 * 1997 * @param string $post_type Post type to register a meta key for. Pass an empty string 1998 * to register the meta key across all existing post types. 1999 * @param string $meta_key The meta key to register. 2000 * @param array $args Data used to describe the meta key when registered. See 2001 * {@see register_meta()} for a list of supported arguments. 2002 * @return bool True if the meta key was successfully registered, false if not. 2003 */ 2004 function register_post_meta( $post_type, $meta_key, array $args ) { 2005 $args['object_subtype'] = $post_type; 2006 2007 return register_meta( 'post', $meta_key, $args ); 2008 } 2009 2010 /** 2011 * Unregisters a meta key for posts. 2012 * 2013 * @since 5.0.0 2014 * 2015 * @param string $post_type Post type the meta key is currently registered for. Pass 2016 * an empty string if the meta key is registered across all 2017 * existing post types. 2018 * @param string $meta_key The meta key to unregister. 2019 * @return bool True on success, false if the meta key was not previously registered. 2020 */ 2021 function unregister_post_meta( $post_type, $meta_key ) { 2022 return unregister_meta_key( 'post', $meta_key, $post_type ); 2023 } 2024 2025 /** 1993 2026 * Retrieve post meta fields, based on post ID. 1994 2027 *
Note: See TracChangeset
for help on using the changeset viewer.