Skip to content

Instantly share code, notes, and snippets.

View bappi-d-great's full-sized avatar

Bappi D great bappi-d-great

View GitHub Profile
@bappi-d-great
bappi-d-great / code.php
Created August 1, 2018 07:58
Reorder gateway list on the checkout page in marketpress
<?php
add_filter( 'mp_payment_options_array', function( $options ) {
$temp = array();
$temp['paypal_express'] = $options['paypal_express'];
$temp['stripe'] = $options['stripe'];
$temp['manual_payments'] = $options['manual_payments'];
return $temp;
}, 10 );
@bappi-d-great
bappi-d-great / code.php
Created August 1, 2018 07:31
Add to BP activity stream when imported using autoblog
<?php
add_action( 'autoblog_post_post_insert', function( $post_id, $details, $item ) {
if( function_exists( 'bp_activity_add' ) )
{
bp_activity_add( array(
'action' => '<a href="' . get_author_posts_url( get_the_author_meta( '$post_id' ) ) . '">tota</a> wrote a new <a href="' .get_permalink( $post_id ) . '">post</a>',
'component' => 'post',
'type' => 'new_blog_post',
@bappi-d-great
bappi-d-great / code.php
Created July 30, 2018 21:44
Method: delete_form_fields()
<?php
$form_id = 7;
$ids = array();
$fields = Forminator_API::delete_form_fields( $form_id, $ids );
@bappi-d-great
bappi-d-great / code.php
Created July 30, 2018 21:33
Method: delete_form_field()
<?php
$form_id = 7;
$id = '';
Forminator_API::delete_form_field( $form_id, $id );
@bappi-d-great
bappi-d-great / code.php
Created July 30, 2018 21:10
Method: update_form_settings()
<?php
$form_id = 7;
$settings = array(
'form-padding-top' => '30px',
'cform-label-font-size' => '20'
);
$fields = Forminator_API::update_form_setting( $form_id, $settings );
@bappi-d-great
bappi-d-great / code.php
Created July 30, 2018 21:03
Method: update_setting_element()
<?php
$form_id = 7;
$setting = 'form-padding-top';
$value = '30px';
$fields = Forminator_API::update_form_setting( $form_id, $setting, $value );
@bappi-d-great
bappi-d-great / code.php
Created July 30, 2018 20:31
Method: add_form_field
<?php
$data = array(
'condition_action' => 'show',
'condition_rule' => 'any',
'conditions' => Array
(
),
'type' => 'email',
@bappi-d-great
bappi-d-great / code.php
Created July 30, 2018 18:25
Method: update_form_field()
<?php
$form_id = 7;
$field_id = 'email-2';
$data = array(
'id' => 'email-2',
'element_id' => 'email-2',
'form_id' => 'wrapper-1311247712118-1194',
'condition_action' => 'show',
@bappi-d-great
bappi-d-great / code.php
Created July 30, 2018 17:54
Method: get_form_field
<?php
$form_id = 7;
$elem_id = 'email-2';
$to_array = false;
$fields = Forminator_API::get_form_field( $form_id, $elem_id, $to_array );
@bappi-d-great
bappi-d-great / code.php
Created July 25, 2018 21:45
Method: get_form_fields_by_type()
<?php
$form_id = 7;
$type = 'email';
$fields = Forminator_API::get_form_fields_by_type( $form_id, $type );