WordPress.org

Ready to get started?Download WordPress

Forums

OnePress Social Locker
[resolved] hard code into php file? (6 posts)

  1. nomastalgic
    Member
    Posted 1 year ago #

    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/

  2. OnePress
    Member
    Plugin Author

    Posted 1 year ago #

    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/

    Also you can use a CSS selector to choose content to lock (it's a part of the Batch Lock feature).

    Paul

  3. Li-An
    Member
    Posted 10 months ago #

    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 ?

    I found another code: http://stackoverflow.com/questions/22431458/placing-php-code-in-social-locker-php-shortcode

    It makes more sense to me.

  4. OnePress
    Member
    Plugin Author

    Posted 10 months ago #

    @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/

    Paul

  5. Li-An
    Member
    Posted 10 months ago #

    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).

  6. OnePress
    Member
    Plugin Author

    Posted 10 months ago #

    You're very welcome :-)
    Yes, you're right. I will fix that.

    Paul

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags