Plugin Directory

Changeset 2534465


Ignore:
Timestamp:
05/19/2021 07:51:39 PM (5 years ago)
Author:
frankpw
Message:

Preparation 1 for 1.9.4

Location:
fpw-category-thumbnails/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • fpw-category-thumbnails/trunk/ajax/update.php

    r2496446 r2534465  
    1010$cleanup = ( in_array( 'cleanup', $boxes ) ) ? true : false;
    1111$abar = ( in_array( 'abar', $boxes ) ) ? true : false;
     12$ccats = ( in_array( 'ccats', $boxes ) ) ? true : false;
     13$cposts = ( in_array( 'cposts', $boxes ) ) ? true : false;
    1214$fpt = ( in_array( 'fpt', $boxes ) ) ? true : false;
    1315
     
    1618$opt[ 'donotover' ] = $donotover;
    1719$opt[ 'abar' ] = $abar;
     20$opt[ 'ccats' ] = $ccats;
     21$opt[ 'cposts' ] = $cposts;
    1822$opt[ 'fpt' ] = $fpt;
    1923$ok = update_option( 'fpw_category_thumb_opt', $opt );
  • fpw-category-thumbnails/trunk/classes/fpw-category-thumbnails-class.php

    r2533432 r2534465  
    6060        add_filter( 'plugin_action_links_fpw-category-thumbnails/fpw-category-thumbnails.php', array( $this, 'pluginLinks' ), 10, 2);
    6161        add_filter( 'plugin_row_meta', array( $this, 'pluginMetaLinks'), 10, 2 );
    62         add_filter('manage_edit-category_columns', array( $this, 'fpw_category_columns_head' ) );
    63         add_filter('manage_category_custom_column', array( $this, 'fpw_custom_category_column_content' ), 10, 3 );
    64         add_filter('manage_post_posts_columns', array( $this, 'fpw_posts_columns_head' ) );
    65         add_action('manage_post_posts_custom_column', array( $this, 'fpw_custom_posts_column_content' ), 10, 2 );
     62        if( $this->fctOptions['ccats'] ) {
     63            add_filter('manage_edit-category_columns', array( $this, 'fpw_category_columns_head' ) );
     64            add_filter('manage_category_custom_column', array( $this, 'fpw_custom_category_column_content' ), 10, 3 );
     65        }
     66        if( $this->fctOptions['cposts'] ) {
     67            add_filter('manage_post_posts_columns', array( $this, 'fpw_posts_columns_head' ) );
     68            add_action('manage_post_posts_custom_column', array( $this, 'fpw_custom_posts_column_content' ), 10, 2 );
     69        }
    6670    }
    6771
     
    553557        echo '> ' . __( "Remove plugin's data from database on uninstall", 'fpw-category-thumbnails' ) . '<br />';
    554558
     559        //  add thumbnail column for categories list checkbox
     560        echo '<input type="checkbox" class="option-group" id="box-ccats" name="ccats" value="ccats"';
     561        if ( $this->fctOptions[ 'ccats' ] )
     562            echo ' checked';
     563        echo '> ' . __( "Add thumbnail column to categories list", 'fpw-category-thumbnails' ) . '<br />';
     564
     565        //  add thumbnail column for posts list checkbox
     566        echo '<input type="checkbox" class="option-group" id="box-cposts" name="cposts" value="cposts"';
     567        if ( $this->fctOptions[ 'cposts' ] )
     568            echo ' checked';
     569        echo '> ' . __( "Add thumbnail column to posts list", 'fpw-category-thumbnails' ) . '<br />';
     570
    555571        //  enable FPW Post Thumbnails plugin checkbox
    556572        echo '<input type="checkbox" class="option-group" id="box-fpt" name="fpt" value="fpt"';
     
    670686                'clean'     => FALSE,
    671687                'donotover' => FALSE,
     688                'ccats'     => FALSE,
     689                'cposts'    => FALSE,
    672690                'fpt'       => FALSE );
    673691
     
    680698                $needs_update = TRUE;
    681699                $opt[ 'donotover' ] = FALSE;
     700            }
     701            if ( !array_key_exists( 'ccats', $opt ) || !is_bool( $opt[ 'ccats' ] ) ) {
     702                $needs_update = TRUE;
     703                $opt[ 'ccats' ] = FALSE;
     704            }
     705            if ( !array_key_exists( 'cposts', $opt ) || !is_bool( $opt[ 'cposts' ] ) ) {
     706                $needs_update = TRUE;
     707                $opt[ 'cposts' ] = FALSE;
    682708            }
    683709            if ( !array_key_exists( 'fpt', $opt ) || !is_bool( $opt[ 'fpt' ] ) ) {
Note: See TracChangeset for help on using the changeset viewer.