Giter Site home page Giter Site logo

mtoensing / simpletoc Goto Github PK

View Code? Open in Web Editor NEW
32.0 5.0 14.0 12.14 MB

WordPress plugin that adds a custom "Table of Contents" Gutenberg block.

Home Page: https://wordpress.org/plugins/simpletoc/

CSS 1.81% PHP 65.52% JavaScript 32.32% SCSS 0.34%
wordpress gutenberg-blocks gutenberg wordpress-plugin toc-generator toc table-of-contents table-of-contents-generator gutenberg-compatible block

simpletoc's Introduction

=== SimpleTOC - Table of Contents Block ===
Contributors: MarcDK
Tags: TOC, Table of Contents, Gutenberg, block, FAQ
Requires at least: 5.9
Donate link: https://marc.tv/out/donate
Tested up to: 6.5
Stable tag: 6.4.4
Requires PHP: 7.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

SEO-friendly Table of Contents Gutenberg block. No JavaScript and no CSS means faster loading.

== Description ==

Add a Table of Contents block to your posts and pages. The TOC is a nested list of links to all heading found in the post or page. To use it, simply add a block and search for "SimpleTOC" or just "TOC". 

The maximum depth of the toc can be configured in in the blocks' sidebar among many other options. There can hide the headline "Table of Contents" and add your own by using a normal heading block.  

