devaloka / cfs-network-support
A Custom Field Suite add-on plugin that adds an ability to support Network (Multisite environment)
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 0
Open Issues: 1
Type:wordpress-plugin
Requires
- php: >=5.5.9
- composer/installers: ~1.1
Requires (Dev)
- squizlabs/php_codesniffer: ^2.6.2
Suggests
- mgibbs189/custom-field-suite: Required, you should install it your way
This package is auto-updated.
Last update: 2024-12-29 05:21:35 UTC
README
A Custom Field Suite add-on plugin that adds an ability to support Network (Multisite environment).
Installation
Manual Installation
- Just copy all files into
<ABSPATH>wp-content/plugins/cfs-network-support/
.
Manual Installation (as a Must-Use plugin)
-
Just copy all files into
<ABSPATH>wp-content/mu-plugins/cfs-network-support/
. -
Move
cfs-network-support/loader/50-cfs-network-support-loader.php
into<ABSPATH>wp-content/mu-plugins/
.
Installation via Composer
-
Install via Composer.
composer require devaloka/cfs-network-support
Installation via Composer (as a Must-Use plugin)
-
Install via Composer.
composer require devaloka/cfs-network-support
-
Move
cfs-network-support
directory into<ABSPATH>wp-content/mu-plugins/
. -
Move
cfs-network-support/loader/50-cfs-network-support-loader.php
into<ABSPATH>wp-content/mu-plugins/
.
Usage
Just pass Site ID with site_id
key to CFS API options.
Get field value(s)
echo CFS()->get('first_name', false, ['site_id' => 1]);
See also get - Custom Field Suite.
Save field value(s)
$field_data = ['first_name' => 'Matt']; $post_data = ['ID' => 678]; CFS()->save($field_data, $post_data, ['site_id' => 1]);
See also save - Custom Field Suite.
Get reverse-related Posts
$related_ids = CFS()->get_reverse_related($post->ID, [ 'field_name' => 'related_events', 'post_type' => 'news', 'site_id' => 1, ]);
See also get_reverse_related - Custom Field Suite.