getTOCList(); } /** * Display the current post's TOC list or supplied post's TOC list. * * @access public * @since 2.0 * * @param null|WP_Post $post An instance of WP_Post * @param bool $apply_content_filter Whether or not to apply `the_content` filter when processing post for headings. */ function ez_toc_list( $post = null, $apply_content_filter = true ) { echo get_ez_toc_list( $post, $apply_content_filter ); } /** * Get the current post's TOC content block or supplied post's TOC content block. * * @access public * @since 2.0 * * @param int|null|WP_Post $post An instance of WP_Post or post ID. Defaults to current post. * @param bool $apply_content_filter Whether or not to apply `the_content` filter when processing post for headings. * * @return string */ function get_ez_toc_block( $post = null, $apply_content_filter = true ) { if ( ! $post instanceof WP_Post ) { $post = get_post( $post ); } if ( $apply_content_filter ) { $ezPost = new ezTOC_Post( $post ); } else { $ezPost = new ezTOC_Post( $post, false ); } return $ezPost->getTOC(); } /** * Display the current post's TOC content or supplied post's TOC content. * * @access public * @since 2.0 * * @param null|WP_Post $post An instance of WP_Post * @param bool $apply_content_filter Whether or not to apply `the_content` filter when processing post for headings. */ function ez_toc_block( $post = null, $apply_content_filter = true ) { echo get_ez_toc_block( $post, $apply_content_filter ); } function ez_toc_inline_styles(){ echo ""; } if (ezTOC_Option::get( 'inline_css' )) { add_action('wp_head', 'ez_toc_inline_styles'); } add_action( 'woocommerce_archive_description', 'ez_toc_woo_category_desc' ); function ez_toc_woo_category_desc() { if (!function_exists('vtde_php_upgrade_notice')) { return false; } $term_object = get_queried_object(); $desc = $term_object->description; preg_match_all( '@(.*?)<\/h1>@', $desc, $matches ); $array = $matches[1]; $container = '

' . esc_html_e('Table of Contents', 'easy-table-of-contents') . '

' . ezTOC::getTOCToggleIcon() . '
'; $desc = $container . $vals . $last . $desc; echo $desc; } add_action('wp_head', 'ez_toc_woo_cat_desc_remove'); function ez_toc_woo_cat_desc_remove(){ if (!function_exists('vtde_php_upgrade_notice')) { return false; } remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); } //if (function_exists( 'mpg_run' )) { // add_filter('the_content', 'ez_toc_mpg'); //} //function ez_toc_mpg($content){ // if (is_front_page() || is_single()) { // return $content; // } /* preg_match_all( '/(.*?)<\/h(.*?)>/', $content, $matches );*/ // $array = $matches[2]; // $container = '

' . esc_html_e('Table of Contents', 'easy-table-of-contents') . '

'; // $content = $container . $vals . $last . $content; // //return $content; //} //if( is_plugin_active('beaver-builder-lite-version/fl-builder.php') ) //{ // add_filter( 'the_content', array( ezTOC::class, 'the_content' ) ); //} /** * EzPrintR method * to print_r content with pre tags * @since 2.0.34 * @param $content * @return void */ function EzPrintR($content){ echo "
";
    print_r($content);
    echo "
"; } /** * EzDumper method * to var_dump content with pre tags * @since 2.0.34 * @param $content * @return void */ function EzDumper($content){ echo "
";
    var_dump($content);
    echo "
"; }