WP Manifestindependent plugin directory
manifest / ecommerce / edd-check-item-version

Easy Digital Downloads - Check Item Version

A simple API endpoint to get the most current version of a product in EDD.

by Reaktiv Studios · github.com/norcross/edd-check-item-version · website

1stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/norcross/edd-check-item-version/archive/refs/heads/master.zip

Readme

EDD Check Item Version

Provides an API endpoint to get the current version of a product.

Example Call

function rkv_check_version( $name = '' ) {

    // Don't fire when saving settings.
    if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
        return;
    }

    // Data to send in our API request.
    $args   = array(
        'item_name' => urlencode( ITEM_NAME ), // The name of our product in EDD.
    );

    // Call the custom API.
    $response = wp_remote_get( 'http://YOUR-DOMAIN/edd-version-check', array( 'timeout' => 35, 'sslverify' => false, 'body' => $args ) );

    if ( is_wp_error( $response ) ) {
        print_r( $response, true );
    }

    // extract the data
    $data   = json_decode( wp_remote_retrieve_body( $response ) );

    print_r( $data, true );
}

Read the full README on GitHub →