'sm-location', 'posts_per_page' => 200 ) ) ) { // Delete posts (and therby postmeta as well). Second arg bypasses trash foreach ( $locations as $key => $location ) { set_time_limit( 20 ); wp_delete_post( $location->ID, true ); } } $options = $simple_map->get_options(); $taxonomies = $options['taxonomies']; $original_taxonomies = array_keys( $simple_map->get_taxonomy_settings() ); if ( is_array( $original_taxonomies ) ) { foreach ( $original_taxonomies as $taxonomy ) { $taxonomies[$taxonomy] = true; if ( ! taxonomy_exists( $taxonomy ) ) { $sm_locations->register_location_taxonomy( $taxonomy, array() ); } } } // Delete taxonomy terms $args = array( 'hide_empty' => 0 ); if ( $terms = get_terms( array_keys( $taxonomies ), $args ) ) { foreach ( $terms as $key => $term ) { wp_delete_term( $term->term_id, $term->taxonomy ); } } // Delete Options if ( get_option( 'SimpleMap_options' ) && empty( $_GET['locations-only'] ) ) { delete_option( 'SimpleMap_options' ); } do_action( 'sm-delete-all-data' ); wp_safe_redirect( admin_url( 'admin.php?page=simplemap' ) ); } } $options = $simple_map->get_options(); // Update Options if form was submitted or if WordPress options doesn't exist yet. if ( isset( $_POST['sm_general_options_submitted'] ) ) { check_admin_referer( 'sm-general-options' ); $new_options = $options; // Validate POST Options //$new_options['api_key'] = ( ! empty( $_POST['api_key'] ) ) ? $_POST['api_key'] : ''; $new_options['map_width'] = ( ! empty( $_POST['map_width'] ) ) ? $_POST['map_width'] : $options['map_width']; $new_options['map_height'] = ( ! empty( $_POST['map_height'] ) ) ? $_POST['map_height'] : $options['map_height']; $new_options['default_lat'] = ( ! empty( $_POST['default_lat'] ) ) ? $_POST['default_lat'] : $options['default_lat'] ; $new_options['default_lng'] = ( ! empty( $_POST['default_lng'] ) ) ? $_POST['default_lng'] : $options['default_lng'] ; $new_options['zoom_level'] = ( isset( $_POST['zoom_level'] ) ) ? absint( $_POST['zoom_level'] ) : $options['zoom_level'] ; $new_options['default_radius'] = ( ! empty( $_POST['default_radius'] ) ) ? absint( $_POST['default_radius'] ) : $options['default_radius'] ; $new_options['map_type'] = ( ! empty( $_POST['map_type'] ) ) ? $_POST['map_type'] : $options['map_type']; $new_options['special_text'] = ( isset( $_POST['special_text'] ) ) ? $_POST['special_text'] : $options['special_text']; $new_options['default_state'] = ( ! empty( $_POST['default_state'] ) ) ? $_POST['default_state'] : $options['default_state']; $new_options['default_country'] = ( ! empty( $_POST['default_country'] ) ) ? esc_attr( $_POST['default_country'] ) : $options['default_country']; $new_options['default_language'] = ( ! empty( $_POST['default_language'] ) ) ? esc_attr( $_POST['default_language'] ) : $options['default_language']; $new_options['default_domain'] = ( ! empty( $_POST['default_domain'] ) ) ? $_POST['default_domain'] : $options['default_domain']; $new_options['address_format'] = ( ! empty( $_POST['address_format'] ) ) ? $_POST['address_format'] : $options['address_format']; $new_options['map_stylesheet'] = ( ! empty( $_POST['map_stylesheet'] ) ) ? $_POST['map_stylesheet'] : $options['map_stylesheet']; $new_options['units'] = ( ! empty( $_POST['units'] ) ) ? $_POST['units'] : $options['units']; $new_options['results_limit'] = ( isset( $_POST['results_limit'] ) ) ? absint( $_POST['results_limit'] ) : $options['results_limit']; $new_options['autoload'] = ( ! empty( $_POST['autoload'] ) ) ? $_POST['autoload'] : $options['autoload']; $new_options['map_pages'] = ( isset( $_POST['map_pages'] ) ) ? $_POST['map_pages'] : $options['map_pages']; $new_options['lock_default_location'] = ( ! empty( $_POST['lock_default_location'] ) ) ? true : $options['lock_default_location']; $new_options['powered_by'] = ( isset( $_POST['powered_by'] ) && 'on' == $_POST['powered_by'] ) ? 1 : 0; $new_options['enable_permalinks'] = ( isset( $_POST['enable_permalinks'] ) && 'on' == $_POST['enable_permalinks'] ) ? 1 : 0; $new_options['permalink_slug'] = ( ! empty( $_POST['permalink_slug'] ) ) ? $_POST['permalink_slug'] : $options['permalink_slug']; $new_options['adsense_for_maps'] = ( isset( $_POST['adsense_for_maps'] ) && 'on' == $_POST['adsense_for_maps'] ) ? 1 : 0; $new_options['adsense_pub_id'] = ( isset( $_POST['adsense_pub_id'] ) ) ? $_POST['adsense_pub_id'] : $options['adsense_pub_id']; $new_options['adsense_channel_id'] = ( isset( $_POST['adsense_channel_id'] ) ) ? $_POST['adsense_channel_id'] : $options['adsense_channel_id']; $new_options['adsense_max_ads'] = ( isset( $_POST['adsense_max_ads'] ) ) ? absint( $_POST['adsense_max_ads'] ) : $options['adsense_max_ads']; $new_options['display_search'] = ( ! empty( $_POST['display_search'] ) ) ? $_POST['display_search'] : $options['display_search']; $new_options['auto_locate'] = ( isset( $_POST['auto_locate'] ) ) ? $_POST['auto_locate'] : $options['auto_locate']; foreach ( $new_options['taxonomies'] as $taxonomy => $tax_info ) { if ( isset( $_POST['taxonomies'][$taxonomy]['active'] ) ) { $new_tax_options = $_POST['taxonomies'][$taxonomy]; unset($new_tax_options['active']); //echo 'UPDATE(' . $taxonomy . ' - ' . json_encode( array_diff_assoc( array_filter( $new_tax_options ), $tax_info ) ) . ')' . PHP_EOL; $new_options['taxonomies'][$taxonomy] = array_filter( $new_tax_options ) + $tax_info; unset($_POST['taxonomies'][$taxonomy]); } else { //echo 'DISABLE(' . $taxonomy . ')' . PHP_EOL; unset($new_options['taxonomies'][$taxonomy]); } } if ( isset( $_POST['taxonomies'] ) ) { foreach ( $_POST['taxonomies'] as $taxonomy => $tax_info ) { if ( isset( $tax_info['active'] ) ) { //echo 'ENABLE(' . $taxonomy . ')' . PHP_EOL; $new_options['taxonomies'][$taxonomy] = $simple_map->get_taxonomy_settings( $taxonomy ); } } } $new_options = apply_filters( 'sm-new-general-options', $new_options, $options ); if ( $new_options !== $options && update_option( 'SimpleMap_options', $new_options ) ) { if ( $new_options['enable_permalinks'] !== $options['enable_permalinks'] || $new_options['permalink_slug'] !== $options['permalink_slug'] ) { update_option( 'sm-rewrite-rules', true ); } do_action( 'sm-general-options-updated' ); wp_redirect( admin_url( 'admin.php?page=simplemap&sm-msg=1' ) ); die(); } } } // Prints the options page function print_page(){ global $simple_map, $wpdb; $options = $simple_map->get_options(); extract( $options ); // Set Autoload Vars $count = $wpdb->get_col( "SELECT COUNT(ID) FROM `" . $wpdb->posts . "` WHERE post_type = 'sm-location' AND post_status = 'publish'" ); if ( $count >= 250 ) { $disabled_autoload = false; // let it happen. we're limiting to 500 in the query $disabledmsg = sprintf( __( 'You have to many locations to auto-load them all. Only the closest %d will be displayed if auto-load all is selected.', 'SimpleMap' ), '250' ); } else { $disabled_autoload = false; $disabledmsg = ''; } // Extract styles $themes1 = $themes2 = array(); if ( file_exists( SIMPLEMAP_PATH . '/inc/styles' ) ) $themes1 = $this->read_styles( SIMPLEMAP_PATH . '/inc/styles' ); if ( file_exists( WP_PLUGIN_DIR . '/simplemap-styles' ) ) $themes2 = $this->read_styles( WP_PLUGIN_DIR . '/simplemap-styles' ); $themes1 = apply_filters( 'sm-general-options-themes1', $themes1 ); $themes2 = apply_filters( 'sm-general-options-themes1', $themes2 ); ?>
show_toolbar( $sm_page_title ); // Messages if ( isset( $_GET['sm-msg'] ) && '1' == $_GET['sm-msg'] ) echo '

'.__('SimpleMap settings saved.', 'SimpleMap').'

'; ?>



', ' ' ); ?>

*/ ?>

get_api_link() . '">', ''); ?>

