Title: Multiple links problem
Last modified: August 20, 2016

---

# Multiple links problem

 *  [Glenn Mulleners](https://wordpress.org/support/users/glennm/)
 * (@glennm)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/multiple-links-problem/)
 * When adding multiple links to a help document, several links (together with some
   content) disappear on the client site and only 1 link is shown.
    Using **Sync
   Pull** option On the site where the documents are pulled from all links and content
   appear as expected.
 * [http://wordpress.org/extend/plugins/wp-help/](http://wordpress.org/extend/plugins/wp-help/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [MWM](https://wordpress.org/support/users/mike235/)
 * (@mike235)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/multiple-links-problem/#post-3316318)
 * I have exactly the same problem.
 * On the synced site, the page display breaks precisely when the first link starts.
 * Here’s an example : [http://imgur.com/jxJyE0L](http://imgur.com/jxJyE0L)
 *  [l0rily](https://wordpress.org/support/users/l0rily/)
 * (@l0rily)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/multiple-links-problem/#post-3316343)
 * I had this problem as well, but I like the concept of the plugin so much that
   I spent some time fixing it.
    It looks like there are a few problems in the code
   related to regular expressions primarily. I’ve got it working on my servers but
   I don’t make any claims that the changes I’m listing will work on all configurations.
   For those of you who are programmers, you can try making the following 5 changes
   to the plugin’s wp-help.php file:
 * 1) Remove the following:
    `public function convert_links_cb( $matches )`
 * 2) Replace this function with the following code:
 *     ```
       private function convert_links($content) {
           $content = preg_replace_callback(
               '/href="[A-z0-9":\/.\-_\?=]*&[amp;]*document=([0-9]+)"/',
               function($matches) {
                   return 'href="http://wp-help-link/' . $matches[1] . '"';
               }, $content);
           $admin_url = parse_url(admin_url('/'));
           $content = preg_replace('#(https?)://' . preg_quote($admin_url['host'] . $admin_url['path'], '#') . '#', '', $content);
           return $content;
       }
       ```
   
 * 3) Replace this function with the following code:
 *     ```
       public function make_links_local_cb( $matches ) {
           $local_id = $this->local_id_from_slurp_id( absint($matches[1]) );
           if ($local_id) {
               return 'href="' . get_permalink(absint($local_id)) . '"';
           } else
               return $matches[0];
       }
       ```
   
 * 4) Replace this function with the following code:
 *     ```
       private function make_links_local($content) {
           $output = preg_replace_callback(
               '/href="http:\/\/wp-help-link\/([0-9]+)"/',
               array($this, 'make_links_local_cb'),
               $content
           );
           return $output;
       }
       ```
   
 * 5) Change the visibility of this function to public instead of private as follows:
   `
   public function local_id_from_slurp_id( $id ) {`

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Multiple links problem’ is closed to new replies.

 * ![](https://ps.w.org/wp-help/assets/icon.svg?rev=2938042)
 * [WP Help](https://wordpress.org/plugins/wp-help/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-help/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-help/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-help/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-help/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-help/reviews/)

## Tags

 * [content](https://wordpress.org/support/topic-tag/content/)
 * [links](https://wordpress.org/support/topic-tag/links/)
 * [not appearing](https://wordpress.org/support/topic-tag/not-appearing/)

 * 2 replies
 * 3 participants
 * Last reply from: [l0rily](https://wordpress.org/support/users/l0rily/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/multiple-links-problem/#post-3316343)
 * Status: not resolved