Allow underscore in equation variable names

This commit is contained in:
Brian Miyaji
2015-04-14 17:53:25 +10:00
parent 7f5d878770
commit 5b3d213849
2 changed files with 20 additions and 17 deletions

View File

@@ -350,7 +350,7 @@ class eqEOS {
preg_replace("/\s/", "", $infix); preg_replace("/\s/", "", $infix);
//Find all the variables that were passed and replaces them //Find all the variables that were passed and replaces them
while((preg_match('/(.){0,1}[&$]([a-zA-Z]+)(.){0,1}/', $infix, $match)) != 0) { while((preg_match('/(.){0,1}[&$]([a-zA-Z_]+)(.){0,1}/', $infix, $match)) != 0) {
//remove notices by defining if undefined. //remove notices by defining if undefined.
if(!isset($match[3])) { if(!isset($match[3])) {

View File

@@ -509,6 +509,7 @@ if ( !function_exists( 'sp_dropdown_taxonomies' ) ) {
'placeholder' => null, 'placeholder' => null,
'chosen' => false, 'chosen' => false,
'parent' => 0, 'parent' => 0,
'include_children' => true,
); );
$args = array_merge( $defaults, $args ); $args = array_merge( $defaults, $args );
if ( ! $args['taxonomy'] ) return false; if ( ! $args['taxonomy'] ) return false;
@@ -568,6 +569,7 @@ if ( !function_exists( 'sp_dropdown_taxonomies' ) ) {
printf( '<option value="%s" %s>%s</option>', $this_value, $selected_prop, $term->name ); printf( '<option value="%s" %s>%s</option>', $this_value, $selected_prop, $term->name );
if ( $args['include_children'] ):
$term_children = get_term_children( $term->term_id, $args['taxonomy'] ); $term_children = get_term_children( $term->term_id, $args['taxonomy'] );
foreach ( $term_children as $term_child_id ): foreach ( $term_children as $term_child_id ):
@@ -587,6 +589,7 @@ if ( !function_exists( 'sp_dropdown_taxonomies' ) ) {
printf( '<option value="%s" %s>%s</option>', $this_value, $selected_prop, '— ' . $term_child->name ); printf( '<option value="%s" %s>%s</option>', $this_value, $selected_prop, '— ' . $term_child->name );
endforeach; endforeach;
endif;
endforeach; endforeach;
print( '</select>' ); print( '</select>' );
return true; return true;
@@ -1009,7 +1012,7 @@ if ( !function_exists( 'sp_get_eos_safe_slug' ) ) {
$title = sp_numbers_to_words( $title ); $title = sp_numbers_to_words( $title );
// Remove all other non-alphabet characters // Remove all other non-alphabet characters
$title = preg_replace( "/[^a-z]/", '', $title ); $title = preg_replace( "/[^a-z_]/", '', $title );
// Convert post ID to words if title is empty // Convert post ID to words if title is empty
if ( $title == '' ): if ( $title == '' ):