Support » Plugin: Post UI Tabs » [Plugin: Post UI Tabs] Create a setter method overide has_tabs

  • Resolved proximity2008


    Nice plugin.

    I got stuck however with its implementation because there is no way to overide has_tabs()

    I was trying to use the plugin to pull child pages onto a parent page, and because the parent page did not have has_tabs() set the shortcode, it wouldn’t execute.

    I tried various do shortcode / filter combinations in vain.

    $loop = new WP_Query( array( 'post_type' =>  $post->post_type,
                                       'posts_per_page' => -1,
                                       'post_parent' => $post->post_parent )
          // using the WordPress UI tab plugin.
          while ( $loop->have_posts() ) : $loop->the_post();
             $title = get_the_title();
             $content = get_the_content();
             //simply does not work...
             $shortcode_content .= "[tab name=\"{$title}\"]\r\njust does not work!\r\n[/tab]";
          $shortcode_content .= "\r\n[end_tabset]";
          echo apply_filters( 'the_content', $shortcode_content  );

    Now if I could force has_tabs to true via a public method I could get around it.

    Thanks anyway.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mark / t31os


    That’s a reasonable request(and a minor code change), i’ve just pushed out an update that switches the $has_tabs variable to public, so you can now do this just before your custom loop..

    global $Post_UI_Tabs;
    $Post_UI_Tabs->has_tabs = true;

    The tabs should then activate as expected, at least they did in my limited testing.. 🙂

    EDIT: April 21st 2013

    I don’t think the above change was the smartest of ways to provide users with a means to set the variable, so i’ve added a new filter in the current version of Post UI Tabs for setting has_tabs, please see the FAQ.

    Thank you for doing this.

    I will keep that in the back of my mind when I use your plugin again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Post UI Tabs] Create a setter method overide has_tabs’ is closed to new replies.