How to force converting worktree files after changing core.autocrlf?
git add --renormalize .
global $wpdb; | |
// your table (with a UNIQUE or PRIMARY KEY on the upsert column(s)) | |
$table = $wpdb->prefix . 'my_table'; | |
// prepare your data as an array of rows | |
$data = [ | |
[ 'id' => 1, 'col_a' => 'foo', 'col_b' => 'bar' ], | |
[ 'id' => 2, 'col_a' => 'baz', 'col_b' => 'qux' ], | |
[ 'id' => 3, 'col_a' => 'lorem','col_b' => 'ipsum' ], |
add_filter('woocommerce_cookie_expiration', 'extend_woocommerce_cart_cookie_expiration'); | |
function extend_woocommerce_cart_cookie_expiration($expiration) { | |
return 60 * 60 * 24 * 14; // 14 days in seconds | |
} | |
add_filter('auth_cookie_expiration', function($expire, $user_id, $remember) { | |
return 60 * 60 * 24 * 14; // 14 days | |
}, 10, 3); |
How to force converting worktree files after changing core.autocrlf?
git add --renormalize .
# .git/config - local repo config | |
# limit to only files you want to see. your branches begin with your git username by convention | |
[remote "origin"] | |
fetch = +refs/heads/main:refs/remotes/origin/main | |
fetch = +refs/heads/jeremysimmons/*:refs/remotes/origin/jeremysimmons/* |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
namespace TestApp | |
{ | |
internal class Program | |
{ |
@echo off | |
:: https://stackoverflow.com/a/52688643/26877 | |
set dirname="" | |
set dirname=%* | |
set orig_dirname=%* | |
:: remove quotes - will re-attach later. | |
set dirname=%dirname:\"=% | |
set dirname=%dirname:/"=% |
<?php | |
// https://stackoverflow.com/a/22818089/26877 | |
// wp-content/mu-plugins/buffer.php | |
/** | |
* Output Buffering | |
* | |
* Buffers the entire WP process, capturing the final output for manipulation. | |
*/ | |
ob_start(); |
;with product_types (object_id, product_type) as ( | |
select tr.object_id, t.name | |
from wp_term_relationships tr | |
join wp_term_taxonomy tax on tr.term_taxonomy_id = tax.term_taxonomy_id and tax.taxonomy = 'product_type' | |
join wp_terms t on t.term_id = tax.term_id | |
) | |
select | |
p.ID | |
,p.post_parent | |
,p.post_status |
function my_plugins_update_completed( $upgrader_object, $options ) { | |
// If an update has taken place and the updated type is plugins and the plugins element exists | |
if ( $options['action'] == 'update' && $options['type'] == 'plugin' && isset( $options['plugins'] ) ) { | |
foreach( $options['plugins'] as $plugin ) { | |
// Check to ensure it's my plugin | |
if( $plugin == plugin_basename( __FILE__ ) ) { | |
// do stuff here | |
} | |
} |
/* actions fired when listing/adding/editing posts or pages */ | |
/* admin_head-(hookname) */ | |
add_action( 'admin_head-post.php', 'admin_head_post_editing' ); | |
add_action( 'admin_head-post-new.php', 'admin_head_post_new' ); | |
add_action( 'admin_head-edit.php', 'admin_head_post_listing' ); | |
function admin_head_post_editing() { | |
echo 'you are editing a post'; | |
} |