relative2absolute( $url, $base_url ); //Skip invalid URLs (again) if ( ! $url || ( strlen( $url ) < 6 ) ) { return $instances; } } //The URL is okay, create and populate a new link instance. $instance = new blcLinkInstance(); $instance->set_parser( $this ); $instance->raw_url = $raw_url; $instance->link_text = $default_link_text; $link_obj = new blcLink( $url ); //Creates or loads the link $instance->set_link( $link_obj ); $instances[] = $instance; return $instances; } /** * Change one URL to another (just returns the new URL). * * @param string $content The old URL. * @param string $new_url The new URL. * @param string $old_url Ignored. * @param string $old_raw_url Ignored. * * @return array|WP_Error */ function edit( $content, $new_url, $old_url, $old_raw_url ) { return array( 'content' => $new_url, 'raw_url' => $new_url, ); } /** * For URL fields, "unlinking" simply means blanking the field. * (However, invididual link containers may implement a different logic for those fields.) */ function unlink( $content, $url, $raw_url ) { return ''; } }