question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow completely disabling/hiding default templates

See original GitHub issue

Feature Description

A user has requested a way to customize the default view for the Templates dashboard. Currently, the Templates dashboard loads all templates, but this feature request would allow a customized / filtered view of the templates on load.

Alternatives Considered

Additional Context

related support topic: https://wordpress.org/support/topic/remove-default-story-and-page-templates/


Acceptance Criteria

  • Pass'canViewDefaultTemplates' => true to app in \Google\Web_Stories\Admin\Editor::get_editor_settings() and \Google\Web_Stories\Admin\Dashboard::get_dashboard_settings()
  • In dashboard, hide “Explore Templates” from menu if user does not have capability
  • In dashboard, prevent direct access to templates if user does not have capability (feasible?)
  • In editor, hide “Default Templates” from the page templates tab, hide the selection dropdown, and always show the custom templates.

This will allow devs to disable access to default templates via the web_stories_editor_settings and web_stories_dashboard_settings filters.

Alternative:

Use something like current_user_can( 'web_stories_view_default_templates' ) instead, which allows devs to filter this via map_meta_cap.

It’s a bit more verbose which helps a lot with comprehension.

We could even do the same for the showMedia3p config.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
lucymtccommented, Jan 7, 2022

@swissspidy Yes, that sounds good. Thanks!

0reactions
swissspidycommented, Feb 2, 2022

@lucymtc ICYMI, this is how the default templates can now be disabled on the dashboard and in the editor:

function gh_10124_change_get_settings( array $settings ): array {
	$settings['canViewDefaultTemplates'] = false;

	return $settings;
}
add_filter( 'web_stories_editor_settings', 'gh_10124_change_get_settings' );
add_filter( 'web_stories_dashboard_settings', 'gh_10124_change_get_settings' );

Available since 1.17.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

SOLIDWORKS Default Templates Error - GoEngineer
Defining the Default Templates · Navigate to Options · Under System Options, select Default Templates · Browse to the specific template you want...
Read more >
Disabling/Hiding functions in a template based on compile ...
Is it possible to conditionally hide or disable functions in a template class using compile time constants? Imagine the following ...
Read more >
Tech Tip - Fix Default Template Issues - YouTube
Content / Presentation: Ruta Deshmukh"An error was encountered while trying to open your file." The horror! Nobody likes unexpected errors ...
Read more >
Enable or disable templates - Google Workspace Admin Help
Click Templates - classic Sites. Turn off Enable custom templates and click Save.
Read more >
Default Templates Options - 2020 - SolidWorks Web Help
Default Templates Options · Click Options or Tools > Options. · Select Default Templates. · Click the appropriate browse button (Parts, Assemblies, or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found