Changeset 589473
- Timestamp:
- 08/23/2012 04:26:24 PM (14 years ago)
- Location:
- profile-custom-content-type/trunk
- Files:
-
- 3 edited
-
class/profile_widget.php (modified) (1 diff)
-
profile-custom-content-type.php (modified) (10 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
profile-custom-content-type/trunk/class/profile_widget.php
r579420 r589473 1 <? 1 <?php 2 2 function profile_cct_widget_init(){ 3 3 register_widget('Profile_CCT_widget'); -
profile-custom-content-type/trunk/profile-custom-content-type.php
r588047 r589473 3 3 Plugin Name: Profile Custom Content Type 4 4 Plugin URI: 5 Version: 1.2. 15 Version: 1.2.2.1 6 6 Text Domain: profile_cct 7 7 Domain Path: /languages … … 105 105 106 106 add_action( 'init', array($this, 'register_alphabet_taxonomy')); 107 108 add_action( 'admin_init', array( $this,'update_script'),0) ; 107 109 108 110 add_action( 'profile_cct_display_archive_controls', array($this, 'display_archive_controls')); … … 474 476 function profiles_cct_init() { 475 477 476 $this->taxonomies = get_option( 'Profile_CCT_taxonomy' );478 $this->taxonomies = get_option( 'Profile_CCT_taxonomy' ); 477 479 $this->register_cpt_profile_cct(); 478 480 $this->load_scripts_cpt_profile_cct(); 479 481 480 482 } 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 481 512 /** 482 513 * orderby_menu function. … … 886 917 function save_post_data( $data, $postarr ) { 887 918 global $post, $wp_filter; 888 889 919 if(!isset( $_POST["profile_cct"] )) 890 920 return $data; … … 942 972 943 973 //echo $first_letter; 944 945 974 $first_letter = strtolower(substr($profile_cct_data["name"]['last'], 0, 1)); 946 975 //if($first_letter && $postarr['ID']): 947 976 //echo $first_letter; 948 977 //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); 950 979 //endif; 951 980 kses_init_filters(); … … 2114 2143 <input type="submit" value="Search People" /> 2115 2144 </form> 2116 2117 <? 2145 <?php 2118 2146 $names = array(); 2119 2147 $query_results = $this->get_all_names(); 2120 foreach( $query_results as $result):2148 foreach( $query_results as $result ): 2121 2149 $names[] = $result->post_title; 2122 2150 endforeach; 2123 2151 ?> 2124 2125 2152 <script> 2126 jQuery( function() {2127 var availableTags = <?php echo json_encode( $names); ?>;2153 jQuery( function() { 2154 var availableTags = <?php echo json_encode( $names ); ?>; 2128 2155 jQuery( ".profile-cct-search" ).autocomplete({ 2129 2156 source: availableTags … … 2131 2158 }); 2132 2159 </script> 2133 2134 2135 2136 2160 </div> 2137 <? 2161 <?php 2138 2162 return ob_get_clean(); 2139 2163 } … … 2254 2278 <h6>Filter & Order Profiles</h6> 2255 2279 <form action="<?php echo get_bloginfo('siteurl'); ?>" method="get"> 2256 <? 2280 <?php 2257 2281 $taxonomies = get_object_taxonomies("profile_cct"); //i swear this line used to be here and then disappeared. 2258 2282 foreach($taxonomies as $tax): 2259 2283 2260 if(!$options['display_tax'][$tax])continue; 2284 if(!$options['display_tax'][$tax]) 2285 continue; 2261 2286 ?> 2262 2287 <div class="profile-cct-filter-box"> … … 2292 2317 </form> 2293 2318 </div> 2294 <? 2319 <?php 2295 2320 } 2296 2321 … … 2319 2344 <?php endif; ?> 2320 2345 </li> 2321 <? endforeach; ?>2346 <?php endforeach; ?> 2322 2347 </ul> 2323 2348 </div> 2324 <? 2349 <?php 2325 2350 } 2326 2351 -
profile-custom-content-type/trunk/readme.txt
r588047 r589473 4 4 Requires at least: 3.2 5 5 Tested up to: 3.4.1 6 Stable tag: 1.2. 16 Stable tag: 1.2.2.1 7 7 8 8 Manage and display advanced user profiles on your website. … … 130 130 == Change log == 131 131 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 132 136 = Version 1.2.1 = 133 137 * Fixed bug where post formatting gets mangled sometimes
Note: See TracChangeset
for help on using the changeset viewer.