Skip to content

Instantly share code, notes, and snippets.

View eduard-ungureanu's full-sized avatar
🎯
Focusing

Eduard Ungureanu eduard-ungureanu

🎯
Focusing
View GitHub Profile
/* =BEGIN: Only include Contact Form 7 javascript and CSS when needed
Source: http://fredrikmalmgren.com/only-include-contact-form-7-javascript-and-css-when-needed/
---------------------------------------------------------------------------------------------------- */
add_action( 'wp_print_scripts', 'deregister_cf7_javascript', 100 );
function deregister_cf7_javascript() {
if ( !is_page('contact') ) {
wp_deregister_script( 'contact-form-7' );
}
}
@echo off
SET st2Path=C:\Program Files\Sublime Text 2\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f
@eduard-ungureanu
eduard-ungureanu / ccfm.php
Last active November 10, 2023 14:35
Custom Contact Form Module
<?php
/*Change the thank you message */
class WPC_ET_Builder_Module_Contact_Form extends ET_Builder_Module {
function init() {
$this->name = __( 'Contact Form', 'et_builder' );
$this->slug = 'et_pb_contact_form';
$this->whitelisted_fields = array(
'captcha',
'email',
@eduard-ungureanu
eduard-ungureanu / ccfm_functions.php
Created November 18, 2015 17:34
Load the Custom Contact Form Module in Divi 2.5.6
<?php
/*
=== Use the custom module ===
*/
function divi_child_theme_setup() {
if ( class_exists('ET_Builder_Module')) {
get_template_part( 'custom-modules/ccfm' );
$ccfm = new WPC_ET_Builder_Module_Contact_Form ();
remove_shortcode( 'et_pb_contact_form' );
add_shortcode( 'et_pb_contact_form', array($ccfm, '_shortcode_callback') );
@eduard-ungureanu
eduard-ungureanu / ccfm_edit1.php
Last active November 18, 2015 17:44
ccfm edit 1
$et_error_message = sprintf( '<p>%1$s</p>', esc_html__( 'Thanks for contacting us', 'et_builder' ) );
<?php
$args = array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
'widgets'
);
add_theme_support( 'html5', $args );
<figure>
<img src="img src" alt="alt attribute">
<figcaption>image caption</figcaption>
</figure>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
RewriteRule ^login$ wp-login.php