Title: php code in header
Last modified: August 22, 2016

---

# php code in header

 *  Resolved [kingsparadise](https://wordpress.org/support/users/kingsparadise/)
 * (@kingsparadise)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/php-code-in-header/)
 * Nice plugin, how can i integrate this plugin in the header.php because it only
   generate short code no php code.
 * [https://wordpress.org/plugins/hide-this/](https://wordpress.org/plugins/hide-this/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Andrés Villarreal](https://wordpress.org/support/users/andrezrv/)
 * (@andrezrv)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/php-code-in-header/#post-5362189)
 * Hi, sorry for the delayed answer.
 * You can use the plugin functionality in your code passing the shortcode arguments
   as an array to the `Hide_This` class.
 * Here’s an example of how it can be done:
 *     ```
       // Put the content you want to show or hide conditionally inside a variable.
       $content = 'My HTML contents.';
   
       if ( class_exists( 'Hide_This' ) ) {
       	// Construct an array with the shortcode arguments.
       	$atts = array(
       		'for'     => 'all',
       		'exclude' => 'username:foo',
       	);
   
       	$hide_this = new Hide_This( $atts, $content );
   
       	echo $hide_this->content;
       } else {
       	echo $content;
       }
       ```
   
 * You can see the full list of arguments and accepted values here: [https://wordpress.org/plugins/hide-this/](https://wordpress.org/plugins/hide-this/).
 * Hope this helps 🙂

Viewing 1 replies (of 1 total)

The topic ‘php code in header’ is closed to new replies.

 * ![](https://ps.w.org/hide-this/assets/icon-256x256.png?rev=1638288)
 * [Hide This](https://wordpress.org/plugins/hide-this/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/hide-this/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/hide-this/)
 * [Active Topics](https://wordpress.org/support/plugin/hide-this/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/hide-this/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/hide-this/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Andrés Villarreal](https://wordpress.org/support/users/andrezrv/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/php-code-in-header/#post-5362189)
 * Status: resolved