Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. $items
  2. $tic
  3. $find
  4. $replace
  5. $post
  6.  
  7. if ( $tic->is_eligible($custom_toc_position) ) {
  8.  
  9. extract( $args );
  10.  
  11. $items = $tic->extract_headings( $find, $replace,wptexturize($post->post_content) );
  12. $title = ( array_key_exists('title', $instance) ) ? apply_filters('widget_title', $instance['title']) : '';
  13. if ( strpos($title, '%PAGE_TITLE%') !== false ) $title = str_replace( '%PAGE_TITLE%', get_the_title(), $title );
  14. if ( strpos($title, '%PAGE_NAME%') !== false ) $title = str_replace( '%PAGE_NAME%', get_the_title(), $title );
  15. $hide_inline = $toc_options['show_toc_in_widget_only'];
  16.  
  17. $css_classes = '';
  18. // bullets?
  19. if ( $toc_options['bullet_spacing'] )
  20. $css_classes .= ' have_bullets';
  21. else
  22. $css_classes .= ' no_bullets';
  23.  
  24. if ( $items ) {
  25. // before widget (defined by themes)
  26. echo $before_widget;
  27.  
  28. // display the widget title if one was input (before and after titles defined by themes)
  29. if ( $title ) echo $before_title . $title . $after_title;
  30.  
  31. // display the list
  32. echo '<ul class="toc_widget_list' . $css_classes . '">' . $items . '</ul>';
  33.  
  34. // after widget (defined by themes)
  35. echo $after_widget;
  36. }
  37.  
  38. $items = '>'.$items
  39. $tic = '>'.$tic
  40. $find = '>'.$find
  41. .
  42. .
  43. .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement