WordPress.org

Plugin Directory

Changeset 588011


Ignore:
Timestamp:
08/20/12 21:33:39 (20 months ago)
Author:
evansolomon
Message:

Move is_enabled() closer to where it's first used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • oembed-in-comments/trunk/oembed-in-comments.php

    r588009 r588011  
    5959        add_filter( 'comment_text', array( $wp_embed, 'autoembed' ), $priority ); 
    6060    } 
     61    /** 
     62     * Check whether oEmbed is enabled or disabled in comments 
     63     */ 
     64 
     65    function is_enabled() { 
     66        $enabled = get_option( $this->get_option_name(), null ); 
     67 
     68        // If there's no option set, default to the option for posts 
     69        if ( is_null( $enabled ) ) 
     70            $enabled = get_option( 'embed_autourls' ); 
     71 
     72        return (bool) $enabled; 
     73    } 
    6174 
    6275    /** 
     
    115128        return (bool) 'on' == $input; 
    116129    } 
    117  
    118     /** 
    119      * Check whether oEmbed is enabled or disabled in comments 
    120      */ 
    121     function is_enabled() { 
    122         $enabled = get_option( $this->get_option_name(), null ); 
    123  
    124         // If there's no option set, default to the option for posts 
    125         if ( is_null( $enabled ) ) 
    126             $enabled = get_option( 'embed_autourls' ); 
    127  
    128         return (bool) $enabled; 
    129     } 
    130130} 
    131131 
Note: See TracChangeset for help on using the changeset viewer.