SimpleTOC is open-source and developed on [GitHub Pages](https://github.com/mtoensing/SimpleTOC). If you find a bug or have an idea for a feature please feel free to contribute and create a pull request. 

[Spin up](https://demo.tastewp.com/simpletoc) a new WordPress instance with the SimpleTOC plugin already installed.

= Features =

* Designed for Gutenberg.
* Zero configuration: Add the SimpleTOC block to your post and that's it. 
* Minimal and valid HTML output.
* Utilizes the browser's built-in details tag for a collapsible interface.
* No JavaScript or CSS added. Unless you activate the accordion menu.
* Style SimpleTOC with Gutenberg's native group styling options.
* Inherits the style of your theme.
* Smooth scrolling effect using CSS. 
* Optional ARIA Label and navigation role attributes.
* Translated in [multiple languages](https://translate.wordpress.org/projects/wp-plugins/simpletoc/). Including German, Japanese, Chinese (Taiwan), Dutch, Brazilian Portuguese, French, Spanish and Latvia.
* Ideal for creating a Frequently Asked Questions section on your website.

= Customization = 

* Administrators can utilize global settings to supersede the individual block settings.
* Add background and text color with Gutenberg groups.
* Native block support for wide and full width.
* Control the maximum depth of the headings.
* Choose between an ordered, bullet HTML list. Or indent the list.
* Select a heading level or turn it into a paragraph.
* Disable the h2 heading of the TOC block and add your own.

= Compatibility =

* GeneratePress and Rank Math support.
* Works with popular AMP plugins.

== Changelog ==

= 6.4.3 =
* Added: A pointer cursor on hover for the hidden TOC

= 6.4.3 =
* Added: Utilizes the browser's built-in details tag for a collapsible interface. Thanks @infinitnet
* Compatibility with WordPress 6.5
* Fixed: Minor localization problems.   

= 6.3.2 =
* Fixed: Option for automatic refresh did not work in some instances.

= 6.3.0 =
* Added: Option for automatic refresh. This can be disabled in the blocks advanced settings.
* Added: Option to globally disable automatic refresh in the WordPress SimpleTOC settings.

= 6.2.0 =
* Added: Implemented smooth animation for improved user interaction in the accordion menu.
* Added: Upgraded styling of the accordion menu for a more visually appealing and modern user experience.

= 6.1.0 =
* Fixed: Broken markup when tags closed for headers below minimum. Thanks @harmoney !

= 6.0.10 =
* Added aria-hidden attribute to icon in accordion. Thanks Alex Stine!

= 6.0.9 =
* Added ARIA accessibility labels for the accordion. Thanks Amber Hinds!
* Fixed: Caching of accordion JavaScript. Thanks jghitchcock!
* Added correct ARIA controls attribute.

== Installation ==

SimpleTOC can be found and installed via the Plugin menu within WordPress administration (Plugins -> Add New). Alternatively, it can be downloaded from WordPress.org and installed manually...

In Gutenberg, add a block and search for "SimpleTOC" or just "TOC". Please save your content before you use the block.

== Frequently Asked Questions ==

= Configuring Global Settings in SimpleTOC =

SimpleTOC allows you to configure global settings for your WordPress website. These settings can be enforced globally, overriding any block-level configurations that may exist. To access these settings, navigate to the SimpleTOC section of the WordPress Settings.

= How do I add a background color to SimpleTOC using Gutenberg groups? =

Select the block and select "group" in the context menu. Apply "background color", "link color" and "text color" to this group. SimpleTOC will inherit these styles. You would like to use this styled SimpleTOC group next time you write a post? Convert it to a reusable block.

= How to exclude a single heading from the TOC? = 

If you really want to hide a single heading from the table of contents, then add the CSS class "simpletoc-hidden" to a heading block. You can find this field in the same place as the HTML anchor field: In the Block > Advanced sidebar. But first, think about the reason you would like to hide a specific heading. Maybe you would like to remove all headings of a specific depth level. Then there is an option for that in the blocks options in Gutenberg. If you think this heading should not be part of the toc perhaps it is not needed in the post itself?

= I would like to save my SimpleTOC settings as default. Is that possible?

You can convert your configured SimpleTOC block into a reusable block in Gutenberg. It will keep its settings. This way, you can use your desired settings for each new post by adding the reusable block.

= How to add a div tag wrapper to the TOC? =

If you add a custom class to the SimpleTOC block in "Advanced" and then "Additional CSS Class(es)" a div with that class will be wrapped around the HTML output. 

= How to allow developers to exclude specific headings programmatically? = 

Use the 'simpletoc_excluded_blocks' filter. For example, this code will exclude heading blocks that are inside a column block.

Example: 

    add_filter( 'simpletoc_excluded_blocks', function ( array $blocks ) {
        $blocks[] = 'core/column';

        return $blocks;
    } );


= How do I change the color of the accordion menu? =

The heavy plus character I used can not be colored with css without hacks. But you can change the icon to something else and change the color of the new icon. 

    .simpletoc-collapsible::after {
        content: "✖";
        color: #e94c89;
    } 

= How do I add SimpleTOC to all articles automatically?  =

I don’t see an easy solution at the moment. SimpleTOC is only a block that can be placed in your post. If there was a plugin that adds blocks to every post, then this would be the solution. I think this should be another separate plug-in to keep the code of SimpleTOC clean and … well, simple. 

== Screenshots ==
1. SimpleTOC block in Gutenberg editor.
2. SimpleTOC in the post.
3. Simple but powerful. Customize each TOC as you like.
4. Control the maximum depth of the headings.
5. SimpleTOC styled with Gutenbergs native group styles.
6. SimpleTOC Advanced Features
7. Gutenberg Heading block: Set a custom anchor  
8. SimpleTOC hidden in the accordion menu.
9. SimpleTOC global settings.

== Credits ==

This plugin is forked from [pdewouters](https://github.com/pdewouters/gutentoc) and uses code from [Easy-Table-of-Contents](https://github.com/shazahm1/Easy-Table-of-Contents)

Many thanks to [Tom J Nowell](https://tomjn.com) and and Sally CJ who both helped me a lot with my questions over at wordpress.stackexchange.com

Thanks to Quintus Valerius Soranus for inventing the Table of Contents around 100 BC. 

simpletoc's People

Contributors

blronaldhuereca avatar charmoney avatar dependabot[bot] avatar divimode-philipp avatar mtoensing avatar pdewouters avatar rafaucau avatar takotakot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

simpletoc's Issues

Suggestion: filter out UTF8 icons like 😁 from auto-generated ID's to better pass accessibility checks.

SimpleTOC encodes "special characters" in the header, for instance 😉, when creating an ID for that header, as expected.

That triggers a false "broken link" accessibility check error. Reported here:
equalizedigital/accessibility-checker#483

Screenshot:
300897625-b4402260-ebdc-4ce5-ae79-032312a56dd7

SimpleTOC is not to blame, weird characters need to be encoded in URL's for sure, but have you considered filtering them out entirely. A manual inserted ID without encoded smileys satisfies the accessibility check.

image

Nothing critically that cannot be worked around, but maybe a potential improvement.
Bjarne

Bug: Sticky Top Nav Invalidates Scroll Position

When a navigation bar is fixed/sticky at the top of the page, the Simple Table of Contents (TOC) fails to accurately calculate the required scroll position from the top. Consequently, the targeted H1 to H6 tags end up being obscured by the sticky navigation bar.

How to reproduce:

<nav style="height: 90px;"> //make this sticky
Link1 Link3 Link 5
</nav>
<div>
<p>

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent lobortis ligula sit amet tellus faucibus vulputate. Curabitur imperdiet ligula a lacus volutpat, eget suscipit erat dictum. Integer eget convallis est, sed porta tellus. Phasellus quam nulla, tristique quis justo vitae, blandit ultrices lorem. Morbi at neque ac ex luctus tincidunt in nec ante. Curabitur venenatis tortor neque, id laoreet nibh fringilla eget. Nunc ut purus eu arcu vehicula tristique. Sed at mauris dolor. Phasellus et neque orci. Etiam in vestibulum ante, sit amet ultricies magna. Pellentesque rhoncus mauris vel velit gravida ornare. Praesent et ex ultrices, vulputate quam lacinia, finibus neque.
</p>

<h1> NEXT PARAGRAPH NOTICE UM UNDER THE STICKY NAV</h1>


Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent lobortis ligula sit amet tellus faucibus vulputate. Curabitur imperdiet ligula a lacus volutpat, eget suscipit erat dictum. Integer eget convallis est, sed porta tellus. Phasellus quam nulla, tristique quis justo vitae, blandit ultrices lorem. Morbi at neque ac ex luctus tincidunt in nec ante. Curabitur venenatis tortor neque, id laoreet nibh fringilla eget. Nunc ut purus eu arcu vehicula tristique. Sed at mauris dolor. Phasellus et neque orci. Etiam in vestibulum ante, sit amet ultricies magna. Pellentesque rhoncus mauris vel velit gravida ornare. Praesent et ex ultrices, vulputate quam lacinia, finibus neque.
</div>

I'm proposing a feature that allows us to apply an offset to the Table of Contents (TOC) links upon clicking. In our specific scenario, we would need an offset of 90px.

Add smooth-scroll class to links?

Hello Marc,
thank you for a great plugin!

In the sea of WordPress Plugins that are overloaded with features it is nice to find something lightweight that does the job.

Now for my question:
My theme has a built in smooth scroll function that is triggered by adding class="smooth-scroll" to the <a> tag.
Is there an easy way to make simpletoc output the extra class on it's links?

Thanks in advance,
Alex

Duplicate icon displaying then dissapearing

Issue
Often when opening a post that has the SimpleTOC plugin active two + icons display for a second or two and then one of them disappears.

Using Chrome Dev Tools, I was able to see what the issue was, but not sure of the cause. It appears that the icon is displayed using ::after on <span class="simpletoc-icon"></span>. While the page is still loading in 100%, the icon is duplicated to <button class="simpletoc-collapsible"></button> element one level up.

This is the website I am testing it on: https://sffgeek.com/2023/10/08/jonsbo-n3-8-bay-nas-gpu-pc-case/

I have attached an image of the issue, as well as the ::after in the linked to the button element.

Screenshot 2023-10-08 194521
Screenshot 2023-10-08 195555

Version and device info

  • WordPress v6.3.1
  • Twenty Twenty-Three theme v1.2
  • SimpleTOC v6.0.10
  • Chrome build 117.0.5938.149
  • Windows 11 build 22631.2338

Scroll to top of heading

Maybe I have misconfigured SimpleTOC, but every time I click something in simple TOC it takes me to the bottom of heading and doesn't show the heading i clicked at all.

Suggestion: use details tag without js or css as a "native accordion"

The core idea of SimpleTOC is simplicity without compromises. I always disliked the accordion because of the JavaScript that has to be added.

Now @infinitnet came up with a brilliant idea: the details tag: https://www.w3schools.com/tags/tag_details.asp

The solution could look like this and would replace or be the alternative to the accordion:

<nav aria-label="Table of Contents">
   <details id="simpletoc-details" class="simpletoc">
      <summary>Table of Contents</summary>
      <div class="simpletoc-content">
         <ul class="simpletoc-list">
            <li><a href="#topic-1">Topic 1</a></li>
            <li><a href="#topic-2">Topic 2</a></li>
            <li><a href="#topic-3">Topic 3</a></li>
            <li><a href="#topic-4">Topic 4</a></li>
            <li><a href="#topic-5">Topic 5</a></li>
            <li><a href="#topic-6">Topic 6</a></li>
            <li><a href="#download">Download</a></li>
         </ul>
      </div>
   </details>
</nav>

Are the any suggestions to the markup or general ideas? Especially for the ARIA attributes and the Nav tag?

Make simpleTOC work with sticky headers

Hi, thanks for the great -no thrills, just works- TOC plugin.
I have a suggestion to make it much better with sticky headers.
Add

$tag->setAttribute("style", "display: block; margin-top: -235px; padding-top: 235px;");

below line 397 of plugin.php, but to really shine, make the number 235 configurable (possibly to become any size expression).
I can then configure the size (e.g. in pixel) of my sticky header and link to a position of the page, such that the anchor is showing just below my sticky header and not underneath it ;-)

Function wp_enqueue_script() was called incorrectly when opening Appearance > Widgets

Hey!

I get the following notice, when I go to Appearance > Widgets, having WP-DEBUG and SimpleTOC enabled.

Notice: Function wp_enqueue_script() was called incorrectly. "wp-editor" script should not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-widgets). Please see Debugging in WordPress for more information. (This message was added in version 5.8.0.) in /example.net/wp-includes/functions.php on line 6078

image

If I disable SimpleTOC the notice goes away.

WP 6.5 and PHP 8.2

Is that something you can reproduce?

Best regards,
Bjarne

Ability to disable "Hide in accordion menu" option

For example, in my own theme I have already made my own accordion, with my own scripts.
It would be useful if there was an option to block this option so that editors could not use it to break a site.

This could be another filter for developers.

Block Wrapper

Currently the table of contents is wrapped with <div> only if it has an additional class.
Couldn't it be that this div renders always? This would give theme developers more options for styling this block. Currently, for example, you can't even add a border to the table of contents.
image
Alternatively, I can send a PR to add the appropriate filter. But I think it is better and simpler to just always render this div.

Custom anchor does not work when heading block is a inner block

To reproduce:

  • Add a heading block and set a custom anchor for it
  • Add a group block, for example, and add a heading block inside and set a custom anchor for it
  • The link in the TOC to the first block works, to the second one does not

Editor:
image

Frontend:
image
image

Allow sub-topic lists

Hi!

Thanks for this plugin, I love it!

There's a feature that I would love to see added and that's the ability to add TOC lists within sub-headings.

For example, at the top of a page I might want a TOC of the h2s of the whole document and under each h2 I'd love a TOC of that section - i.e. everything between that h2 and the next.

E.g.

  • TOC of h2s
  • h2
    • TOC of h3s
    • h3
    • h3
    • h3
  • h2
    • TOC of h3s
    • h3
    • h3
    • h3
  • etc.

Use only H2 headings?

It'd be nice to have the option to hide all H3, H4, etc.

It's just a single option more and probably you can deal with it on the PHP side?
So still, no JS or fancy stuff is required.

I quite like this plugin because of its simplicity and no dependencies philosophy, but I can't just add all those long H3s everywhere.
Specially if I want to add this plugin on a fixed navigation on the side.

[Feature request] Ignoring headers in custom blocks

I' m using header blocks inside my own block and I don't want it added to the table of contents.

It would be nice if there was an option to ignore specific parent blocks.
E.g.

add_filter( 'simpletoc_ignored_blocks', function ( array $blocks ) {
	$blocks[] = 'my/custom-block';

	return $blocks;
} );

Additional Header Block Types

Would be great if the TOC could also pull in Headline blocks from GenerateBlocks and/or Headers from Stackable - Gutenberg Blocks - these appear to just render H tags with classes.

PHP Warning: Attempt to read property "post_content" on null

Editors on my site report that sometimes changes to their posts are not saved.
So I turned on WP_DEBUG_LOG and I only see warnings like this:

[13-Jun-2022 11:07:48 UTC] PHP Warning:  Attempt to read property "post_content" on null in /wp-content/plugins/simpletoc/plugin.php on line 109
[13-Jun-2022 11:12:49 UTC] PHP Warning:  Attempt to read property "post_content" on null in /wp-content/plugins/simpletoc/plugin.php on line 109
[13-Jun-2022 11:14:06 UTC] PHP Warning:  Attempt to read property "post_content" on null in /wp-content/plugins/simpletoc/plugin.php on line 109
[13-Jun-2022 11:15:22 UTC] PHP Warning:  Attempt to read property "post_content" on null in /wp-content/plugins/simpletoc/plugin.php on line 109
[13-Jun-2022 11:16:46 UTC] PHP Warning:  Attempt to read property "post_content" on null in /wp-content/plugins/simpletoc/plugin.php on line 109
[13-Jun-2022 11:19:23 UTC] PHP Warning:  Attempt to read property "post_content" on null in /wp-content/plugins/simpletoc/plugin.php on line 109
[13-Jun-2022 11:21:54 UTC] PHP Warning:  Attempt to read property "post_content" on null in /wp-content/plugins/simpletoc/plugin.php on line 109
[13-Jun-2022 11:22:16 UTC] PHP Warning:  Attempt to read property "post_content" on null in /wp-content/plugins/simpletoc/plugin.php on line 109
[13-Jun-2022 11:25:01 UTC] PHP Warning:  Attempt to read property "post_content" on null in /wp-content/plugins/simpletoc/plugin.php on line 109

I'm not sure if this is the cause of the problem, but there are no other errors in the logs.

Duplicate headings = duplicate IDs

The title sort of explains the issue already. If we have an outline like:

H2: PHP
H3: Examples
H2: JavaScript
H3: Examples

then the two H3s would have the same ID and effectively break the functionality of the TOC. This is something I'd consider a critical issue that actually blocks me from using the plugin because having duplicate headings is a relatively common situation and not a rare exception. The obvious solution would be to append -N if there are duplicate headings, eg. #example-1 and #example-2 in the case of above outline.

[Feature Request] Add option to change TOC block heading

Hi there,

This is a simple request to add an option to change the TOC block heading type.

It currently uses H2 by default, but on my site, my default heading is H1.

A simple drop down to select either h1,h2,h3,h4,h5 or h6 as the block heading type would be ideal.

Thanks,

Stux.

Incompatible with sqlite-database-integration plugin

When I try to change the settings, something went wrong. I assume it's because using the sqlite-database-integration plugin, maybe I should ask in this plugin's place.

WordPress database error: [<div style="clear:both">&nbsp;</div> <div class="queries" style="clear:both;margin-bottom:2px;border:red dotted thin;"> <p>MySQL query:</p> <p>UPDATE `wp_options` SET `option_value` = NULL WHERE `option_name` = 'simpletoc_absolute_urls_enabled'</p> <p>Queries made or created this session were:</p> <ol> <li>Executing: BEGIN | (no parameters)</li> <li>Executing: UPDATE `wp_options` SET `option_value` = NULL WHERE `option_name` = :param0 | parameters: simpletoc_absolute_urls_enabled</li> <li>Executing: ROLLBACK | (no parameters)</li> </ol> </div> <div style="clear:both;margin-bottom:2px;border:red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;"> Error occurred at line 3373 in Function <code>handle_error</code>. Error message was: SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: wp_options.option_value. </div> <p>Backtrace:</p> <pre>#0 /var/www/html/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(287): WP_SQLite_Translator->get_error_message() #1 /var/www/html/wp-includes/class-wpdb.php(2766): WP_SQLite_DB->query('UPDATE `wp_opti...') #2 /var/www/html/wp-includes/option.php(547): wpdb->update('wp_options', Array, Array) #3 /var/www/html/wp-admin/options.php(322): update_option('simpletoc_absol...', NULL) #4 {main}</pre> ] UPDATE `wp_options` SET `option_value` = NULL WHERE `option_name` = 'simpletoc_absolute_urls_enabled'

WordPress database error: [<div style="clear:both">&nbsp;</div> <div class="queries" style="clear:both;margin-bottom:2px;border:red dotted thin;"> <p>MySQL query:</p> <p>UPDATE `wp_options` SET `option_value` = NULL WHERE `option_name` = 'simpletoc_wrapper_enabled'</p> <p>Queries made or created this session were:</p> <ol> <li>Executing: BEGIN | (no parameters)</li> <li>Executing: UPDATE `wp_options` SET `option_value` = NULL WHERE `option_name` = :param0 | parameters: simpletoc_wrapper_enabled</li> <li>Executing: ROLLBACK | (no parameters)</li> </ol> </div> <div style="clear:both;margin-bottom:2px;border:red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;"> Error occurred at line 3373 in Function <code>handle_error</code>. Error message was: SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: wp_options.option_value. </div> <p>Backtrace:</p> <pre>#0 /var/www/html/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(287): WP_SQLite_Translator->get_error_message() #1 /var/www/html/wp-includes/class-wpdb.php(2766): WP_SQLite_DB->query('UPDATE `wp_opti...') #2 /var/www/html/wp-includes/option.php(547): wpdb->update('wp_options', Array, Array) #3 /var/www/html/wp-admin/options.php(322): update_option('simpletoc_wrapp...', NULL) #4 {main}</pre> ] UPDATE `wp_options` SET `option_value` = NULL WHERE `option_name` = 'simpletoc_wrapper_enabled'

WordPress database error: [<div style="clear:both">&nbsp;</div> <div class="queries" style="clear:both;margin-bottom:2px;border:red dotted thin;"> <p>MySQL query:</p> <p>UPDATE `wp_options` SET `option_value` = NULL WHERE `option_name` = 'simpletoc_accordion_enabled'</p> <p>Queries made or created this session were:</p> <ol> <li>Executing: BEGIN | (no parameters)</li> <li>Executing: UPDATE `wp_options` SET `option_value` = NULL WHERE `option_name` = :param0 | parameters: simpletoc_accordion_enabled</li> <li>Executing: ROLLBACK | (no parameters)</li> </ol> </div> <div style="clear:both;margin-bottom:2px;border:red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;"> Error occurred at line 3373 in Function <code>handle_error</code>. Error message was: SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: wp_options.option_value. </div> <p>Backtrace:</p> <pre>#0 /var/www/html/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(287): WP_SQLite_Translator->get_error_message() #1 /var/www/html/wp-includes/class-wpdb.php(2766): WP_SQLite_DB->query('UPDATE `wp_opti...') #2 /var/www/html/wp-includes/option.php(547): wpdb->update('wp_options', Array, Array) #3 /var/www/html/wp-admin/options.php(322): update_option('simpletoc_accor...', NULL) #4 {main}</pre> ] UPDATE `wp_options` SET `option_value` = NULL WHERE `option_name` = 'simpletoc_accordion_enabled'

WordPress database error: [<div style="clear:both">&nbsp;</div> <div class="queries" style="clear:both;margin-bottom:2px;border:red dotted thin;"> <p>MySQL query:</p> <p>UPDATE `wp_options` SET `option_value` = NULL WHERE `option_name` = 'simpletoc_smooth_enabled'</p> <p>Queries made or created this session were:</p> <ol> <li>Executing: BEGIN | (no parameters)</li> <li>Executing: UPDATE `wp_options` SET `option_value` = NULL WHERE `option_name` = :param0 | parameters: simpletoc_smooth_enabled</li> <li>Executing: ROLLBACK | (no parameters)</li> </ol> </div> <div style="clear:both;margin-bottom:2px;border:red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;"> Error occurred at line 3373 in Function <code>handle_error</code>. Error message was: SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: wp_options.option_value. </div> <p>Backtrace:</p> <pre>#0 /var/www/html/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(287): WP_SQLite_Translator->get_error_message() #1 /var/www/html/wp-includes/class-wpdb.php(2766): WP_SQLite_DB->query('UPDATE `wp_opti...') #2 /var/www/html/wp-includes/option.php(547): wpdb->update('wp_options', Array, Array) #3 /var/www/html/wp-admin/options.php(322): update_option('simpletoc_smoot...', NULL) #4 {main}</pre> ] UPDATE `wp_options` SET `option_value` = NULL WHERE `option_name` = 'simpletoc_smooth_enabled'

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php:189) in /var/www/html/wp-includes/pluggable.php on line 1435 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php:189) in /var/www/html/wp-includes/pluggable.php on line 1438

Match icon colour to WordPress theme colour

Idea
Instead of using the default purple colour (#635994) as the colour for the + and - icon, it would be a nice touch to have it use the WordPress default theme colours selected by the user.

WordPress includes the following CSS variables:

    --wp--preset--color--base: #ffffff;
    --wp--preset--color--contrast: #000000;
    --wp--preset--color--primary: #2195ff;
    --wp--preset--color--secondary: #004382;
    --wp--preset--color--tertiary: #F6F6F6;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.