PHP Class WPKB\CodeHighlighting

ファイルを表示 Open project: ibericode/wp-knowledge-base

Protected Properties

Property Type Description
$plugin Plugin

Public Methods

Method Description
__construct ( Plugin $plugin )
add_hooks ( ) Add necessary hooks
add_quicktags ( ) : boolean
encode_php_tags ( $content ) : mixed
lazy_add ( ) : boolean Performs a set of action, but only for wpkb-article posts.
load_assets ( ) Load script & styles required for WP Docs search
print_inline_js ( ) Print inline JS to initialize Highlight.js
shortcode ( $args, string $content = '' ) : string

Method Details

__construct() public method

public __construct ( Plugin $plugin )
$plugin Plugin

add_hooks() public method

Add necessary hooks
public add_hooks ( )

add_quicktags() public method

public add_quicktags ( ) : boolean
return boolean

encode_php_tags() public method

public encode_php_tags ( $content ) : mixed
$content
return mixed

lazy_add() public method

- Registers scripts and styles - Registers filters and action hooks to properly format code snippets - Prints inline JS in footer to initialize the Highlighter
public lazy_add ( ) : boolean
return boolean

load_assets() public method

Load script & styles required for WP Docs search
public load_assets ( )

print_inline_js() public method

Print inline JS to initialize Highlight.js
public print_inline_js ( )

shortcode() public method

public shortcode ( $args, string $content = '' ) : string
$args
$content string
return string

Property Details

$plugin protected_oe property

protected Plugin,WPKB $plugin
return Plugin