PHP code example of devaloka / cfs-network-support

1. Go to this page and download the library: Download devaloka/cfs-network-support 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/ */

    

devaloka / cfs-network-support example snippets


echo CFS()->get('first_name', false, ['site_id' => 1]);

$field_data = ['first_name' => 'Matt'];
$post_data  = ['ID' => 678];

CFS()->save($field_data, $post_data, ['site_id' => 1]);

$related_ids = CFS()->get_reverse_related($post->ID, [
    'field_name' => 'related_events',
    'post_type'  => 'news',
    'site_id'    => 1,    
]);