'; $html .= '
'; $html .= ''; $html .= ''; if ( empty( $what_option ) ) { $html .= ''; } else { if ( empty( $what_option_width ) ) $what_option_width = '140'; $html .= ''; } $html .= ''; $html .= ''; if ( empty( $sort_option ) ) { $html .= ''; } else { if ( empty( $sort_option_width ) ) $sort_option_width = '140'; $html .= ''; } if ( empty( $custom_css_url ) ) $custom_css_url = 'http://www.allsitesearch.com/als_wpstyle.css'; $html .= ''; $robot_value = 1; if ( ! empty( $robots_excluded ) ) $robot_value = 0; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $name = get_bloginfo('name'); $html .= ''; $html .= ''; $html .= ''; $html .= ''; if ( empty( $input_width ) ) $input_width = '20'; $html .= '  '; $html .= ''; $html .= '
'; if ( ! empty( $default_form_style ) ) $html .= '
'; return $html; } /** * Retrieve TLD from URL * * @since 0.1.0 */ function all_site_search_get_tld( $url ) { $tld = ''; $url_parts = parse_url( (string) $url ); if ( is_array( $url_parts ) && isset( $url_parts[ 'host'] ) ) { $host_parts = explode( '.', $url_parts[ 'host' ] ); if ( is_array( $host_parts ) && count( $host_parts ) > 0 ) { $tld = array_pop( $host_parts ); } } return $tld; } /** * Returns URL without the http:// at the beginning. */ function all_site_search_remove_http( $url ) { $disallowed = array( 'http://', 'https://', ); foreach( $disallowed as $d ) { if ( strpos( $url, $d ) === 0 ) { return str_replace( $d, '', $url ); } } return $url; } /** * Adds default form styles. */ add_action( 'wp_enqueue_scripts', 'all_site_search_add_default_form_style_action' ); function all_site_search_add_default_form_style_action() { $options = get_option( 'all_site_search' ); $default_form_style = $options['default_form_style']; if ( empty( $default_form_style ) ) return false; wp_register_style( 'all-site-search-forms', plugins_url( 'style/forms.css', __FILE__ ) ); wp_enqueue_style( 'all-site-search-forms' ); }