type="text" name="default_address" id="default_address" size="30" value="" />  onclick="codeAddress();return false;" href="#">



', '', '
', '', '', '
', '', '' ) ); ?>
' . $disabledmsg . ''; } ?>




', ' ' ); ?>


get_taxonomy_settings(); $taxonomies += $standard_taxonomies; foreach ( $taxonomies as $taxonomy => $tax_info ) { $safe = str_replace( '-', '_', $taxonomy ); $label = isset( $tax_info['description'] ) ? $tax_info['description'] : str_replace( 'sm-', '', $taxonomy ); $active = !empty( $options['taxonomies'][$taxonomy] ); echo ''; echo '
'; if ( $active && !isset( $standard_taxonomies[$taxonomy] ) ) { echo '
'; echo ''; echo '
'; echo ''; echo '
'; echo '
'; } } ?>






%s was purchased on %s by %s (%s). It will remain valid for this URL until %s.", get_ftps_site( $simplemap_ps ), date( "F d, Y", get_ftps_purchase_date( $simplemap_ps ) ), get_ftps_name( $simplemap_ps ), get_ftps_email( $simplemap_ps ), date( "F d, Y", get_ftps_exp_date( $simplemap_ps ) ) ); ?>

|

[simplemap]' ); ?>



100%', '500px' ); ?>

', '' ); ?>
/*
Theme Name: THEME_NAME_HERE
*/
  

  

Donate via PayPal