Skip to main content

mbr_page

Usage

This shortcode returns data from a specified page/post record in your WordPress database.

It provides a means of duplicating content on alternate pages/posts with a different set of access conditions but without the need to maintain several content sources.

Furthermore, by allowing content parts to be drawn from several different pages/posts, it extends the content management capabilities of WordPress.

This shortcode is the identical to [mbr_post] and is provided as a means of self-documenting your intentions.

Important

Please excercise care and ensure that you do not create cyclical references e.g. 'Page 1' is not pulling content from 'Page 2', which itself is pulling content from 'Page 1'.

Parameters

ParametersDescription
idThe page ID i.e. post_id for which to return the specified field data.
Default: none.
Required: yes.
fieldSpecifies the name of a WordPress post field to return. Any field used within the WordPress post or post_meta table can be specified.
Some Permitted Values: post_title, post_date, post_content, post_excerpt.
Default: post_content
Required: no.
statusSpecifies the post status required in the post_status field for the returned data to be displayed.
Default: none.
Required: no.
excert_fbSpecifies whether a fallback to the excerpt is used if the status is not met. Please note that this ONLY applies when the specified field is set to post_content.
Permitted Values: yes, y, true, t, or 1.
Default: none.
Required: no.

Validity

This shortcode is evaluated for any type of visitor.

Conditional Branching

This shortcode does NOT support conditional branching with [ELSE_page].

Nesting

Shortcode nesting within is NOT supported.

Examples

Returns the value of the field post_title for the page with id 1234:

[mbr_page id='1234' field='post_title']

API

For direct use in PHP code use the structure as illustrated here:

$my_excerpt = mbr_page( array( 'id'=>'1234', 'field'=>'post_excerpt' ) );