Neue “Post Functions”: jslink, fold, printfile

wp-logoEs gibt nun 3 neue Funktionen: jslink, printfile, fold.
jslink und fold benötigen jQuery

Funktion jslink

jslink ermöglicht es JavaScript Links im Text zu platzieren. Außerdem ist jslink mit Link Indication kompatibel. (Siehe dazu JavaScript Links und Link Indication).
<, >, ‘ und ” werden automatisch als HTML-Entity dargestellt.

Beispiel
[jslink:klick mich]alert(‘:)’)[/jslink]
Resultat: klick mich

Funktion fold

Mit fold können Textpassagen ausklappbar dargestellt werden.

Beispiel
[fold:ausklappen]mein Text[/fold]
Resultat: ausklappen

Funktion printfile

printfile gibt eine komplette Datei direkt im Post aus. Am besten sollte diese Funktion mit WP-CodeBox verwendet werden.

Argument displaypath
printfile akzeptiert das Argument pisplaypath. Wird dieses angegeben gibt printfile den Pfad zur Datei vor der Datei aus.

Beispiel
[printfile:index.php|displaypath=1]
Resultat (mit WP-CodeBox):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Contents of 'index.php'
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */
 
/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define('WP_USE_THEMES', true);
 
/** Loads the WordPress Environment and Template */
require('./wp-blog-header.php');
?>

Keine Kommentare

Noch keine Kommentare.

RSS Feed für Kommentare zu diesem Artikel. TrackBack URI

Hinterlasse einen Kommentar

WordPress Themes