This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE `wp_postmeta` SET `meta_key` = 'NEW NAME' WHERE `meta_key` = 'OLD NAME' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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'); | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('acf/load_field/name=field_name', 'acf_readonly' ); | |
function acf_readonly( $field ) { | |
$field['readonly'] = 1; | |
return $field; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
*/ | |
OlderNewer