Title: hard code into php file?
Last modified: August 21, 2016

---

# hard code into php file?

 *  Resolved [nomastalgic](https://wordpress.org/support/users/nomastalgic/)
 * (@nomastalgic)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/hard-code-into-php-file/)
 * Hi, I want to buy this plugin if it works well, but I need to hard code into 
   the php files instead of using a shortcode. Is this possible?
 * Thank you!
 * [https://wordpress.org/plugins/social-locker/](https://wordpress.org/plugins/social-locker/)

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

 *  Plugin Author [OnePress](https://wordpress.org/support/users/onepressmedia/)
 * (@onepressmedia)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/hard-code-into-php-file/#post-4642006)
 * Hi,
 * Thank you for your interest in the plugin.
 * Yes, it’s possible. Please check out this article:
 * [http://support.onepress-media.com/how-to-invoke-social-locker-outside-of-post-content-directly-via-php/](http://support.onepress-media.com/how-to-invoke-social-locker-outside-of-post-content-directly-via-php/)
 * Also you can use a CSS selector to choose content to lock (it’s a part of the
   Batch Lock feature).
 * Paul
 *  [Li-An](https://wordpress.org/support/users/li-an/)
 * (@li-an)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/hard-code-into-php-file/#post-4642099)
 * The example you give is perturbing: I don’t understant clearly what content is
   locked and it I have to change the code for each post I need to lock content.
 * Won’t this do the job ?
 * `echo do_shortcode('[iscorrect]'.$text_to_be_wrapped_in_shortcode.'[/iscorrect]');`
   
   as seen in Codex here [http://codex.wordpress.org/Function_Reference/do_shortcode](http://codex.wordpress.org/Function_Reference/do_shortcode)?
 * I found another code: [http://stackoverflow.com/questions/22431458/placing-php-code-in-social-locker-php-shortcode](http://stackoverflow.com/questions/22431458/placing-php-code-in-social-locker-php-shortcode)
 * It makes more sense to me.
 *  Plugin Author [OnePress](https://wordpress.org/support/users/onepressmedia/)
 * (@onepressmedia)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/hard-code-into-php-file/#post-4642100)
 * [@li-an](https://wordpress.org/support/users/li-an/):
 * Please check out the article again. I have fixed that:
    [http://support.onepress-media.com/how-to-invoke-social-locker-outside-of-post-content-directly-via-php/](http://support.onepress-media.com/how-to-invoke-social-locker-outside-of-post-content-directly-via-php/)
 * Paul
 *  [Li-An](https://wordpress.org/support/users/li-an/)
 * (@li-an)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/hard-code-into-php-file/#post-4642101)
 * Thanks, it’s more clear now – for me 🙂 – and I made it work !
    May I suggest
   you to change your example as it’s very perturbing – for me – as the content 
   you show is a Submit button. I thought at first that it was a button what needed
   to be pushed to share the content. Maybe something else to lock will be more 
   explicit (some dumb content).
 *  Plugin Author [OnePress](https://wordpress.org/support/users/onepressmedia/)
 * (@onepressmedia)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/hard-code-into-php-file/#post-4642102)
 * You’re very welcome 🙂
    Yes, you’re right. I will fix that.
 * Paul

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

The topic ‘hard code into php file?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/social-locker_ffffff.svg)
 * [OnePress Social Locker](https://wordpress.org/plugins/social-locker/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/social-locker/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/social-locker/)
 * [Active Topics](https://wordpress.org/support/plugin/social-locker/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/social-locker/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/social-locker/reviews/)

## Tags

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

 * 5 replies
 * 3 participants
 * Last reply from: [OnePress](https://wordpress.org/support/users/onepressmedia/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/hard-code-into-php-file/#post-4642102)
 * Status: resolved