Skip to content

Instantly share code, notes, and snippets.

@chrisjung-dev
Created July 30, 2016 14:55
Show Gist options
  • Save chrisjung-dev/c314f213fe477615fae2e8865cfd25b6 to your computer and use it in GitHub Desktop.
Save chrisjung-dev/c314f213fe477615fae2e8865cfd25b6 to your computer and use it in GitHub Desktop.
<?php
/**
* Template: element-activepage.php
*
* Available data: $element_id, $type, $id, $name, $classes, $description, $required, $answers, $response, $extra_attr, $response_year, $response_month, $response_day, $years, $months, $days
*/
?>
<div class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>">
<?php do_action( 'torro_element_start', $element_id ); ?>
<input id="<?php echo esc_attr( $id ); ?>" name="<?php echo esc_attr( $name ); ?>" type="text" value="<?php echo $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; ?>">
<?php do_action( 'torro_element_end', $element_id ); ?>
</div>
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
final class Torro_Forms_ActivePage_Element_Type_ActivePage extends Torro_Element_Type {
/**
* Initializing.
*
* @since 1.0.0
*/
protected function init() {
$this->name = 'activepage';
$this->title = __( 'ActivePage', 'torro-forms-activepage' );
$this->description = __( 'Aktive Seite', 'torro-forms-activepage' );
$this->icon_url = torro()->get_asset_url( 'icon-text', 'png' );
$this->input = true;
}
public function validate( $input, $element ) {
//$input = trim( stripslashes( $input ) );
return $input;
}
}
torro()->element_types()->register( 'Torro_Forms_ActivePage_Element_Type_ActivePage' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment