Plugin Directory

Changeset 488435


Ignore:
Timestamp:
01/11/2012 09:23:12 PM (14 years ago)
Author:
billyblay
Message:

Inclusão das variáveis padrão através do add_option
Inclusão da opção de exibir as licenças automaticamente ao final do post

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-licenses/trunk/wp-licenses.php

    r488271 r488435  
    1616add_action('init', 'wp_licenses_lang_init');
    1717
     18/* delete_option */
     19
     20/*delete_option('license-title');
     21delete_option('license-tooltip');
     22delete_option('license-theme');
     23delete_option('license-default');
     24delete_option('license-content');
     25delete_option('license-version');
     26delete_option('license-language');*/
     27
     28/* add_option */
     29
     30add_option('license-title','1','','yes');
     31add_option('license-tooltip','1','','yes');
     32add_option('license-theme','1','','yes');
     33add_option('license-default','by-nc-sa','','yes');
     34add_option('license-content','1','','yes');
     35add_option('license-version','3.0','','yes');
     36add_option('license-language','pt_BR','','yes');
     37
     38
    1839$infoImg['cr']['name'] = "copyright";
    1940$infoImg['cr']['alt'] = __('All the rights reserved (Copyright)','wp-licenses');
     
    7091    global $infoImg;
    7192    $imagetheme = get_option('license-theme');
    72     if ($imagetheme == "") $imagetheme = "1";
     93    /*if ($imagetheme == "") $imagetheme = "1";*/
    7394   
    7495    foreach ($infoImg as $value) {
     
    214235    $obraderivada = stripslashes(get_post_meta($post->ID, 'obraderivada', true));
    215236    global $cr, $pd, $cl, $by, $nc, $remix, $share, $sa, $nd;
    216     /*$licenseversion = get_option('license-version');
    217     $licenselanguage = get_option('license-language');*/
    218     $licenseversion = '3.0';
    219     $licenselanguage = 'pt_BR';
     237    $licenseversion = get_option('license-version');
     238    $licenselanguage = get_option('license-language');
    220239   
    221240    /* Creative commons */
     
    301320}
    302321
     322$licensecontent = get_option('license-content');
     323if ($licensecontent) {
     324    add_filter( 'the_content', 'the_licenses' );
     325}
     326
    303327add_action('admin_menu', 'wp_licenses_menu');
    304328    function wp_licenses_menu() {
     
    397421       
    398422
    399 </fieldset>
    400         <?php wp_nonce_field('update-options'); ?>
    401         <input type="hidden" name="action" value="update" />
    402         <input type="hidden" name="page_options" value="license-theme, license-tooltip, license-title, license-default" /> 
    403         <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
     423    </fieldset>
     424    <fieldset id="howtouse">
     425            <legend><?php _e('How to use','wp-licenses') ?></legend>
     426           
     427            <label>
     428            <input type="checkbox" name="license-content" value="1" <?php checked('1', get_option('license-content')); ?> />
     429            <?php _e('Inserir automaticamente ao final do conteúdo','wp-licenses') ?>
     430            </label>
     431           
     432            <p><?php _e('Or put the code above where you want to show the licenses','wp-licenses') ?></p>
     433            <code>&lt;?php if ( function_exists( 'the_licenses' ) ) { the_licenses(); } ?&gt;</code>
     434           
     435    </fieldset>
     436    <?php /*?><fieldset>
     437        <legend>limpar configurações</legend>
     438        <label>
     439            <input type="checkbox" name="license-reset" value="1" <?php checked('1', get_option('license-reset')); ?> />
     440            <?php _e('Deseja desfazer as modificações?','wp-licenses') ?>
     441            </label>
     442    </fieldset><?php */?>
     443   
     444    <?php wp_nonce_field('update-options'); ?>
     445    <input type="hidden" name="action" value="update" />
     446    <input type="hidden" name="page_options" value="license-theme, license-tooltip, license-title, license-default, license-content" />
     447    <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
    404448
    405449  </form>
    406450 
    407  <div id="howtouse">
    408     <h3><?php _e('How to use','wp-licenses') ?></h3>
    409     <p><?php _e('Put the code above where you want to show the licenses','wp-licenses') ?></p>
    410     <code>&lt;?php if ( function_exists( 'the_licenses' ) ) { the_licenses(); } ?&gt;</code> </div>
     451   
    411452</div>
    412453<?php
Note: See TracChangeset for help on using the changeset viewer.