Skip to content

Instantly share code, notes, and snippets.

View kcrusher's full-sized avatar

Keith Crusher kcrusher

View GitHub Profile
@zackpyle
zackpyle / styles.css
Last active February 28, 2023 18:57
Starter CSS
/** TABLE OF CONTENTS
---------------------------------------------------------------------------/
1.0 - Global Styles
1.1 - General
1.2 - Selection Highlight
1.3 - Buttons
1.4 - Typography
1.5 - Custom Font Face
@gemmadlou
gemmadlou / remove-visual-composer-shortcodes.md
Last active April 20, 2024 14:56
Removing Visual Composer & Shortcodes From Wordpress Content

Adding @k1sul1's suggestion from the comments as it's more concise than what I had before:

I just wanted them all gone, so I ran this in the MySQL shell.

UPDATE wp_posts SET post_content = REGEXP_REPLACE(post_content, "\\[\/?vc(.*?)\]", "");

Note the double backslash. If you forget it, you'll replace all v's and c's with nothing, and the shortcodes will still be there. This works for other shortcode as well, just replace vc.

@magnific0
magnific0 / wp_usermeta.md
Last active June 16, 2023 05:28
Show and Edit User Meta in Wordpress

Show and Edit User Meta in Wordpress

Description

This simple procedure will allow you to:

  1. Display user meta fields under in the user list as additional columns (Users > All Users).
  2. Display these fields on user profiles.
  3. Edit these fields under user edit.

This method works completely without plugins and involves just some functions and hooks in functions.php. Plugins like "User Meta Display" achieve this to some level, but treat custom meta fields completely different from the regular fields. They are shown and edited in seperate environment and fail to show the meta data is a table list. This method integrates custom user meta along with regular user (meta).

@richardW8k
richardW8k / ListFieldMaskedInput
Created November 14, 2013 16:54
add an input mask to an input in a Gravity Forms list field column
// enable input mask for form #95 list field #3 columns 1 and 3
add_filter('gform_register_init_scripts_95', 'enable_list_input_mask');
function enable_list_input_mask($form) {
$field_id = "3"; //set field id here
$col_id = array('1','3'); //set column id here
$mask = "9999"; //define mask here, examples at http://www.gravityhelp.com/documentation/page/Input_Mask
//that's it nothing more to configure
$c_sel = array();
foreach($col_id as $c) {