Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

Skip to main content

rwmb_get_object_fields

rwmb_get_object_fields is a helper function that gets list of custom fields for a specific object. The object can be a post or a term or a settings page.

Usage

To get list of object fields, please use the following code:

// For posts
$fields = rwmb_get_object_fields( 123 ); // Get by post ID, or
$fields = rwmb_get_object_fields( 'your_post_type' ); // By post type

// For terms, requires MB Term Meta extension
$fields = rwmb_get_object_fields( 123, 'term' ); // Get by term ID, or
$fields = rwmb_get_object_fields( 'your_taxonomy_slug', 'term' ); // Get by taxonomy slug

Arguments

This function accepts 4 arguments as below:

rwmb_get_object_fields( $type_or_id, $object_type = 'post' );
NameDescription
$type_or_idThe object ID or type. Type should be post type/post ID for posts, or taxonomy/term ID for terms or settings page ID for settings pages. Required.
$object_typeThe object type: post (default), term, user or setting. Optional.

Returned value

This function returns an associated array of fields, with keys are the fields' IDs. Each field is a full array of its own settings.