isotopsweden / wp-cargo
This package is abandoned and no longer maintained.
No replacement package was suggested.
Cargo will push content to other services
Package info
github.com/isotopsweden/wp-cargo
Type:wordpress-muplugin
pkg:composer/isotopsweden/wp-cargo
v2.0.0
2022-01-11 11:18 UTC
Requires
- php: ^7.1
- composer/installers: ~1.0
- frozzare/tank: ^1.3
Requires (Dev)
- frozzare/wp-test-suite: ~1.0
- isotopsweden/isotopcs: dev-master
This package is auto-updated.
Last update: 2023-02-21 11:00:34 UTC
README
Requires PHP 7.1 and WordPress 4.6
Cargo will push content to other services. If the push failes the content JSON will be saved in the database for the queue.
Installation
composer require isotopsweden/wp-cargo
Usage
Example configuration:
cargo()->set_config( [ 'content' => [ 'options' => ['siteurl', 'home'] ], 'database' => [ 'driver' => 'mysql', 'mysql' => [ 'table' => 'wp_cargo' ] ], 'preview' => [ 'fields' => ['post_id' => 'ID', 'post_type'], 'url' => 'http://example.com/_preview' ], 'pusher' => [ 'driver' => 'http', 'http' => [ 'url' => 'http://localhost:9988' ] ] ] );
Prepare meta fields, so you can hook into a custom fields plugin or something else:
add_filter( 'cargo_prepare_meta_value', function ( $object_id, $slug, $value, $type ) { return $value; }, 10, 4 );
Modify content data before push:
add_filter( 'cargo_modify_content_data', function ( $data, $type ) { return $data; }, 10, 2 );
Run queue with WP-CLI:
wp cargo run
Push all content with WP-CLI:
wp cargo run --all
License
MIT © Isotop