PHP code example of webdevstudios / cmb2-attached-posts

1. Go to this page and download the library: Download webdevstudios/cmb2-attached-posts library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

webdevstudios / cmb2-attached-posts example snippets


$attached = get_post_meta( get_the_ID(), '_attached_cmb2_attached_posts', true );

foreach ( $attached as $attached_post ) {
	$post = get_post( $attached_post );
}