Changeset 1345260
- Timestamp:
- 02/07/2016 03:23:35 PM (10 years ago)
- Location:
- add-page-from-template/trunk
- Files:
-
- 4 edited
-
add-page-from-template.php (modified) (2 diffs)
-
includes/class-loader.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
-
tests/pages/page-hoge.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
add-page-from-template/trunk/add-page-from-template.php
r1345256 r1345260 5 5 * Description(en): Add pages from template files. 6 6 * Description: Creates virtural page from template file. 7 * Version: 0.4.3 7 * Version: 0.4.3.1 8 8 * Author: Yousan_O 9 9 * Author URI: http://www.l2tp.org … … 58 58 public static function activation_callback() { 59 59 self::getInstance(); // We need instance 60 self::$instance->loader->update_rewrite_rules(); 61 update_option( 'apft_plugin_activated', true ); 62 flush_rewrite_rules(); 60 if ( self::$instance instanceof AP_Loader ) { 61 self::$instance->loader->update_rewrite_rules(); 62 update_option( 'apft_plugin_activated', true ); 63 flush_rewrite_rules(); 64 } 63 65 } 64 66 -
add-page-from-template/trunk/includes/class-loader.php
r1345038 r1345260 66 66 * @see get_default_post_to_edit() 67 67 */ 68 private function setGlobalPost( ) {68 private function setGlobalPost(AP_Template $template) { 69 69 /** @var WP_Post */ 70 70 global $post; … … 77 77 $postObj->post_date_gmt = ''; 78 78 $postObj->post_password = ''; 79 $postObj->post_name = ''; 79 $postObj->post_title = $template->title; 80 $postObj->post_name = sanitize_title($template->title); 80 81 $postObj->post_type = 'page'; 81 82 $postObj->post_status = 'publish'; … … 149 150 //add_action('pre_get_posts', array(self::$instance, 'pre_get_posts')); 150 151 $this->setPagename($template->pagename); 151 $this->setGlobalPost( );152 $this->setGlobalPost($template); 152 153 $this->setGlobalQuery(); 153 154 if ($templatePath = apply_filters('template_include', $templatePath)) { -
add-page-from-template/trunk/readme.txt
r1345256 r1345260 53 53 == Changelog == 54 54 55 = Version 0.4.3.1 = 56 * Fixed: Set title correctly. 57 55 58 = Version 0.4.3 = 56 59 * Upgraded: Show title from template file. -
add-page-from-template/trunk/tests/pages/page-hoge.php
r1345256 r1345260 7 7 * Time: 4:24 PM 8 8 */ 9 9 get_header(); 10 10 ?> 11 11 Hoooowy Gay!
Note: See TracChangeset
for help on using the changeset viewer.