• Resolved flowdee

    (@flowdee)


    In contrast to the “exclusions” setting I would love to have a way to include urls which should be uploaded only.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Burhan Nasir

    (@burhandodhy)

    Hi @flowdee,

    I have introduced a new filter smart_aui_validate_image_url, which allows you to download images only from certain websites. The code will look something like this.

    add_filter(
    'smart_aui_validate_image_url',
    function ( $is_valid, $url ) {
    $allowed_domains = [
    'example.com',
    'example.org',
    ];

    $url_host = wp_parse_url( $url, PHP_URL_HOST );
    if ( ! in_array( $url_host, $allowed_domains, true ) ) {
    return false;
    }

    return $is_valid;
    },
    10,
    2
    );

    Regards,
    Burhan

    Thread Starter flowdee

    (@flowdee)

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Setting: Inclusions’ is closed to new replies.