Home Plugin documentation Hooks and functions Functions get_pip_content()
get_pip_content()
Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don’t provide support for code customizations or 3rd party development.
Return Site Template content and Builder flexible field content
/**
* Get flexible content
*
* @param bool|int $post_id
*
* @return false|string|void
*/
function get_pip_content( $post_id = false ) {
$header = '';
$footer = '';
$html = '';
// Maybe get pip header
if ( !apply_filters( 'pip/header/remove', false ) ) {
$header = get_pip_header( false );
}
$pip_flexible = acf_get_instance( 'PIP_Flexible' );
// Get content
$content = get_flexible( $pip_flexible->flexible_field_name, pip_get_formatted_post_id( $post_id ) );
// Maybe get pip footer
if ( !apply_filters( 'pip/footer/remove', false ) ) {
$footer = get_pip_footer( false );
}
// Concat
$html .= $header ? $header : '';
$html .= $content ? $content : '';
$html .= $footer ? $footer : '';
return $html;
}
Our home port
15 Rue Cavenne, 69007 Lyon
And from everywhere in the world thanks to Hangout and Skype !
Useful links