Recent

Snippets class

Snippets

ATA Settings class to register the settings.

Namespace: WebberZone\Snippetz\Snippets
Since: 1.7.0
Source: includes/snippets/class-snippets.php line 25

Methods

__construct()

Constructor function.

Line: 80

public function __construct(  );

disable_block_editor()

Disable block editor for snippets post type.

Line: 112

public function disable_block_editor( $use_block_editor, $post_type ): bool;
TypeNameDescription
bool$use_block_editorWhether to use block editor.
string$post_typePost type.

Returns: bool — Whether to use block editor.

register_post_type()

Register Snippets Post Type.

Line: 124

public function register_post_type(  ): void;

Returns: void

register_taxonomy()

Register WebberZone Snippetz Snippet Category taxonomy

Line: 243

public function register_taxonomy(  ): void;

Returns: void

wp_editor_settings()

Update Editor settings for $this->post_type custom post type

Line: 303

public function wp_editor_settings( $settings, $editor_id ): array;
TypeNameDescription
array$settingsArray of editor arguments.
string$editor_idUnique editor identifier.

Returns: array — Updated settings array.

remove_wpautop()

Remove wpautop when viewing the custom post type.

Line: 324

public function remove_wpautop( $content ): string;
TypeNameDescription
string$contentPost content.

Returns: string — Updated post content.

media_buttons()

Add media buttons.

Line: 335

public function media_buttons( $post );
TypeNameDescription
\WP_Post$postPost object.

insert_snippet_button()

Add an Insert Snippet button to the Classic Editor.

Since: 2.4.0
Line: 365

public function insert_snippet_button( $editor_id );
TypeNameDescription
string$editor_idEditor identifier.

insert_snippet_modal()

Render the Insert Snippet modal and its editor integration script.

Since: 2.4.0
Line: 385

public function insert_snippet_modal(  );

media_view_strings()

Edit media strings.

Line: 451

public function media_view_strings( $strings, $post ): string[];
TypeNameDescription
string[]$stringsArray of media view strings keyed by the name they’ll be referenced by in JavaScript.
\WP_Post$postPost object.

Returns: string[] — Updated strings array.

get_snippet_type()

Get snippet type.

Line: 469

public function get_snippet_type( $snippet ): string;
TypeNameDescription
\WP_Post$snippetSnippet object.

Returns: string — Snippet type.