You are here:
< Back


This new filter gives developers a chance to show or hide the “Add inline SVG” button programmatically, based upon their own logic.


(bool) Whether the block is being shown or not.


(bool) Whether to show the button or not


You may use the filter in any way you like. The example below shows how to restrict adding inline SVGs via the button to admin users.

add_filter( 'wpsvg_show_inline_editor_button', function () {

	// If the user is logged in and has the manage_options capability
	// allow them to see the inline SVG button.
	if ( is_user_logged_in() && user_can( get_current_user_id(), 'manage_options' ) ) {
		return true;

	// By default, hide the button.
	return false;
} );