Skip to content

Instantly share code, notes, and snippets.

View mahype's full-sized avatar

Sven Wagener mahype

  • Awesome UG
  • Hilden
View GitHub Profile
@mahype
mahype / filtering-export-value.php
Last active January 30, 2019 11:27
Torro forms example filtering of an export value
<?php
/**
* Filtering a specific element by setting.
*
* @param string $value Value to filter.
* @param \awsmug\Torro_Forms\DB_Objects\Elements\Element $element Current element object.
*
* @return string $value Filtered value.
*/
function filter_my_value( $value, $element ){
@mahype
mahype / torro-forms-example-action.php
Last active February 13, 2019 15:11
Torro Forms example Action (without options in backend)
<?php
/**
* This class shows how to create an action which is processed directly after sending a form.
**/
class Send_To_API extends awsmug\Torro_Forms\Modules\Actions\Action {
protected function bootstrap() {
$this->slug = 'send-to-api';
$this->title = 'Send to API';
}
<?php
$config = array(
'transporter' => 'curl',
'config_updater' => true,
'config_updater_storage' => 'cookie',
'twitter' => array(
'mode' => '',
'authenticator' => 'twitter-oauth1',
'authentication_data' => array(
@mahype
mahype / extend-woo-shipment-classes.php
Last active December 14, 2016 13:47
How to add shipment classes fields to WooCommerce
<?php
/**
* Extend WooCommerce Shipping Classes
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class WC_Extend_Shippig_Classes {