backward.php
12 years ago
get_taxonomies_by_object_type.php
10 years ago
pmxe_filter.php
8 years ago
pmxe_functions.php
5 years ago
pmxe_prepare_price.php
8 years ago
pmxe_render_xml_attributes.php
9 years ago
pmxe_render_xml_element.php
8 years ago
pmxe_render_xml_text.php
8 years ago
str_getcsv.php
12 years ago
wp_all_export_check_children_assign.php
10 years ago
wp_all_export_clear_xss.php
4 years ago
wp_all_export_generate_export_file.php
8 years ago
wp_all_export_get_cpt_name.php
8 years ago
wp_all_export_get_export_format.php
8 years ago
wp_all_export_is_compatible.php
10 years ago
wp_all_export_parse_field_name.php
9 years ago
wp_all_export_posts_join.php
10 years ago
wp_all_export_posts_where.php
8 years ago
wp_all_export_pre_user_query.php
7 years ago
wp_all_export_prepare_template_csv.php
7 years ago
wp_all_export_prepare_template_xml.php
7 years ago
wp_all_export_rand_char.php
10 years ago
wp_all_export_remove_colons.php
10 years ago
wp_all_export_remove_source.php
10 years ago
wp_all_export_reverse_rules_html.php
8 years ago
wp_all_export_rmdir.php
10 years ago
wp_all_export_secure_file.php
9 years ago
wp_all_export_url_title.php
10 years ago
wp_all_export_write_article.php
10 years ago
wp_redirect_or_javascript.php
12 years ago
wp_all_export_url_title.php
42 lines
| 1 | <?php |
| 2 | if ( ! function_exists('wp_all_export_url_title')){ |
| 3 | |
| 4 | function wp_all_export_url_title($str, $separator = 'dash', $lowercase = FALSE) |
| 5 | { |
| 6 | if ($separator == 'dash') |
| 7 | { |
| 8 | $search = '_'; |
| 9 | $replace = '-'; |
| 10 | } |
| 11 | else |
| 12 | { |
| 13 | $search = '-'; |
| 14 | $replace = '_'; |
| 15 | } |
| 16 | |
| 17 | $trans = array( |
| 18 | '&\#\d+?;' => '', |
| 19 | '&\S+?;' => '', |
| 20 | '\s+' => $replace, |
| 21 | '[^a-z0-9\-\._]' => '', |
| 22 | $replace.'+' => $replace, |
| 23 | $replace.'$' => $replace, |
| 24 | '^'.$replace => $replace, |
| 25 | '\.+$' => '' |
| 26 | ); |
| 27 | |
| 28 | $str = strip_tags($str); |
| 29 | |
| 30 | foreach ($trans as $key => $val) |
| 31 | { |
| 32 | $str = preg_replace("#".$key."#i", $val, $str); |
| 33 | } |
| 34 | |
| 35 | if ($lowercase === TRUE) |
| 36 | { |
| 37 | $str = strtolower($str); |
| 38 | } |
| 39 | |
| 40 | return trim(stripslashes($str)); |
| 41 | } |
| 42 | } |