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 | |
add_action( 'init', 'product_init' ); | |
function product_init() | |
{ | |
register_taxonomy( 'product_packages', 'products', | |
array( 'hierarchical' => true, | |
'label' => __('Product Packages'), | |
'query_var' => false | |
) | |
); |
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 | |
add_action( 'init', 'product_init' ); | |
function product_init() | |
{ | |
global $wpdb; | |
register_taxonomy( 'product_packages', 'products', | |
array( 'hierarchical' => true, | |
'label' => __('Product Packages'), | |
'query_var' => false |
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 | |
add_action( 'edited_product_packages', 'save_product_packages', 10, 2); | |
function save_product_packages($term_id, $tt_id) | |
{ | |
if (!$term_id) return; | |
if (isset($_POST['product_package_active'])) | |
update_metadata($_POST['taxonomy'], $term_id, 'product_package_active', | |
$_POST['product_package_active']); |
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 | |
add_action( 'product_packages_edit_form_fields', 'edit_product_packages', 10, 2); | |
function edit_product_packages($tag, $taxonomy) | |
{ | |
$product_package_active = get_metadata($tag->taxonomy, $tag->term_id, 'product_package_active', true); | |
// Check/Set the default value | |
if (!$product_package_active) | |
$product_package_active = "Yes"; |
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 | |
add_action( 'init', 'product_init' ); | |
function product_init() | |
{ | |
register_taxonomy( 'product_packages', 'products', | |
array( 'hierarchical' => true, | |
'label' => __('Product Packages'), | |
'query_var' => false | |
) | |
); |
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 | |
// Used to limit the categories displayed on the home page. | |
function myHomePostsFilter($query) | |
{ | |
if ($query->is_home) | |
{ | |
$query->set('cat','1'); | |
} | |
return $query; | |
} |
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 | |
add_filter( 'manage_edit-post_columns', 'admin_post_header_columns', 10, 1); | |
add_action( 'manage_posts_custom_column', 'admin_post_data_row', 10, 2); | |
function admin_post_header_columns($columns) | |
{ | |
if (!isset($columns['note'])) | |
$columns['note'] = "Notes"; | |
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
function limit_posts_per_archive_page( $query ) { | |
// If running within wp_admin or NOT the main $wp_query abort! | |
if ( is_admin() || ! $query->is_main_query() ) return; | |
if ( $query->is_category() ) { | |
$query->set('posts_per_archive_page', 8); | |
} elseif ( $query->is_search() ) { | |
$query->set('posts_per_archive_page', 10); | |
} |
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
function load_class_destination($d_info) { | |
$this->destination_info['type'] = "aws"; // ALWAYS aws. Do not change. | |
$this->destination_info['name'] = "Your name for the destination. "; // Change this if you want. | |
$this->destination_info['awskey'] = ""; // Your AWS Access Key ID | |
$this->destination_info['secretkey'] = ""; // Your AWS Access Key Secret | |
$this->destination_info['ssl'] = "yes"; // Can be 'yes' or 'no' | |
$this->destination_info['region'] = AmazonS3::REGION_US_E1; // See line 81 for values | |
$this->destination_info['storage'] = AmazonS3::STORAGE_STANDARD; // See line 92 for values | |
$this->destination_info['acl'] = AmazonS3::ACL_PRIVATE; // See line 97 for values |