From d29302863768fc74842047da90eb2e02a376bbc1 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 29 Jul 2016 15:08:49 -0400 Subject: [PATCH] Small text updates mostly adding spacing to method calls. --- index.php | 52 +++++++++++++++++++--------------------------------- 1 file changed, 19 insertions(+), 33 deletions(-) diff --git a/index.php b/index.php index 3a79d1c..fedfda6 100644 --- a/index.php +++ b/index.php @@ -14,8 +14,8 @@ define( 'MICHSCI_PRODUCT_SINGLE', 'Product' ); define( 'MICHSCI_PRODUCT_PLURAL', 'Products' ); define( 'MICHSCI_CATEGORY_NAME', 'michsci_category' ); define( 'MICHSCI_CATEGORY_SLUG', 'michsci-category' ); -define( 'MICHSCI_CATEGORY_SINGLE', 'Category'); -define( 'MICHSCI_CATEGORY_PLURAL', 'Categories'); +define( 'MICHSCI_CATEGORY_SINGLE', 'Category' ); +define( 'MICHSCI_CATEGORY_PLURAL', 'Categories' ); define( 'MICHSCI_TAG_NAME', 'michsci_tag' ); define( 'MICHSCI_TAG_SLUG', 'michsci-tag' ); define( 'MICHSCI_TAG_SINGLE', 'Tag' ); @@ -105,8 +105,8 @@ function michsci_custom_post_type() { */ function michsci_add_metaboxes() { - add_meta_box('miproduct_features', 'Features', 'miproduct_features', MICHSCI_POST_TYPE, 'normal', 'high'); - add_meta_box('miproduct_related_products', 'Related Files', 'miproduct_related_products', MICHSCI_POST_TYPE, 'normal', 'high'); + add_meta_box('miproduct_features', 'Features', 'miproduct_features', MICHSCI_POST_TYPE, 'normal', 'high' ); + add_meta_box('miproduct_related_products', 'Related Files', 'miproduct_related_products', MICHSCI_POST_TYPE, 'normal', 'high' ); } /** @@ -203,8 +203,8 @@ function michsci_taxonomies() // Categories $labels = array( - 'name' => _x( MICHSCI_CATEGORY_NAME, 'taxonomy general name'), - 'singular_name' => _x( MICHSCI_CATEGORY_NAME, 'taxonomy singular name'), + 'name' => _x( MICHSCI_CATEGORY_NAME, 'taxonomy general name' ), + 'singular_name' => _x( MICHSCI_CATEGORY_NAME, 'taxonomy singular name' ), 'search_items' => __( 'Search ' . MICHSCI_CATEGORY_PLURAL), 'all_items' => __( 'All ' . MICHSCI_CATEGORY_PLURAL), 'parent_item' => __( 'Parent ' . MICHSCI_CATEGORY_SINGLE), @@ -212,7 +212,7 @@ function michsci_taxonomies() 'edit_item' => __( 'Edit ' . MICHSCI_CATEGORY_SINGLE), 'update_item' => __( 'Update ' . MICHSCI_CATEGORY_SINGLE), 'add_new_item' => __( 'Add New ' . MICHSCI_CATEGORY_SINGLE), - 'new_item_name' => __( 'New ' . MICHSCI_CATEGORY_SINGLE . ' Name'), + 'new_item_name' => __( 'New ' . MICHSCI_CATEGORY_SINGLE . ' Name' ), 'menu_name' => __( 'Product ' . MICHSCI_CATEGORY_SINGLE ), ); @@ -241,8 +241,8 @@ function michsci_taxonomies() // Tags $labels = array( - 'name' => _x( MICHSCI_TAG_SINGLE, 'taxonomy general name'), - 'singular_name' => _x( MICHSCI_TAG_SINGLE, 'taxonomy singular name'), + 'name' => _x( MICHSCI_TAG_SINGLE, 'taxonomy general name' ), + 'singular_name' => _x( MICHSCI_TAG_SINGLE, 'taxonomy singular name' ), 'search_items' => __( 'Search ' . MICHSCI_TAG_PLURAL), 'all_items' => __( 'All ' . MICHSCI_TAG_PLURAL), 'parent_item' => __( 'Parent ' . MICHSCI_TAG_SINGLE), @@ -250,7 +250,7 @@ function michsci_taxonomies() 'edit_item' => __( 'Edit ' . MICHSCI_TAG_SINGLE), 'update_item' => __( 'Update ' . MICHSCI_TAG_SINGLE), 'add_new_item' => __( 'Add New ' . MICHSCI_TAG_SINGLE), - 'new_item_name' => __( 'New ' . MICHSCI_TAG_SINGLE . ' Name'), + 'new_item_name' => __( 'New ' . MICHSCI_TAG_SINGLE . ' Name' ), 'menu_name' => __( 'Product ' . MICHSCI_TAG_SINGLE), ); @@ -444,7 +444,7 @@ function michsci_shortcode($atts) } $term = get_term_by("id", $_REQUEST[MICHSCI_CATEGORY_NAME],"michsci_category"); $name = $term->name; - + if(!$name){ $name = "ALL PRODUCTS"; } @@ -455,7 +455,7 @@ function michsci_shortcode($atts) echo '
'; @@ -465,9 +465,7 @@ function michsci_shortcode($atts) } else if ( $cat_id = filter_var( $_REQUEST['category'], FILTER_VALIDATE_INT ) ) { michsci_list_categories($cat_id); } else if ( !$catid_id && !$product_id ) { -// $text_query = $_REQUEST['tsearch']; $text_query = filter_var($_REQUEST['tsearch'], FILTER_SANITIZE_STRING); -// strip_tags($text_query); if(isset($_REQUEST['tsearch'])){ setcookie("search", "true",time()+2, "/" ); } else { @@ -475,8 +473,8 @@ function michsci_shortcode($atts) } michsci_list_products($text_query); michsci_list_categories(); - } - + } + $output = ob_get_contents(); ob_end_clean(); return $output; @@ -492,11 +490,6 @@ function michsci_shortcode($atts) */ function michsci_get_terms_dropdown($cat_id) { -// $test = $_REQUEST['tsearch']; -// $filterTest = filter_var($test, FILTER_SANITIZE_STRING); -// echo $filterTest; - - $taxonomyName = MICHSCI_CATEGORY_NAME; if($cat_id){ $main = get_term($cat_id, MICHSCI_CATEGORY_NAME); @@ -512,10 +505,10 @@ function michsci_get_terms_dropdown($cat_id) } $output .=""; } else { - + $parent_terms = get_terms($taxonomyName, array('parent' => 0, 'orderby' => 'name', 'hide_empty' => false)); $terms = get_terms($taxonomyName, array('orderby' => 'name', 'hide_empty' => false)); - + $output ="