• Currently using another system which uses [member] as the shortcode.

    How can i replace this with the plugins default shortcodes so

    [member]
    Some content for Members who are logged in with an s2Member Level >= 1.
    [/member]

    now returns something like this:

    [s2If current_user_can(access_s2member_level1)]
    Some content for Members who are logged in with an s2Member Level >= 1.
    [/s2If]

    https://www.ads-software.com/plugins/s2member/

Viewing 7 replies - 1 through 7 (of 7 total)
  • If i understand correctly, you would need exactly what is used in example #3 of the Scripting section :

    Example #3: Full access for any Member with a Level >= 1; also using [else] syntax.

    [s2If current_user_can(access_s2member_level1)]
    Some content for Members who are logged in with an s2Member Level >= 1.
    [else]
    Some public content.
    [/s2If]

    krumch

    (@krumch)

    @brad: I would suggest to change it manually. However, if this is not possible (massive site), I can build an automated way. Can be two variants: to run once and to change all your pages/posts, or to run each time where old shortcode appears. But, this can not be very accurate, like any automated way…

    Thread Starter Brad Dalton

    (@wordpresssites)

    @cassel Close but not quite what i was looking for. Thanks anyways.
    @krumch Thanks for the offer but I think its not that hard as i already have a simply function which creates my shortcode so i just need the name of the shortcode changed in the function which creates the S@ 2 member shortcode. Guess i can look in the files for a filter otherwise i’ll change it manually as there’s only about 100 posts.

    KTS915

    (@kts915)

    @brad,

    Couldn’t you just use the Search and Replace plugin?

    Thread Starter Brad Dalton

    (@wordpresssites)

    I’ll try that, Thanks @kts915

    krumch

    (@krumch)

    Thanks KTS915! I forgot this plugin…

    Thread Starter Brad Dalton

    (@wordpresssites)

    This is what i used https://wpsites.net/wordpress-tips/delete-invalid-shortcodes-after-changing-themes-or-plugins/

    Thanks to everyone for your suggestions.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Filter To Replace Shortcode’ is closed to new replies.