get_options(); if ( !empty( $options['enable_permalinks'] ) ) { $args += array( 'publicly_queryable' => true, 'exclude_from_search' => false, 'rewrite' => array( 'slug' => $options['permalink_slug'] ), ); } $args += array( 'public' => true, 'publicly_queryable' => false, 'exclude_from_search' => true, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => false, 'rewrite' => false, 'query_var' => 'sm-location', 'register_meta_box_cb' => array( &$this, 'location_meta_cb' ), 'supports' => array(), 'labels' => array( 'name' => 'Locations', 'singular_name' => 'Location', 'add_new_item' => 'Add New Location', 'edit_item' => 'Edit Location', 'new_item' => 'New Location', 'view_item' => 'View Locations', 'search_items' => 'Search Locations', 'not_found' => 'No Locations found', 'not_found_in_trash' => 'No Locations found in trash', ) ); // Register it register_post_type( 'sm-location', $args ); } // Register custom taxonomies for locations function register_location_taxonomies() { global $simple_map; $options = $simple_map->get_options(); foreach ( $options['taxonomies'] as $taxonomy => $tax_info ) { $this->register_location_taxonomy( $taxonomy, $tax_info ); } } // Register custom taxonomy for locations function register_location_taxonomy( $taxonomy, $tax_info ) { if ( taxonomy_exists( $taxonomy ) ) { return; } $tax_info += array( 'singular' => $taxonomy, 'plural' => $taxonomy, 'hierarchical' => false, ); $args = array( 'labels' => array( 'name' => 'Location ' . $tax_info['plural'], 'singular_name' => 'Location ' . $tax_info['singular'], 'search_items' => 'Search ' . $tax_info['plural'], 'popular_items' => 'Popular ' . $tax_info['plural'], 'all_items' => 'All ' . $tax_info['plural'], 'parent_item' => 'Parent ' . $tax_info['singular'], 'parent_item_colon' => 'Parent ' . $tax_info['singular'] . ':', 'edit_item' => 'Edit ' . $tax_info['singular'], 'update_item' => 'Update ' . $tax_info['singular'], 'add_new_item' => 'Add New ' . $tax_info['singular'], 'new_item_name' => 'New ' . $tax_info['singular'] . ' Name', 'separate_items_with_commas' => 'Separate ' . strtolower( $tax_info['plural'] ) . ' with commas', 'add_or_remove_items' => 'Add or remove ' . strtolower( $tax_info['plural'] ), 'choose_from_most_used' => 'Choose from the most used ' . strtolower( $tax_info['plural'] ), ), 'hierarchical' => $tax_info['hierarchical'], 'rewrite' => false, 'show_tagcloud' => false ); register_taxonomy( $taxonomy, 'sm-location', $args ); } // Add call back for meta box function location_meta_cb(){ add_meta_box( 'sm-location-premium-support', __( 'Premium Support', 'SimpleMap' ), array( &$this, 'premium_support' ), 'sm-location', 'side', 'high' ); add_meta_box( 'sm-geo-location', __( 'Geographic Location', 'SimpleMap' ), array( &$this, 'geo_location' ), 'sm-location', 'normal' ); add_meta_box( 'sm-additional-information', __( 'Additional Information', 'SimpleMap' ), array( &$this, 'additional_information' ), 'sm-location', 'normal' ); add_meta_box( 'sm-location-drag-drop', __( 'Drag and Drop Location', 'SimpleMap' ), array( &$this, 'location_drag_drop' ), 'sm-location', 'side' ); } // Add premium support box function premium_support() { global $simplemap_ps, $current_user; wp_get_current_user(); $status_key = md5( 'ft_premium_support_' . $simplemap_ps->product_id . '_' . sanitize_title_with_dashes( $simplemap_ps->site_url ) . '_' . sanitize_title_with_dashes( $simplemap_ps->server_url ) ) ; $sso_key = md5( 'ft_premium_sso_' . $current_user->ID . '_' . $simplemap_ps->product_id . '_' . sanitize_title_with_dashes( $simplemap_ps->site_url ) . '_' . sanitize_title_with_dashes( $simplemap_ps->server_url ) ); // Set status from transient if not set via global if ( '' == $simplemap_ps->ps_status && '' != get_transient( $status_key ) ) $simplemap_ps->ps_status = get_transient( $status_key ); // Set sso key from transient if not set via global if ( '' == $simplemap_ps->sso_status && '' != get_transient( $sso_key ) ) $simplemap_ps->sso_status = get_transient( $sso_key ); //echo "
";print_r( $simplemap_ps );echo "
"; if ( ! url_has_ftps_for_item( $simplemap_ps ) ) : ?>