WordPress.org

Forums

WP-Cycle
WordPress Jetpack Proton CDN (1 post)

  1. amourtan
    Member
    Posted 1 year ago #

    Can someone with access to the code repository patch this code? The changes make wp_cycle fetches images from the free Jetpack Proton CDN.

    function wp_cycle($args = array(), $content = null) {
    global $wp_cycle_settings, $wp_cycle_images;

    // possible future use
    $args = wp_parse_args($args, $wp_cycle_settings);

    $newline = "\n"; // line break

    echo '<div id="'.$wp_cycle_settings['div'].'">'.$newline;

    foreach((array)$wp_cycle_images as $image => $data) {
    if($data['image_links_to'])
    echo '';

    $cycle_url = $data['file_url'];
    if (function_exists( 'jetpack_photon_url' )) {
    if(class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'get_active_modules' ) && in_array( 'photon', Jetpack::get_active_modules() )) {
    $cycle_url = str_replace('http://', 'http://i0.wp.com/', $data['file_url']);
    }
    }
    echo '<img src="'. $cycle_url .'" width="'.$wp_cycle_settings['img_width'].'" height="'.$wp_cycle_settings['img_height'].'" class="'.$data['id'].'" alt="" />';

    if($data['image_links_to'])
    echo '
    ';

    echo $newline;
    }

    echo '</div>'.$newline;
    }

    https://wordpress.org/plugins/wp-cycle/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP-Cycle
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.