Changeset 1958292
- Timestamp:
- 10/17/2018 08:23:40 PM (7 years ago)
- Location:
- thrivehive/trunk
- Files:
-
- 2 edited
-
README.md (modified) (1 diff)
-
thrivehive.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
thrivehive/trunk/README.md
r1958169 r1958292 107 107 108 108 ## Changelog 109 * V 2.52 Added filters 109 110 * V 2.51 Added Thrivehive Wysiwyg Button widget 110 111 * V 2.5 Added Wysiwyg button functionality -
thrivehive/trunk/thrivehive.php
r1958169 r1958292 5 5 *Plugin URI: http://thrivehive.com 6 6 *Description: A plugin to include ThriveHive's tracking code 7 *Version: 2.5 17 *Version: 2.52 8 8 *Author: ThriveHive 9 9 *Author URI: http://thrivehive.com … … 1451 1451 // Show the post preview 1452 1452 function show_preview() { 1453 if ( !is_admin() && isset($_GET['p ']) && isset($_GET['preview']) ) {1454 $this->id = (int) $_GET['p '];1453 if ( !is_admin() && isset($_GET['page_id']) && isset($_GET['preview']) ) { 1454 $this->id = (int) $_GET['page_id']; 1455 1455 $preview_posts = get_option('simple_preview'); 1456 1456 1457 //if ( !isset($preview_posts[$this->id]) )1458 // wp_die('You do not have permission to publicly preview this post.');1459 1457 add_action('pre_get_posts', array($this,'pages_filter')); 1460 1458 add_filter('posts_results', array(&$this, 'fake_publish')); … … 1462 1460 } 1463 1461 1464 function pages_filter($query){ 1465 $query->set('post_type', 'any'); 1462 function pages_filter($query) { 1463 // In WYSIWYG, this call causes the menu to not show up in the draft preview 1464 // TODO: Investigate how this call impacts legacy previews and whether we need it at all 1465 if (!is_thrivehive_wysiwyg()) { 1466 $query->set('post_type', 'any'); 1467 } 1466 1468 } 1467 1469 … … 1469 1471 function fake_publish($posts) { 1470 1472 if($posts[0]){ 1471 $posts[0]->post_status = 'publish'; 1472 } 1473 //$posts[0] = array('post_status' => 'publish'); 1473 $posts[0]->post_status = 'publish'; 1474 } 1474 1475 return $posts; 1475 1476 }
Note: See TracChangeset
for help on using the changeset viewer.