__( 'AT Services', 'aakanksha'), 'size' => 'span12', ); //create the widget parent::__construct('as_Service_Block', $block_options); //add ajax functions add_action('wp_ajax_as_block_service_add_new', array($this, 'add_service')); } function form($instance) { $defaults = array( 'services' => array( 1 => array( 'title' => __('Add New Service', 'aakanksha'), 'icon_font' => '', 'content' => '', 'duration' => '900', 'delay' => '0', 'animation' => 'None', ) ), 'column' => 'three', 'margin_top' => 10, 'margin_bottom' => 10, ); $instance = wp_parse_args($instance, $defaults); extract($instance); $service_columns = array( 'one' => 'One Columns', 'two' => 'Two Columns', 'three' => 'Three Columns', 'four' => 'Four Columns', ); ?>

 - 

Add New

  • ms(Millisecond) -  ms(Millisecond)

  • '.$service['title'].'

    '.$service['content'].'

    '; if($i%2 == 0 && $i != sizeof($services) && $span == 'col-md-6') $output .= '
    '; if($i%3 == 0 && $i != sizeof($services) && $span == 'col-md-4') $output .= '
    '; if($i%4 == 0 && $i != sizeof($services) && $span == 'col-md-3') $output .= '
    '; $i++; } echo $output; } /* AJAX add service */ function add_service() { $nonce = $_POST['security']; if (! wp_verify_nonce($nonce, 'aspb-settings-page-nonce') ) die('-1'); $count = isset($_POST['count']) ? absint($_POST['count']) : false; $this->block_id = isset($_POST['block_id']) ? $_POST['block_id'] : 'as-block-9999'; //default key/value for the service $service = array( 'title' => __('Add New Service','aakanksha'), 'icon_font' => '', 'content' => '', 'duration' => '900', 'delay' => '0', 'animation' => 'None', ); if($count) { $this->service($service, $count); } else { die(-1); } die(); } function update($new_instance, $old_instance) { $new_instance = as_recursive_sanitize($new_instance); return $new_instance; } function before_block($instance) { extract($instance); echo '
    '; } function after_block($instance) { extract($instance); echo '
    '; } } as_register_block( 'as_Service_Block' ); endif;