Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@eminozlem
eminozlem / gist:6c212bd7c95fa200fe713265c2c2f59b
Created February 1, 2023 06:21
Update Cart on Quantity Change
add_action( 'wp_head', function() {
?><style>
.woocommerce button[name="update_cart"],
.woocommerce input[name="update_cart"] {
display: none;
}</style><?php
} );
@eminozlem
eminozlem / gist:baa5b62511d0a7cd4158633e5698e17d
Created January 29, 2023 21:16
cm0102 training attributes
Fitness : Acceleration, Agility, Jumping, Pace, Stamina, Strength and Reflexes +natural fitness
Shooting : Finishing and Long Shots +penalties
Skill : Crossing, Dribbling, Heading, Passing, Set Pieces, Tackling and Technique +corners, preferred foot, free kicks -set pieces (this isnt
true, as you proved Set Pieces are included)
Tactics : Decisions, Marking, Off the Ball, Positioning and Teamwork
Goalkeeping : Handling +one on ones
Fitness : Acceleration, Agility, Jumping, Pace, Stamina, Strength and Reflexes
Shooting : Finishing and Long Shots
Skill : Crossing, Dribbling, Heading, Passing, Set Pieces, Tackling and Technique
@eminozlem
eminozlem / gist:c4df477fc10bedb8a6d86731c6f44656
Created December 16, 2022 03:38
Adding all CPTUI post types to the archives.
#https://docs.pluginize.com/article/post-types-in-category-tag-archives/
function my_cptui_add_post_types_to_archives( $query ) {
// We do not want unintended consequences.
if ( is_admin() || ! $query->is_main_query() ) {
return;
}
if ( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) {
$cptui_post_types = cptui_get_post_type_slugs();
@eminozlem
eminozlem / gist:b38796e864dbf22993e42f864d175dd9
Created September 4, 2022 16:15
Country select with nubmers only without names
<select name="countryCode" id="" class="">
<option data-countryCode="ES" value="34" selected>+34</option>
<option data-countryCode="GB" value="44">+44</option>
<option data-countryCode="US" value="1">+1</option>
<optgroup label="Other countries">
<option data-countryCode="DZ" value="213">+213</option>
<option data-countryCode="AD" value="376">+376</option>
<option data-countryCode="AO" value="244">+244</option>
<option data-countryCode="AI" value="1264">+1264</option>
<option data-countryCode="AG" value="1268">+1268</option>
@eminozlem
eminozlem / gist:869f17cb92ee9ab772fe4efe245b2af5
Created May 16, 2022 02:15
Debugging a $wpdb query insert or update
$wpdb->last_error
OR
<?php $wpdb->show_errors(); ?>
<?php $wpdb->hide_errors(); ?>
<?php $wpdb->print_error(); ?>
mysqlcheck --auto-repair -o --all-databases
<?php
namespace Elementor;
use \Elementor\Core\Schemes\Color AS Scheme_Color;
use \Elementor\Core\Schemes\Typography AS Scheme_Typography;
class Widget_Post_Type_Items extends Widget_Base {
@eminozlem
eminozlem / gist:321083a6a9b01458ce6dd5a31aa30660
Last active March 8, 2022 15:48
Country select with emoji flags
<select>
<option value="93">🇦🇫 Afghanistan </option>
<option value="358">🇦🇽 Åland Islands </option>
<option value="355">🇦🇱 Albania </option>
<option value="213">🇩🇿 Algeria </option>
<option value="1684">🇦🇸 American Samoa </option>
<option value="376">🇦🇩 Andorra </option>
<option value="244">🇦🇴 Angola </option>
<option value="1264">🇦🇮 Anguilla </option>
<option value="1268">🇦🇬 Antigua &amp; Barbuda </option>
@eminozlem
eminozlem / gist:5626c0ba9c9b245f37623cec3c7d3d7c
Created January 27, 2021 11:31
Remove Empty Array Elements and Reindex In PHP
print_r(array_values(array_filter($stack)));
@eminozlem
eminozlem / add_drop_caps.php
Created January 12, 2021 05:07 — forked from strangerstudios/add_drop_caps.php
Filter to add drop caps to first letter of blog posts in WordPress. Add to your active theme's functions.php.
/*
Drop cap first letter of each post.
*/
function add_drop_caps($content)
{
global $post;
//only posts
if(!empty($post) && $post->post_type == "post")
{