WPCF7_Pipe{}CF7 1.0

Class representing a pair of pipe.

Хуков нет.

Использование

$WPCF7_Pipe = new WPCF7_Pipe();
// use class methods

Методы

  1. public __construct( $text )

Код WPCF7_Pipe{} CF7 5.9.3

class WPCF7_Pipe {

	public $before = '';
	public $after = '';

	public function __construct( $text ) {
		$text = (string) $text;

		$pipe_pos = strpos( $text, '|' );

		if ( false === $pipe_pos ) {
			$this->before = $this->after = trim( $text );
		} else {
			$this->before = trim( substr( $text, 0, $pipe_pos ) );
			$this->after = trim( substr( $text, $pipe_pos + 1 ) );
		}
	}
}