New custom theme option (text input) giving index error

Wrap the call in an isset() conditional in this line: <input id=”cpt_theme_options[cpt_sm_dribbble_handle]” class=”regular-text” type=”text” name=”cpt_theme_options[cpt_sm_dribbble_handle]” value=”<?php esc_attr_e($options[‘cpt_sm_dribbble_handle’]); ?>” /> Try something like this: $cpt_sm_dribbble_handle = ( isset( $options[‘cpt_sm_dribbble_handle’]) ? $options[‘cpt_sm_dribbble_handle’]) : ” ); <input id=”cpt_theme_options[cpt_sm_dribbble_handle]” class=”regular-text” type=”text” name=”cpt_theme_options[cpt_sm_dribbble_handle]” value=”<?php esc_attr_e($cpt_sm_dribbble_handle); ?>” /> EDIT Note: your other alternative is to set default options on init, so … Read more

Data sanitization for user registration and user login

You can check my tutorial for front-end user registration and login in WordPress: http://www.cozmoslabs.com/1012-wordpress-user-registration-template-and-custom-user-profile-fields/ As to the wp_signon, wp_insert_user, wp_create_user and wp_update_user they take care of all sanitation and validation of your content. Also you don’t need to use those filters in wp_create_user to create your users.

w3c validation problem – Twitter share button pulling content

You are sending text unencoded. urlencode that just like you do the permalink. <a class=”popup” href=”http://twitter.com/share?url=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;text=<?php echo urlencode(the_content_limit(100, “”));?>”><img src=”http://zitatezumnachdenken.com/wp-content/uploads/2013/04/twittersmall.png” alt=”twitter”></a> Although, the_content_limit looks like it probably echos (based on your usage) instead of returning a string, which you will need. So I expect you will have to find that function and … Read more

wooCommerce checkout page State / County (optional) validate not working

Code goes in function.php file of your active child theme (or active theme). It could works. add_filter( ‘woocommerce_billing_fields’, ‘woo_filter_state_billing’, 10, 1 ); function woo_filter_state_billing( $address_fields ) { $address_fields[‘billing_state’][‘required’] = true; return $address_fields; } add_filter( ‘woocommerce_shipping_fields’, ‘woo_filter_state_shipping’, 10, 1 ); function woo_filter_state_shipping( $address_fields ) { $address_fields[‘shipping_state’][‘required’] = true; return $address_fields; }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)