Exemplo n.º 1
0
 public static function init_builder()
 {
     self::$TTL = new TT_LOAD();
     self::$args['form_elements'] = file_exists(TT_STYLE_DIR . '/theme_config/contact-form-config.php') ? include TT_STYLE_DIR . '/theme_config/contact-form-config.php' : (include TT_THEME_DIR . '/theme_config/contact-form-config.php');
     add_action("admin_menu", array('TT_Contact_Form_Builder', "setup_contact_admin_submenu"), 11);
     add_action('admin_init', array('TT_Contact_Form_Builder', 'register_settings'));
     add_action('wp_ajax_contact_builder_save_forms', array('TT_Contact_Form_Builder', 'save_forms_ajax'));
     add_action('wp_ajax_contact_form_send_message', array('TT_Contact_Form_Builder', 'send_message_ajax'));
     add_action('wp_ajax_nopriv_contact_form_send_message', array('TT_Contact_Form_Builder', 'send_message_ajax'));
     add_shortcode('tesla_form', array('TT_Contact_Form_Builder', 'form_shortcode'));
 }
Exemplo n.º 2
0
define('THEME_OPTIONS', THEME_NAME . '_options');
//Load main framework classes
require_once TTF . '/extensions/twitteroauth/twitteroauth.php';
require_once TTF . '/core/teslaframework.php';
require_once TTF . '/core/tesla_admin.php';
require_once TTF . '/core/tt_load.php';
if (file_exists(TTF . '/core/tt_security.php')) {
    require_once TTF . '/core/tt_security.php';
} else {
    exit;
}
//TT ENQUEUE
require_once TTF . '/core/tt_enqueue.php';
TT_ENQUEUE::init_enqueue();
//Contact Form Builder
if (file_exists(TT_THEME_DIR . '/theme_config/contact-form-config.php')) {
    require_once TTF . '/core/tt_contact_form.php';
    TT_Contact_Form_Builder::init_builder();
}
//Admin load
$TTA = new Tesla_admin();
//Slider - do not load if plugin TFW detected
if ((!defined('TT_USES_PLUGIN') || defined('TT_USES_PLUGIN') && !TT_USES_PLUGIN) && !class_exists('Tesla_slider')) {
    require_once TTF . '/core/tesla_slider.php';
    Tesla_slider::init();
}
//Subscription
if (file_exists(TT_THEME_DIR . '/theme_config/subscription.php')) {
    require_once TTF . '/core/tt_subscription.php';
    TT_Subscription::subscription_init();
}
/* Custom JS */
/***********************************************************************************************/
add_action('wp_footer', 'tesla_custom_js', 99);
function tesla_custom_js()
{
    ?>
    <script type="text/javascript"><?php 
    _eo('custom_js');
    ?>
</script>
    <?php 
}
/***********************************************************************************************/
/* Register Contact Form Locations */
/***********************************************************************************************/
TT_Contact_Form_Builder::add_form_locations(array('contact_page' => 'Contact Page', 'footer' => 'Foooter'));
/***********************************************************************************************/
/* Add Menus */
/***********************************************************************************************/
function tt_register_menus()
{
    register_nav_menus(array('main_menu' => _x('Main menu', 'dashboard', 'sevenfold')));
}
add_action('init', 'tt_register_menus');
/***********************************************************************************************/
/* Add Shortcodes */
/***********************************************************************************************/
get_template_part('shortcodes');
/***********************************************************************************************/
/* Add Widgets */
/***********************************************************************************************/
Exemplo n.º 4
0
function tt_form($id)
{
    $the_form = tt_get_form($id);
    if ($the_form) {
        TT_Contact_Form_Builder::render_form($id, $the_form);
    } else {
        return NULL;
    }
}