By: Jonas Nordström, @windyjonas
Date: 2013-04-16
esc_attr( $text );
Encodes the <, >, &, " and ' (less than, greater than, ampersand, double quote and single quote) characters. Will never double encode entities.
Example:
| #... | |
| function gitzip() { | |
| git archive -o [email protected] HEAD | |
| } | |
| #... gitzip ZIPPED_FILE_NAME |
| <?php | |
| /** | |
| * Case-insensitive in_array() wrapper. | |
| * | |
| * @param mixed $needle Value to seek. | |
| * @param array $haystack Array to seek in. | |
| * @param bool $strict If the third parameter strict is set to TRUE then the in_array() function will also check the types of the needle in the haystack. | |
| * | |
| * @return bool |
| # ----------------------------------------------------------------- | |
| # .gitignore for WordPress @salcode | |
| # ver 20180808 | |
| # | |
| # From the root of your project run | |
| # curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore | |
| # to download this file | |
| # | |
| # By default all files are ignored. You'll need to whitelist | |
| # any mu-plugins, plugins, or themes you want to include in the repo. |
| $ wp post list --format=ids | xargs wp post update --comment_status=closed | |
| # Output: | |
| # Success: Updated post 2514. | |
| # Success: Updated post 2511. | |
| # Success: Updated post 2504. | |
| # Success: Updated post 2499. | |
| # Success: Updated post 2441. | |
| # etc... |
| <?php | |
| $order = new WC_Order( $order_id ); | |
| foreach ( $order->get_items() as $item_key => $item ) { | |
| $product = $order->get_product_from_item( $item ); | |
| $sku = $product->get_sku(); | |
| <?php | |
| /** | |
| * Case-insensitive in_array() wrapper. | |
| * | |
| * @param mixed $needle Value to seek. | |
| * @param array $haystack Array to seek in. | |
| * | |
| * @return bool | |
| */ |
| %Y_%m_%d___DB__ |