Welcome To Snipplr
Everyone's Recent Snippets Tagged c
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
PHP
Preserving Form Elements by creating hidden form elements on new page based on previous page's form submit
I made this function to render hidden form elements in a new page based on what was sent from the last form. This function can be used to preserve input from a long multiple-page form.
What does it do:
1. Go through all the submitted POST eleme...
0
2307
posted 15 years ago by chopbust
This is just a super simple setup for the new HTML5 elements. If you're not using a framework or a reset, then you can paste this into your stylesheet so the new elements will behave as expected.
2
1993
posted 15 years ago by rewdy
The code references a custom post type (mysite_listings) and adds custom columns for editing the listings in the admin. This adds custom fields onto the edit / list views.
Note: You will want to change instances of "mysite_listings" with your own...
1
2783
posted 15 years ago by crypticsoft
Example shows how to register post types for :
* Listings (defined as 'mysite_listings' with the rewrite slug 'lookup')
* Then registers the 'usa_states' taxonomy to the mysite_listings post type.
0
2443
posted 15 years ago by crypticsoft
This is especially useful to have appear in logs. While it is totally up to the JVM implementation what to return for the name, most seem to return a numeric process identifier.
0
1823
posted 15 years ago by cruelfate
With this CSS to make the page 2 main content columns:
.custom #content .sidebar {width:48%; margin-right:2%; float:left;}
1
1652
posted 15 years ago by kristarella
# function *formatArrayForDisplay*
## parameters:
* **array**
a 1- or 2-dimensional array for output
* **mode**
accepts **human** or **PHP**
* **human** displays using `<pre>` tags and print_r
* **PHP** displays PHP styl...
1
2480
posted 15 years ago by daveespionage
Ordenamento de array para exibição em colunas múltiplas, via UL float.
0
1644
posted 15 years ago by dessimoni
Here are some IDs for the default links WP 3.1 adds, found in /wp-includes/admin-bar.php:
my-account / my-account-with-avatar : the first link, to your account. Note that the ID here changes depending on if you have Avatars enabled or not.
my-blo...
0
1743
posted 15 years ago by crs
Useful for stripping out backslashes, hyphens and other punctuation
0
4878
posted 15 years ago by gromitski
Replace "-" with anything you want to. Useful for amending URLs.
0
2731
posted 15 years ago by gromitski
This function shows how you can format a double value to a string with a given precision.
0
2258
posted 15 years ago by bits