Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




register_meta [ WordPress Function ]

register_meta ( $meta_type, $meta_key, $sanitize_callback, $auth_callback = null )
Parameters:
  • (string) $meta_type Type of meta
  • (string) $meta_key Meta key
  • (string|array) $sanitize_callback A function or method to call when sanitizing the value of $meta_key.
  • (string|array) $auth_callback Optional. A function or method to call when performing edit_post_meta, add_post_meta, and delete_post_meta capability checks.
  • (array) $args Arguments
Defined at:



Register meta key

Source


<?php
function register_meta$meta_type$meta_key$sanitize_callback$auth_callback null ) {
    if ( 
is_callable$sanitize_callback ) )
        
add_filter"sanitize_{$meta_type}_meta_{$meta_key}"$sanitize_callback10);

    if ( empty( 
$auth_callback ) ) {
        if ( 
is_protected_meta$meta_key$meta_type ) )
            
$auth_callback '__return_false';
        else
            
$auth_callback '__return_true';
    }

    if ( 
is_callable$auth_callback ) )
        
add_filter"auth_{$meta_type}_meta_{$meta_key}"$auth_callback10);
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics