Skip to content

Instantly share code, notes, and snippets.

Pablo dos Santos Gonçalves Pacheco pablo-sg-pacheco

Block or report user

Report or block pablo-sg-pacheco

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kevinwhoffman
kevinwhoffman / resources-web-developers-designers.md
Last active Nov 13, 2018
Resources for Web Developers and Designers
View resources-web-developers-designers.md

Resources for Web Developers and Designers

This is an incomplete list of resources including courses and individuals who publish content that has helped me grow as a web developer and designer. Many of these resources are WordPress-specific as that is my current area of specialization. This list will grow over time. If you've got something to add, send me a link @kevinwhoffman and I'll check it out!

Course Providers

@rilwis
rilwis / admin-menu.php
Last active Oct 18, 2019
Move the admin menu for custom taxonomy in WordPress
View admin-menu.php
<?php
add_action( 'admin_menu', 'prefix_move_taxonomy_menu' );
function prefix_move_taxonomy_menu() {
add_submenu_page( 'edit.php?post_type=quiz', esc_html__( 'Sections', 'mb-quiz' ), esc_html__( 'Sections', 'mb-quiz' ), 'manage_categories', 'edit-tags.php?taxonomy=question_section' );
}
@tripflex
tripflex / functions.php
Last active Oct 10, 2019
WordPress Remove Filter (remove_filter converted to remove_class_filter) to remove Filter/Action without Class Object access. Works with WordPress 1.2+ (4.7+ support added 9-19-2016)
View functions.php
<?php
/**
* Make sure the function does not exist before defining it
*/
if( ! function_exists( 'remove_class_filter' ) ){
/**
* Remove Class Filter Without Access to Class Object
*
* In order to use the core WordPress remove_filter() on a filter added with the callback
@slushman
slushman / customizer-links.php
Last active Oct 22, 2019
How to link into the WordPress Customizer
View customizer-links.php
@neilgee
neilgee / woo-endpoint-custom.php
Last active Jul 1, 2019
WooCommerce Endpoint Order and Rename - My Account Page v2.6+
View woo-endpoint-custom.php
<?php
/*
Plugin Name: WooCustom My Account
Plugin URI: http://wpbeaches.com/
Description: WooCustom - add a custom area in my-account
Author: Neil Gee
Version: 1.0.0
Author URI: http://wpbeaches.com
License: GPL-2.0+
@TimBHowe
TimBHowe / functions.php
Created Mar 8, 2016
Forcibly remove the tax line item and calculation from the cart. (suggest just using the GEO setting in WooCommerce)
View functions.php
<?php
// Remove the Tax Line item from the cart.
function wc_remove_cart_tax_totals( $tax_totals, $instance ) {
if( is_cart() ) {
$tax_totals = array();
}
return $tax_totals;
}
@jayarnielsen
jayarnielsen / functions.php
Last active Oct 17, 2019
WP Query Orderby Taxonomy Term Name
View functions.php
add_filter('posts_clauses', 'posts_clauses_with_tax', 10, 2);
function posts_clauses_with_tax( $clauses, $wp_query ) {
global $wpdb;
//array of sortable taxonomies
$taxonomies = array('example-taxonomy', 'other-taxonomy');
if (isset($wp_query-&gt;query['orderby']) &amp;&amp; in_array($wp_query-&gt;query['orderby'], $taxonomies)) {
$clauses['join'] .= "
LEFT OUTER JOIN {$wpdb-&gt;term_relationships} AS rel2 ON {$wpdb-&gt;posts}.ID = rel2.object_id
LEFT OUTER JOIN {$wpdb-&gt;term_taxonomy} AS tax2 ON rel2.term_taxonomy_id = tax2.term_taxonomy_id
LEFT OUTER JOIN {$wpdb-&gt;terms} USING (term_id)
@leereamsnyder
leereamsnyder / wp_get_current_page_url.php
Last active Oct 11, 2019
In WordPress, get current URL including query string
View wp_get_current_page_url.php
<?php
/**
Re-use some existing WordPress functions so you don't have to write a bunch of raw PHP to check for SSL, port numbers, etc
Place in your functions.php (or re-use in a plugin)
If you absolutely don't need or want any query string, use home_url(add_query_arg(array(),$wp->request));
Hat tip to:
+ http://kovshenin.com/2012/current-url-in-wordpress/
@BFTrick
BFTrick / woocommerce-settings-tab-demo.php
Last active Jun 19, 2019
A plugin demonstrating how to add a WooCommerce settings tab.
View woocommerce-settings-tab-demo.php
<?php
/**
* Plugin Name: WooCommerce Settings Tab Demo
* Plugin URI: https://gist.github.com/BFTrick/b5e3afa6f4f83ba2e54a
* Description: A plugin demonstrating how to add a WooCommerce settings tab.
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
@omurphy27
omurphy27 / PHP Wordpress Removing Contact Form 7 Br tags when adding to template.html
Created Mar 15, 2013
PHP Wordpress Removing Contact Form 7 Br tags when adding to template
View PHP Wordpress Removing Contact Form 7 Br tags when adding to template.html
<!-- adding Contact Form 7 into Wordpress Template and removing <br> tags
add the following to the wordpress template -->
<?php echo do_shortcode('[contact-form-7 id="211" title="Spanish Contact Form"]') ; ?>
<!-- add the following into the wp-config.php -->
define ('WPCF7_AUTOP', false );
<!-- This will remove the <br> tags that get added automatically when you call Contact Form 7 from the template via shortcode-->
You can’t perform that action at this time.