ws->get_view_settings(); if ( isset( $view_settings['query_type'] ) && isset( $view_settings['query_type'][0] ) ) { if ( $view_settings['query_type'][0] == 'taxonomy' ) { $query_type = 'taxonomy'; $object = $WP_Views->taxonomy_data['term']; } else if ( $view_settings['query_type'][0] == 'users' ) { $query_type = 'users'; $object = $WP_Views->users_data['term']; } } } array_push($func_args, $query_type); array_push($func_args, $object); $resulting_thing = call_user_func_array( $real_func, $func_args ); if ( isset( $resulting_thing ) && !is_array( $resulting_thing ) && !is_object( $resulting_thing ) ) { $replace = null; if ( is_bool( $resulting_thing ) ) { if ( $resulting_thing ) { $replace = 1; } else { $replace = 0; } } else if ( is_numeric( $resulting_thing ) ) { $replace = $resulting_thing; if ( $replace == 1 ) { $replace = "'1'"; } } else { $replace = "'" . $resulting_thing . "'"; } $evaluate = str_replace($matches[0][$i], $replace, $evaluate); } } } } return $evaluate; } /** * wpv_if_register_api_functions * * Extend the functions registered by the user to include the Views API conditional tags * * @since 1.8.0 */ add_filter( 'wpv_filter_wpv_custom_conditional_functions', 'wpv_if_register_api_functions', 10, 1 ); function wpv_if_register_api_functions( $allowed_functions ) { if ( ! in_array( 'has_wpv_wp_archive', $allowed_functions ) ) { $allowed_functions[] = 'has_wpv_wp_archive'; } if ( ! in_array( 'is_wpv_wp_archive_assigned', $allowed_functions ) ) { $allowed_functions[] = 'is_wpv_wp_archive_assigned'; } if ( ! in_array( 'has_wpv_content_template', $allowed_functions ) ) { $allowed_functions[] = 'has_wpv_content_template'; } if ( ! in_array( 'is_wpv_content_template_assigned', $allowed_functions ) ) { $allowed_functions[] = 'is_wpv_content_template_assigned'; } return $allowed_functions; } /** * Helper function to transform strings into booleans and to clean strings of outtr single quotes */ function wpv_if_func_booleans($string) { if ( $string == 'true' ) { return true; } else if ( $string == 'false' ) { return false; } else if ( $string == 'null' ) { return null; } else { $string = (strpos( $string, '\'' ) === 0) ? substr( $string, 1, strlen( $string ) - 2 ) : $string; return $string; } } TES - MusicLink