• Resolved bugwich

    (@bugwich)


    Hi Micah,

    I would like to activate the “disable all links for this promotion” across the board. I believe I have found the section in the Promotion plugin code that handles it —
    _____________________________________________
    function fetch_link_settings(){
    global $post;
    // If the destination url is set by the user, use that. Otherwise, use the permalink
    $destination_url = get_post_meta($post->ID, ‘_promo_slider_url’, TRUE);
    if( !$destination_url ) $destination_url = get_permalink($post->ID);
    // If the target attribute is set the user, use that. Otherwise, set it to _self
    $target = get_post_meta($post->ID, ‘_promo_slider_target’, TRUE);
    if( !$target ) $target = ‘_self’;
    // Setup the disable links variable
    $disable_links = get_post_meta($post->ID, ‘_promo_slider_disable_links’, TRUE);
    return compact(‘destination_url’, ‘target’, ‘disable_links’);
    }
    ___________________________________________

    Unfortunately I am no programmer. Is there some way to hard code the destination URL as “nothing”? (for lack of a better way to describe it.) I have literally hundreds of images to embed in multiple promotion sliders and the amount of time required to get into each image to manually check the “disable checkbox” will cost me hours.

    Thanks!

    Bill

    http://ww.wp.xz.cn/extend/plugins/promotion-slider/

Viewing 1 replies (of 1 total)
  • Plugin Author Micah Wood

    (@woodent)

    Bill,

    You can code the $disable_links variable to always return true like this:

    add_filter( 'get_post_metadata', 'ps_default_disable_links', 10, 4 );
    function ps_default_disable_links( $value, $object_id, $meta_key, $single ) {
        if( '_promo_slider_disable_links' == $meta_key ) {
            $value = 'true';
        }
        return $value;
    }
Viewing 1 replies (of 1 total)

The topic ‘Disabling links’ is closed to new replies.