This file contains hidden or 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 | |
/*** | |
SETUP | |
custom fields | |
@hook woocommerce_register_form_start | |
@hook woocommerce_edit_account_form | |
@hook woocommerce_save_account_detail | |
@altUse woocommerce_after_order_notes to add to checkout | |
****/ |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"><style type="text/css"> | |
table tr td{border-bottom: 1px solid #ccc; }</style> | |
</head> | |
<body> | |
<div class="post-entry entry-content"> | |
<h2>Template Hooks</h2> | |
<h4>Actions</h4> |
This file contains hidden or 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 | |
// d.) settings | |
add_settings_field( | |
'woonumday_wndtaxbase_field', | |
esc_attr__('Tax Options', 'woonumday'), | |
'woonumday_wndtaxbase_field_cb', | |
'woonumday_options', | |
'woonumday_options_section', | |
array( | |
'type' => 'select', |
This file contains hidden or 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 | |
foreach ( $form_data['products'] as $id => $prod ): | |
if ( strpos( $fields[ $id ]['cssClass'], 'exclude' ) & $year !== false ) { | |
continue; | |
} | |
?> | |
//I need to be able to write it with and & condition something like this... | |
<?php foreach ( $form_data['products'] as $id => $prod ): |
This file contains hidden or 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
/** | |
* print custom post type category list | |
* @cpt name= hordes | |
* @taxonomy name= hordes-category | |
*/ | |
if ( ! function_exists( 'theme_entry_footer_cat_list' ) ) : | |
function theme_entry_footer_cat_list() { | |
// Get custom taxonomy project_category for each specific CPT | |
if ( 'hordes' === get_post_type() ) { |
This file contains hidden or 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 | |
/** | |
* Get all blog ids of blogs in the current network that are: | |
* - not archived | |
* - not spam | |
* - not deleted | |
* | |
* | |
* @return array|false The blog ids, false if no matches. | |
*/ |
This file contains hidden or 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( 'gettext', 'misha_change_text_with_gettext', 20, 3 ); | |
function misha_change_text_with_gettext( $translated_text, $text, $domain ) { | |
if ( is_admin() | |
&& isset($_GET['post']) | |
&& get_post_type( $_GET['post'] ) == 'shop_order' | |
&& $domain == 'woocommerce' ) { | |
if( $translated_text == 'Shipping' ) { |
This file contains hidden or 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 | |
//From: https://github.com/oyina/Note-Taker/blob/master/note.php | |
//Retreives Post Id from Meta Key | |
function get_post_id_by_meta_key_and_value($key, $value) { | |
global $wpdb; | |
$meta = $wpdb->get_results("SELECT * FROM `".$wpdb->postmeta."` WHERE meta_key='".$wpdb->escape($key)."' | |
AND meta_value='".$wpdb->escape($value)."'"); | |
if (is_array($meta) && !empty($meta) && isset($meta[0])) { | |
$meta = $meta[0]; | |
} |
This file contains hidden or 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 | |
/** | |
* LearnDash filter to prevent converting answer values to lowercase | |
* | |
* @possibly use ld_adv_quiz_pro_ajax() | |
* @uses stripslashes( strtolower( trim( $userResponse ) ) ) Default | |
* @since 1.0 | |
* @from WpProQuiz_View_FrontQuiz.php | |
* post_type=sfwd-quiz | |
*/ |
This file contains hidden or 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 | |
//gets all products to put in dropdown in admin settings page | |
function meprprorata_products_dropdown_cb($args, $access= array()) | |
{ | |
//$available = new MeprCouponsHelper::products_dropdown(); | |
$access = is_array($access) ? $access : array(); | |
$contents = array(); | |
$posts = MeprCptModel::all('MeprProduct'); |