Plugin Directory

Changeset 1958292


Ignore:
Timestamp:
10/17/2018 08:23:40 PM (7 years ago)
Author:
thrivehive
Message:

v2.52

Location:
thrivehive/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • thrivehive/trunk/README.md

    r1958169 r1958292  
    107107
    108108## Changelog
     109* V 2.52 Added filters
    109110* V 2.51 Added Thrivehive Wysiwyg Button widget
    110111* V 2.5 Added Wysiwyg button functionality
  • thrivehive/trunk/thrivehive.php

    r1958169 r1958292  
    55   *Plugin URI: http://thrivehive.com
    66   *Description: A plugin to include ThriveHive's tracking code
    7    *Version: 2.51
     7   *Version: 2.52
    88   *Author: ThriveHive
    99   *Author URI: http://thrivehive.com
     
    14511451  // Show the post preview
    14521452  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'];
    14551455      $preview_posts = get_option('simple_preview');
    14561456
    1457       //if ( !isset($preview_posts[$this->id]) )
    1458       //    wp_die('You do not have permission to publicly preview this post.');
    14591457      add_action('pre_get_posts', array($this,'pages_filter'));
    14601458      add_filter('posts_results', array(&$this, 'fake_publish'));
     
    14621460  }
    14631461
    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    }
    14661468  }
    14671469
     
    14691471  function fake_publish($posts) {
    14701472    if($posts[0]){
    1471     $posts[0]->post_status = 'publish';
    1472     }
    1473     //$posts[0] =  array('post_status' => 'publish');
     1473      $posts[0]->post_status = 'publish';
     1474    }
    14741475    return $posts;
    14751476  }
Note: See TracChangeset for help on using the changeset viewer.