Changeset 893871
- Timestamp:
- 04/15/2014 10:12:24 PM (12 years ago)
- Location:
- filament/branches/redesign
- Files:
-
- 2 added
- 3 edited
-
. (modified) (1 prop)
-
.editorconfig (added)
-
.jshintrc (added)
-
filament.php (modified) (6 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
filament/branches/redesign
- Property svn:mergeinfo changed
/filament/branches/jsonp (added) merged: 893714-893715
- Property svn:mergeinfo changed
-
filament/branches/redesign/filament.php
r893849 r893871 4 4 Plugin URI: http://filament.io/ 5 5 Description: Install & manage all your Web apps from a single place. Connect your website to Filament with this plugin, and never bug your developers again! 6 Version: 1. 1.06 Version: 1.2.0 7 7 Author: dtelepathy 8 8 Author URI: http://www.dtelepathy.com/ … … 31 31 var $slug = "filament"; 32 32 var $menu_hooks = array(); 33 var $version = '1. 1.0';33 var $version = '1.2.0'; 34 34 35 35 /** … … 97 97 } 98 98 99 100 99 /** 101 100 * Define the admin menu options for this plugin … … 132 131 */ 133 132 public function ajax_taxonomy_structure() { 134 header( 'Content-type: application/json' ); 133 $header = "application/json"; 134 135 if( isset( $_REQUEST['callback'] ) ) { 136 $callback = preg_replace( "/([^A-Za-z0-9_\$\.]+)/", "", $_REQUEST['callback'] ); 137 $header = "application/javascript"; 138 } 139 140 header( 'Content-type: ' . $header ); 135 141 136 142 $structure = array( … … 142 148 $post_types = wp_cache_get( 'post_types', $this->slug ); 143 149 if( !$post_types ) { 144 $post_types = get_post_types( array( 'public' => true ) ); 150 $post_types = array(); 151 $post_type_slugs = get_post_types( array( 'public' => true ) ); 152 153 foreach( $post_type_slugs as $post_type_slug ) $post_types[] = get_post_type_object( $post_type_slug ); 154 145 155 wp_cache_set( 'post_types', $post_types, $this->slug, 3600 ); 146 156 } … … 158 168 } 159 169 160 $structure['post_types'] = array_values( $post_types ); 161 foreach( $categories as $category ) $structure['categories'][] = $category->slug; 162 foreach( $tags as $tag ) $structure['tags'][] = $tag->slug; 163 164 exit( json_encode( $structure ) ); 170 foreach( $post_types as $post_type ) $structure['post_types'][$post_type->name] = $post_type->label; 171 foreach( $categories as $category ) $structure['categories'][$category->slug] = $category->name; 172 foreach( $tags as $tag ) $structure['tags'][$tag->slug] = $tag->name; 173 174 $data = json_encode( $structure ); 175 176 if( isset( $callback ) && !empty( $callback ) ) { 177 $data = "$callback($data)"; 178 } 179 180 exit( $data ); 165 181 } 166 182 -
filament/branches/redesign/readme.txt
r887038 r893871 47 47 48 48 == Changelog == 49 = 1.2.0 = 50 * Modify AJAX end-point to respond to JSONP requests with a _REQUEST['callback'] parameter 51 * Restructure post_types structure in AJAX end-point response to respond with a key/value pair of name and label 52 * Plugin UI redesign 53 49 54 = 1.1.0 = 50 55 * Add save messaging to admin view
Note: See TracChangeset
for help on using the changeset viewer.