Archived topic
Optional Site Library
16 replies · Started by Dean on March 26, 2018
While the new Site Library feature seems like it could be quite useful, it would be nice if we also had a setting to display / hide this screen altogether. Especially when used on an existing site or Multisite which doesn't or can't make use of it.
In general, we use the approach of removing anything that could be harmful (e.g. permalinks screen), or unused features to keep the backend as simple and clean as possible to aid the end user.
It would therefore be really helpful to hide / turn off the Site Library on sites that won't or can't use it.
As a secondary suggestion it would be more helpful if there were additional settings to only display certain themes e.g. don't show Beaver Builder ones, or don't show Elementor ones etc. In our case we don't use either of those two page builders, and therefore this can lead to a lot of confusion when one of those is selected and the page builder required is not available.
Thank you.
Hi there,
I've added a new filter to GPP 1.6.1, which will be released this week.
You'll be able to do this:
add_filter( 'generate_disable_site_library', '__return_true' );
Ah that'll do nicely. Thanks again Tom!
No problem! :)
Not working in GPP 1.6.2 using Code Snippets or child theme functions.php
Depending on the order your plugins are loaded in, you may need to do this:
add_action( 'after_setup_theme', 'tu_disable_site_library' );
function tu_disable_site_library() {
add_filter( 'generate_disable_site_library', '__return_true' );
}
Hey Tom,
I too have tried that code snippet and it didn't work for me either.
WP: 4.9.5
GeneratePress: 2.1.1
Pro Add-on: 1.6.2
Cheers
Mike
Any chance you can send me temporary admin login details?: https://generatepress.com/contact/
Be sure to mention this topic.
Thanks!
Hey Tom,
Can do ... but your contact page doesn't give me an option to email you or your team.
Cheers
Mike
You can send it using the Pre-sale question contact. I think Tom has some things planned to make this easier.
Thanks David, will do.
Cheers
Mike
This was a weird one. It seems the Site Library was loading too early for apply_filters to work.
So now we're going to use a constant, which you can define in your wp-config.php file.
I've made this change to 1.6.3, but you can make the change now if you'd like.
1. Open wp-content/plugins/gp-premium/gp-premium.php and find this line:
if ( version_compare( PHP_VERSION, '5.4', '>=' ) && ! apply_filters( 'generate_disable_site_library', false ) ) {
2. Replace it with:
if ( version_compare( PHP_VERSION, '5.4', '>=' ) && ! defined( 'GENERATE_DISABLE_SITE_LIBRARY' ) ) {
3. Add this to your wp-config.php file:
define( 'GENERATE_DISABLE_SITE_LIBRARY', true );
Excellent, nice work Tom! =)
Thanks!
No problem! :)