PHP code example of outlandish / oowp

1. Go to this page and download the library: Download outlandish/oowp 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/ */

    

outlandish / oowp example snippets


foreach ( ooPlace::fetchAll() as $place ) {
    print "<h2>Articles about {$place->title}<h2>";
    foreach ( $place->getConnected( 'article' ) as $article {
        print '<h3>' . $article->htmlLink() . '</h3>';
        print $article->excerpt();
    }
}

public static function onRegistrationComplete() {

    parent::onRegistrationComplete();

    self::registerConnection( 'TARGET_POST_TYPE', array( 'cardinality' => 'many-to-many' ) );

}

foreach ( ooPlace::fetchAll() as $place ) {
    print "<h2>Articles about {$place->title}<h2>";
    foreach ( $place->getConnected( 'article' ) as $article {
        print '<h3>' . $article->htmlLink() . '</h3>';
        print $article->excerpt();
    }
}