Plugin Directory

Changeset 589473


Ignore:
Timestamp:
08/23/2012 04:26:24 PM (14 years ago)
Author:
ejackisch
Message:

Bug fixes

Location:
profile-custom-content-type/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • profile-custom-content-type/trunk/class/profile_widget.php

    r579420 r589473  
    1 <?
     1<?php
    22function profile_cct_widget_init(){
    33register_widget('Profile_CCT_widget');
  • profile-custom-content-type/trunk/profile-custom-content-type.php

    r588047 r589473  
    33Plugin Name: Profile Custom Content Type
    44Plugin URI:
    5 Version: 1.2.1
     5Version: 1.2.2.1
    66Text Domain: profile_cct
    77Domain Path: /languages
     
    105105       
    106106        add_action( 'init', array($this, 'register_alphabet_taxonomy'));
     107       
     108        add_action( 'admin_init',  array( $this,'update_script'),0) ;
    107109       
    108110        add_action( 'profile_cct_display_archive_controls', array($this, 'display_archive_controls'));
     
    474476    function profiles_cct_init() {
    475477   
    476         $this->taxonomies = get_option( 'Profile_CCT_taxonomy');
     478        $this->taxonomies = get_option( 'Profile_CCT_taxonomy' );
    477479        $this->register_cpt_profile_cct();
    478480        $this->load_scripts_cpt_profile_cct();
    479481       
    480482    }
     483   
     484    /**
     485     * Check if the plugin is updated and if so resave all the data
     486     */
     487    function update_script(){
     488        global $post;
     489        $previous_version = get_option( 'profile_cct_version', 0 );
     490        $this->force_refresh();
     491        if( version_compare( $this->version(), $previous_version, '>' ) ):
     492            update_option( 'profile_cct_version', $this->version() );
     493            $query = new WP_Query('post_type=profile_cct&post_status=published&posts_per_page=-1');
     494            $count = 0;
     495            while($query->have_posts()) : $query->the_post();
     496                $_POST['profile_cct'] = get_post_meta($post->ID, "profile_cct");
     497               
     498                wp_update_post($post);
     499               
     500            endwhile;
     501
     502        endif;
     503    }
     504   
     505    function force_refresh(){
     506        $this->settings_options["list_updated"] = 0;
     507        $this->settings_options["page_updated"] = 0;
     508        $this->settings_options["form_updated"] = 0;
     509        update_option('Profile_CCT_settings', $this->settings_options);
     510    }
     511   
    481512    /**
    482513     * orderby_menu function.
     
    886917    function save_post_data( $data, $postarr ) {
    887918        global $post, $wp_filter;
    888 
    889919        if(!isset( $_POST["profile_cct"] ))
    890920            return $data;
     
    942972       
    943973        //echo $first_letter;
    944        
    945974        $first_letter = strtolower(substr($profile_cct_data["name"]['last'], 0, 1));
    946975        //if($first_letter && $postarr['ID']):
    947976            //echo $first_letter;
    948977            //echo $postarr['ID'];
    949             ( wp_set_post_terms($postarr['ID'], $first_letter, 'profile_cct_letter', false) );
     978            wp_set_post_terms($postarr['ID'], $first_letter, 'profile_cct_letter', false);
    950979        //endif;
    951980        kses_init_filters();
     
    21142143                <input type="submit" value="Search People" />
    21152144            </form>
    2116        
    2117             <?
     2145            <?php
    21182146            $names = array();
    21192147            $query_results = $this->get_all_names();
    2120             foreach($query_results as $result):
     2148            foreach( $query_results as $result ):
    21212149                $names[] = $result->post_title;
    21222150            endforeach;
    21232151            ?> 
    2124            
    21252152            <script>
    2126                 jQuery(function() {
    2127                     var availableTags = <?php echo json_encode($names); ?>;
     2153                jQuery( function() {
     2154                    var availableTags = <?php echo json_encode( $names ); ?>;
    21282155                    jQuery( ".profile-cct-search" ).autocomplete({
    21292156                        source: availableTags
     
    21312158                });
    21322159            </script>
    2133            
    2134            
    2135            
    21362160        </div>
    2137         <?
     2161        <?php
    21382162        return ob_get_clean();
    21392163    }
     
    22542278            <h6>Filter &amp; Order Profiles</h6>
    22552279            <form action="<?php echo get_bloginfo('siteurl'); ?>" method="get">
    2256             <?
     2280            <?php
    22572281            $taxonomies = get_object_taxonomies("profile_cct"); //i swear this line used to be here and then disappeared.
    22582282            foreach($taxonomies as $tax):
    22592283               
    2260                 if(!$options['display_tax'][$tax])continue;
     2284                if(!$options['display_tax'][$tax])
     2285                continue;   
    22612286                ?>
    22622287                <div class="profile-cct-filter-box">   
     
    22922317            </form>
    22932318        </div>
    2294         <?
     2319        <?php
    22952320    }
    22962321   
     
    23192344                        <?php endif; ?>
    23202345                    </li>
    2321                 <? endforeach; ?>
     2346                <?php endforeach; ?>
    23222347            </ul>
    23232348        </div>
    2324         <?
     2349        <?php
    23252350    }
    23262351   
  • profile-custom-content-type/trunk/readme.txt

    r588047 r589473  
    44Requires at least: 3.2
    55Tested up to: 3.4.1
    6 Stable tag: 1.2.1
     6Stable tag: 1.2.2.1
    77
    88Manage and display advanced user profiles on your website.
     
    130130== Change log ==
    131131
     132= Version 1.2.2 =
     133* Removed php short tags which caused fatal errors if they're disabled
     134* Ensure profile data gets updated appropriately when plugin is updated (this process may cause a brief delay after updating if you have lots of profiles)
     135
    132136= Version 1.2.1 =
    133137* Fixed bug where post formatting gets mangled sometimes
Note: See TracChangeset for help on using the changeset viewer.