Title: PHP concatenation
Last modified: August 20, 2016

---

# PHP concatenation

 *  Resolved [Rodrigo G. D’Agostino](https://wordpress.org/support/users/rodni/)
 * (@rodni)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/php-concatenation/)
 * I’m quite a newbie in PHP, I can only manage simple stuff, and this is giving
   me a really big headache.
 * I’d like to make this piece of code:
 *     ```
       <?php edit_post_link( __( 'Editar', 'fcwk' ), '<span class="sep"> | </span><span class="edit-link">', '</span>' ); ?>
       ```
   
 * …work only when a user is logged in, so it would be inside of this other piece
   of code:
 *     ```
       <?php if ( is_user_logged_in() ) { } ?>
       ```
   
 * Thanks in advance! 🙂

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/php-concatenation/#post-2725683)
 * the ‘edit’-link is hidden ahyway for not-logged-in users – why do you want to
   add more code?
 * [http://codex.wordpress.org/Function_Reference/edit_post_link](http://codex.wordpress.org/Function_Reference/edit_post_link)
 * > Displays a link to edit the current post, _**if a user is logged in**_ and 
   > allowed to edit the post.
 * (emphasis added)
 *  Thread Starter [Rodrigo G. D’Agostino](https://wordpress.org/support/users/rodni/)
 * (@rodni)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/php-concatenation/#post-2725752)
 * I’m sorry, I missed a little part!
    Here we go again:
 *     ```
       <div class="entry-meta">
       <?php edit_post_link( __( 'Edit', 'fcwk' ), '<span class="sep"> | </span><span class="edit-link">', '</span>' ); ?>
       </div>
       ```
   
 * Maybe now rings another bell 😛
    I need to make the hole thing disappear, because
   that’s the only way in which my design will stay the way I want it to stay 🙂
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/php-concatenation/#post-2725755)
 *     ```
       <?php if ( is_user_logged_in() ) { ?>
   
       <div class="entry-meta">
       <?php edit_post_link( __( 'Edit', 'fcwk' ), '<span class="sep"> | </span><span class="edit-link">', '</span>' ); ?>
       </div>
   
       <?php } ?>
       ```
   
 *  Thread Starter [Rodrigo G. D’Agostino](https://wordpress.org/support/users/rodni/)
 * (@rodni)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/php-concatenation/#post-2725762)
 * OMG! I feel so stupid now xP I got so into it that I didn’t realize I could solve
   it so easily! Thank you so much alchymyth! 🙂
 * And just for extra-learning… is there any way to concatenate the whole thing 
   using just one “<?php…>?”?
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/php-concatenation/#post-2725782)
 * > is there any way to concatenate the whole thing using just one “<?php…>?”?
 * try to add the html into the ‘before’ and ‘after’ parameters of the ‘edit_post_link()’
   code;
 * example (ths replaces the whole 5 lines from my last reply):
 *     ```
       <?php edit_post_link( __( 'Edit', 'fcwk' ), '<div class="entry-meta"><span class="sep"> | </span><span class="edit-link">', '</span></div>' ); ?>
       ```
   
 *  Thread Starter [Rodrigo G. D’Agostino](https://wordpress.org/support/users/rodni/)
 * (@rodni)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/php-concatenation/#post-2725784)
 * Wow! Another great idea!
    Thanks a lot for everything alchymyth! Hope to see 
   around 🙂

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

The topic ‘PHP concatenation’ is closed to new replies.

## Tags

 * [concatenation](https://wordpress.org/support/topic-tag/concatenation/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [Rodrigo G. D’Agostino](https://wordpress.org/support/users/rodni/)
 * Last activity: [14 years, 1 month ago](https://wordpress.org/support/topic/php-concatenation/#post-2725784)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
