Skip to content

Instantly share code, notes, and snippets.

@svenl77
svenl77 / BuddyForms-Form-Element-Example.php
Last active October 13, 2016 08:06
BuddyForms New Form Element Example
<?php
// We need to add a new option to the form elements select
add_filter( 'buddyforms_add_form_element_to_select', 'my_form_element_to_select', 1, 2 );
function my_form_element_to_select( $elements_select_options ) {
global $post;
if ( $post->post_type != 'buddyforms' ) {
return;
}
@svenl77
svenl77 / wp_dropdown_categories_multiple.php
Last active August 29, 2015 14:11
wp_dropdown_categories multiple example for the BuddyForms Form Builder
<?php
$taxonomies = buddyforms_taxonomies($form_slug);
$taxonomy = false;
if(isset($buddyforms_options['buddyforms'][$form_slug]['form_fields'][$field_id]['taxonomy']))
$taxonomy = $buddyforms_options['buddyforms'][$form_slug]['form_fields'][$field_id]['taxonomy'];
$form_fields['left']['taxonomy'] = new Element_Select('<b>' . __('Taxonomy', 'buddyforms') . '</b>', "buddyforms_options[buddyforms][".$form_slug."][form_fields][".$field_id."][taxonomy]", $taxonomies, array('value' => $taxonomy));
$taxonomy_order = 'false';
if(isset($buddyforms_options['buddyforms'][$form_slug]['form_fields'][$field_id]['taxonomy_order']))
@svenl77
svenl77 / cc_switch_css.php
Created December 23, 2014 01:14
cc_switch_css
<?php
function cc_switch_css(){
global $cap;
$switch_css = array(
'body_bg_color' => 'ffffff',
'container_bg_color' => 'ffffff',
'container_alt_bg_color' => 'ededed',
'details_bg_color' => 'ededed',
'details_hover_bg_color' => 'f9f9f9',
{"theme_mods":{"header_textcolor":"003044","background_color":"","background_image":"","background_repeat":"repeat","background_position_x":"left","background_attachment":"fixed","site_title_font_family":"\"Ubuntu Condensed\", \"Droid Sans\", \"Helvetica Neue\", Tahoma, Arial, sans-serif","google_fonts_note_site_title":"","site_title_position":"left","display_header_heading":"","display_header_home":true,"display_header_posts":true,"display_header_pages":true,"display_header_archive":true,"display_header_search":true,"display_header_404":true,"header_height":"auto","header_height_note":"","header_height_home":"auto","header_height_home_note":"","header_width":"fullwidth","header_width_note":"","fixed_top_nav":true,"use_dark_colors":"","dark_bottom_nav":"","add_nav_brand":"","top_nav_brand":true,"bottom_nav_brand":"","layouts_note":"","default_layout":"right","default_page_layout":"right","default_post_layout":"right","default_archive_layout":"right","title_font_family":"\"Ubuntu Condensed\", \"Droid Sans\", \
{"theme_mods":{"color_scheme":"default","header_textcolor":"728fa8","background_color":"050505","font_color":"cecece","link_color":"6e9aad","hover_color":"31526b","top_nav_hover_background_color":"d6d6d6","top_nav_active_background_color":"d6d6d6","top_nav_active_text_color":"b7b7b7","top_nav_dropdown_background_color":"d6d6d6","top_nav_dropdown_text_color":"8c8c8c","top_nav_dropdown_hover_background_color":"31526b","secondary_nav_hover_background_color":"d6d6d6","secondary_nav_active_background_color":"d6d6d6","secondary_nav_active_text_color":"b7b7b7","secondary_nav_dropdown_background_color":"d6d6d6","secondary_nav_dropdown_text_color":"8c8c8c","secondary_nav_dropdown_hover_background_color":"31526b","footer_column_border_bottom_color":"c4c4c4","tagline_text_color":"cecece","title_font_color":"015670","header_background_color":"050505","top_nav_background_color":"31526b","top_nav_text_color":"8c8c8c","top_nav_hover_text_color":"353231","secondary_nav_background_color":"31526b","secondary_nav_text_color":"8
{"theme_mods":{"color_scheme":"default","nav_menu_locations":{"top":180},"cc_slideshow_template":"tine","cc_slider_display":"home","cc2_slideshow_style":"bubble-preview","cc_slider_position":"cc_first_inside_main_content","header_textcolor":"005b04","background_color":"fff9db","font_color":"515151","link_color":"8f9e68","hover_color":"336629","top_nav_font_size":"20px","top_nav_hover_background_color":"eddeaf","top_nav_active_background_color":"f2daa4","top_nav_active_text_color":"701919","top_nav_dropdown_background_color":"f4f3dc","top_nav_dropdown_text_color":"701919","top_nav_background_color":"005b04","top_nav_text_color":"eddeaf","top_nav_hover_text_color":"701919","top_nav_font_family":"Georgia, \"Times New Roman\", Times, serif","top_nav_dropdown_hover_background_color":"005b04","top_nav_dropdown_hover_text_color":"eddeaf","secondary_nav_hover_background_color":"eddeaf","secondary_nav_active_background_color":"eddeaf","secondary_nav_active_text_color":"701919","secondary_nav_dropdown_background_color"
array (
'theme_mods' =>
array (
'color_scheme' => 'default',
'default_page_layout' => 'right',
'default_post_layout' => 'right',
'default_archive_layout' => 'right',
'default_layout' => 'right',
'header_textcolor' => '005b04',
'background_color' => 'fff9db',
array (
'theme_mods' =>
array (
'color_scheme' => 'default',
'default_page_layout' => 'right',
'default_post_layout' => 'right',
'default_archive_layout' => 'right',
'default_layout' => 'right',
'header_textcolor' => '728fa8',
'background_color' => '050505',
@svenl77
svenl77 / woosupport.php
Last active August 29, 2015 14:14
woosupport.php
<?php
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
add_action('woocommerce_before_main_content', 'cc2_theme_wrapper_start', 10);
add_action('woocommerce_after_main_content', 'cc2_theme_wrapper_end', 10);
function cc2_theme_wrapper_start() {?>
<div class="main-content">
@svenl77
svenl77 / buddyforms_custom_gallery_content_filte.php
Last active August 28, 2017 11:24
Create WordPress Gallery from BuddyForms File Form Element and add the Gallery under the Content