get_post_custom_keys example

// Still unknown.         return $this->maybe_make_link( $url );
    }

    /** * Deletes all oEmbed caches. Unused by core as of 4.0.0. * * @param int $post_id Post ID to delete the caches for. */
    public function delete_oembed_caches( $post_id ) {
        $post_metas = get_post_custom_keys( $post_id );
        if ( empty( $post_metas ) ) {
            return;
        }

        foreach ( $post_metas as $post_meta_key ) {
            if ( str_starts_with( $post_meta_key, '_oembed_' ) ) {
                delete_post_meta( $post_id$post_meta_key );
            }
        }
    }

    


/** * Displays a list of post custom fields. * * @since 1.2.0 * * @deprecated 6.0.2 Use get_post_meta() to retrieve post meta and render manually. */
function the_meta() {
    _deprecated_function( __FUNCTION__, '6.0.2', 'get_post_meta()' );
    $keys = get_post_custom_keys();
    if ( $keys ) {
        $li_html = '';
        foreach ( (array) $keys as $key ) {
            $keyt = trim( $key );
            if ( is_protected_meta( $keyt, 'post' ) ) {
                continue;
            }

            $values = array_map( 'trim', get_post_custom_values( $key ) );
            $value  = implode( ', ', $values );

            
Home | Imprint | This part of the site doesn't use cookies.