Skip to content

Instantly share code, notes, and snippets.

View dgoze's full-sized avatar
💭
I may be slow to respond.

Daniel dgoze

💭
I may be slow to respond.
View GitHub Profile
@dgoze
dgoze / file.php
Last active September 12, 2019 23:14 — forked from Bradley-D/WooCommerce: How To Get WooCommerce Page IDs
[ WooCommerce: How To Get WooCommerce Page IDs ] #woo
// Get The Page ID You Need
get_option( 'woocommerce_shop_page_id' );
get_option( 'woocommerce_cart_page_id' );
get_option( 'woocommerce_checkout_page_id' );
get_option( 'woocommerce_pay_page_id' );
get_option( 'woocommerce_thanks_page_id' );
get_option( 'woocommerce_myaccount_page_id' );
get_option( 'woocommerce_edit_address_page_id' );
get_option( 'woocommerce_view_order_page_id' );
get_option( 'woocommerce_terms_page_id' );
@dgoze
dgoze / custom-search-acf-wordpress.php
Last active September 12, 2019 23:09 — forked from jserrao/custom-search-acf-wordpress.php
Custom Search #acf #search
/* PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request. I updated this original script with better documentation and XSS / SQL injection support.
##############################
########### Search ###########
##############################
*/
/**
*
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
@dgoze
dgoze / .gitignore
Created April 21, 2016 23:15 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@dgoze
dgoze / functions.php
Created April 29, 2016 22:22 — forked from andrewlaskey/functions.php
Adding ACF to columns in Wordpress
// ADD NEW COLUMNS
function custom_columns_head($columns) {
$columns = array(
'cb' => '<input type="checkbox" />',
'title' => 'Title',
'custom_field_1' => 'Column Name',
'custom_field_2' => 'Column Name',
'date' => 'Date'
);
return $columns;
@dgoze
dgoze / gist:10fbefa6707fb979a97b7089cb16b40b
Created April 29, 2016 22:23 — forked from kylelarkin/gist:88175fcd92e32e8209f6
Update ACF Field Name in Database
UPDATE `wp_postmeta` SET `meta_key` = 'NEW NAME' WHERE `meta_key` = 'OLD NAME'
@dgoze
dgoze / gist:95310ee1449b4632ca13cb6c1cce5c78
Created April 29, 2016 22:24 — forked from martinsanne/gist:72f48bad22d99032ba0e
WordPress ACF Multisite location rule
<?php
/**
*
* Adds location rule to target specific sites in a WordPress Multisite environment
* http://www.advancedcustomfields.com/resources/custom-location-rules/
*
*/
function acf_location_rule_type_blog( $choices ) {
@dgoze
dgoze / gist:e544a9125ccc572de50825ab1aab4ff7
Created April 29, 2016 22:25 — forked from remscli/gist:94e3e40512c3125861bc
Add an ACF value to a CPT list column
/**
* Add a "Author" column to theses CPT
*/
function add_theseauthor_columns($columns) {
$columns['theseAuthor'] = 'Author';
return $columns;
}
add_filter('manage_theses_posts_columns' , 'add_theseauthor_columns');
/**
// create marker
var templateDir = "<?php bloginfo('stylesheet_directory') ?>";
var iconBase = templateDir + '/images/map_icon.svg';
var marker = new google.maps.Marker({
position : latlng,
map : map,
icon: iconBase
});
@dgoze
dgoze / acf_readonly
Created April 29, 2016 22:30 — forked from haleeben/acf_readonly
Change a ACF field to readonly
add_filter('acf/load_field/name=field_name', 'acf_readonly' );
function acf_readonly( $field ) {
$field['readonly'] = 1;
return $field;
}
@dgoze
dgoze / acf-wysiwyg-style-select.php
Last active September 12, 2019 23:11 — forked from brombal/acf-wysiwyg-style-select.php
Custom Styles Dropdown for ACF Wysiwyg Editors (WP Plugin) #acf
<?php
/**
* Plugin Name: ACF Wysiwyg Style Select
* Description: Custom style select boxes for ACF Wysiwyg editors.
* Author: Alex Brombal
* Author URI: http://www.brombal.com
* Version: 1.1
* License: MIT
*/