PHP code example of arraypress / wp-inline-sync

1. Go to this page and download the library: Download arraypress/wp-inline-sync 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/ */

    

arraypress / wp-inline-sync example snippets


register_sync( 'stripe_prices', [
	'hook_suffix'      => 'toplevel_page_sugarcart',
	'title'            => __( 'Sync Prices', 'my-plugin' ),
	'button_label'     => __( 'Sync from Stripe', 'my-plugin' ),
	'container'        => '.wp-list-table',
	'data_callback'    => 'MyPlugin\fetch_prices',
	'process_callback' => 'MyPlugin\process_price',
	'name_callback'    => fn( $item ) => $item->product->name ?? $item->id,
] );

render_sync_button( 'stripe_prices' );