Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • FWIW the above edit does not seem to work in the current release (3.1.6). The following seems to work, at line #1778 (I’ve included the adjacent unmodified lines to show where it goes:

    $excludes = $this->GetOption('b_exclude'); //Excluded posts
    
    // insert begins here
    foreach ($excludes as $exclude) {
      $children = get_pages(array('child_of' => $exclude));
      foreach ($children as $child)
        $exChildren[] = $child->ID;
        }
      if (is_array($exChildren)) $excludes = array_merge($exChildren, $excludes);
    // insert ends here
    
    $exclCats = $this->GetOption("b_exclude_cats"); // Excluded cats

    As msafi said above, try at your own risk. ??

    This would be a very desirable feature for the base plug-in, and in fact it’s strange not to be there already. I hope Arne considers making the change. It has always struck me as a key problem for the plugin and the reason I can’t use it and had to roll my own.

    Thread Starter spinality

    (@spinality)

    Sorry to reply to my own post, but I now realize that the shortcode callback can determine which code matched the shortcode regex (via the hitherto undocumented third argument to the callback). This makes it possible to implement the above behavior by testing for shortcode name, rather than through default parameters on the add_shortcode() call. This could still be a useful feature but there is a good alternative already in place.

    Thread Starter spinality

    (@spinality)

    <blush> This feature already exists, I misread the code. I will add it to the Codex documentation. Sorry. </blush>

    Sorry, when I suggested using $post as null during search, I meant this would have to be implemented in the bowels of the core code, not in anything we can touch safely.

    I had the same question – and was happy to see I was not the first. In my case, the problem was due to sloppy use of $post->post_parent. My sidebar.php uses the $post data to refer to the current post ID, title, etc., for static page formatting. However, and somewhat surprisingly, in a search page $post->* apparently refers to one of the search results, presumably the first or the last.

    In my situation, it was easy to use is_search() to exclude such cases. However, this won’t work for somebody using generic wp_list_pages() output. If somebody has time it would be good to figure out and document the semantics of $post->* on the search pages. I’m guessing that a search page should consider $post as null.

Viewing 6 replies - 1 through 6 (of 6 total)