Database_Command
Database management commands for CRP.
Namespace: WebberZone\Contextual_Related_Posts\Pro\CLI
Since: 4.2.0
Source: includes/cli/class-database-command.php line 27
Extends: Base_Command
Methods
migrate_meta()
Migrate meta data from crp_post_meta array to individual crp* keys.
OPTIONS
[—dry-run] : Show what would be migrated without making changes.
[—force] : Force migration even if already completed.
[—verbose] : Show detailed error messages.
[—batch-size=
[—url=
[—network] : Migrate meta on all sites in the network.
[—blog-id=
EXAMPLES
wp crp db migrate-meta --dry-run
wp crp db migrate-meta --batch-size=50
wp crp db migrate-meta --force --verbose
wp crp db migrate-meta --network
wp crp db migrate-meta --blog-id=2
wp crp db migrate-meta --url=http://example.com/site2
Line: 70
public function migrate_meta( array $args, array $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array | $args | Command arguments. |
array | $assoc_args | Command associative arguments. |
Returns: void
rollback_meta()
Rollback migration from individual crp* keys back to crp_post_meta array.
DEPRECATED
This command is deprecated and will be removed in a future version. It rolls back to the legacy crp_post_meta array storage format.
OPTIONS
[—dry-run] : Show what would be rolled back without making changes.
[—verbose] : Show detailed error messages.
[—batch-size=
[—network] : Rollback meta on all sites in the network.
[—blog-id=
[—force] : Force rollback without confirmation.
EXAMPLES
wp crp db rollback-meta --dry-run
wp crp db rollback-meta --batch-size=50
wp crp db rollback-meta --network
wp crp db rollback-meta --blog-id=2
wp crp db rollback-meta --force
Line: 193
public function rollback_meta( array $args, array $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array | $args | Command arguments. |
array | $assoc_args | Command associative arguments. |
Returns: void
status()
Show database migration status.
OPTIONS
[—format=
[—network] : Show status for all sites in the network.
[—blog-id=
EXAMPLES
wp crp db status
wp crp db status --format=json
wp crp db status --network
wp crp db status --blog-id=2
Line: 306
public function status( array $args, array $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array | $args | Command arguments. |
array | $assoc_args | Command associative arguments. |
Returns: void