Changeset 814888
- Timestamp:
- 12/04/2013 02:06:02 PM (12 years ago)
- Location:
- foodlist/trunk
- Files:
-
- 6 edited
-
lib/Foodlist/Project/WordPress/Plugin/Foodlist/Controller/ActivationController.php (modified) (3 diffs)
-
lib/Foodlist/Project/WordPress/Plugin/Foodlist/Controller/CommonController.php (modified) (1 diff)
-
lib/Foodlist/Project/WordPress/Plugin/Foodlist/Generic/Post/BasePost.php (modified) (2 diffs)
-
lib/Foodlist/Project/WordPress/Plugin/Foodlist/Generic/Post/MenuPostFactory.php (modified) (1 diff)
-
plugin.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
foodlist/trunk/lib/Foodlist/Project/WordPress/Plugin/Foodlist/Controller/ActivationController.php
r792818 r814888 19 19 public function init() 20 20 { 21 // in fact it should be always true, it's just for making sure 22 if (did_action('init')) { 23 // because init was called before the plugin started, we need to prepare some structures 24 // so that the plugin could install the demo data 25 add_image_size('fl-menu-tag-icon', 16, 16, true); 26 add_image_size('fl-menu-item-thumb', 100, 100, true); 27 28 fl_setup_wpdb_meta_table(); 29 $this->loadTaxonomies(); 30 $this->loadCustomPosts(); 31 } 32 21 33 if (get_option('foodlist_first_start', 1)) { 22 // in fact it should be always true, it's just for making sure23 if (did_action('init')) {24 // because init was called before the plugin started, we need to prepare some structures25 // so that the plugin could install the demo data26 add_image_size('fl-menu-tag-icon', 16, 16, true);27 add_image_size('fl-menu-item-thumb', 100, 100, true);28 29 30 fl_setup_wpdb_meta_table();31 $this->loadTaxonomies();32 }33 34 $this->createDBTables(); 34 35 $this->setupDemoData(); … … 36 37 update_option('foodlist_first_start', 0); 37 38 } 39 40 // register taxonomies/post types here 41 flush_rewrite_rules(); 42 38 43 return $this; 39 44 } … … 46 51 { 47 52 $taxonomies = $this->getManager()->get('taxonomies', array()); 53 48 54 foreach ($taxonomies as $taxonomy) { 49 55 $taxonomy->onInit(); 50 56 } 51 57 } 52 58 59 /** 60 * Explicitly calls onInit for all the plugin's registered posts 61 * this is normally called at 'init' action, but is not during the activation process 62 */ 63 private function loadCustomPosts() 64 { 65 $posts = $this->getManager()->get('custom_posts', array()); 66 67 foreach ($posts as $post) { 68 $post->onInit(); 69 } 70 } 71 53 72 /** 54 73 * Prepare custom tables -
foodlist/trunk/lib/Foodlist/Project/WordPress/Plugin/Foodlist/Controller/CommonController.php
r792818 r814888 51 51 private function registerPostTypes() 52 52 { 53 $menu = new MenuItemPost(); 53 $customPosts = array(); 54 $customPosts['menu-item'] = $menu = new MenuItemPost(); 54 55 $menu->setupRegistrationHook(); 55 $ menu = new MenuSectionPost();56 $customPosts['menu-section'] = $menu = new MenuSectionPost(); 56 57 $menu->setupRegistrationHook(); 57 $ menu = new MenuPost();58 $customPosts['menu'] = $menu = new MenuPost(); 58 59 $menu->setupRegistrationHook(); 60 $this->getManager()->set('custom_posts', $customPosts); 59 61 return $this; 60 62 } -
foodlist/trunk/lib/Foodlist/Project/WordPress/Plugin/Foodlist/Generic/Post/BasePost.php
r792818 r814888 28 28 return $this; 29 29 } 30 30 31 private function getTheExcerpt() { 32 $post = get_post(); 33 34 if (post_password_required()) { 35 return __('There is no excerpt because this is a protected post.', 'foodlist'); 36 } 37 38 return $post->post_excerpt; 39 } 40 41 31 42 public function preparePostData() 32 43 { … … 35 46 //$price = $this->getPrice(); 36 47 //$tags = $this->getTags(); 37 $excerpt = get_the_excerpt();48 $excerpt = $this->getTheExcerpt(); 38 49 $content = get_the_content(); 39 50 -
foodlist/trunk/lib/Foodlist/Project/WordPress/Plugin/Foodlist/Generic/Post/MenuPostFactory.php
r792818 r814888 29 29 if ($query->have_posts()) { 30 30 $query->the_post(); 31 31 32 32 $menuItem = new MenuPost(get_the_ID()); 33 33 $menuItem->preparePostData(); -
foodlist/trunk/plugin.php
r793602 r814888 12 12 Author: Artprima 13 13 Author URI: http://artprima.eu/ 14 Version: 1. 114 Version: 1.2 15 15 */ 16 16 17 define('FOODLIST_VERSION', '1. 1');17 define('FOODLIST_VERSION', '1.2'); 18 18 define('FOODLIST_MIN_PHP_VERSION', '5.3.0'); 19 19 define('FOODLIST_MIN_WP_VERSION', '3.4.0'); -
foodlist/trunk/readme.txt
r793602 r814888 47 47 == ChangeLog == 48 48 49 = Version 1.2 = 50 51 * Fixed empty menu excerpt issue 52 * Added `flush_rewrite_rules()` call on plugin activation 53 49 54 = Version 1.1 = 50 55
Note: See TracChangeset
for help on using the changeset viewer.