0

I am trying to use the redux frame work for my options panel in a theme i have seen some theme optiosn supply a mail merge style button to include fields to be inserted into text area Ie I want to give an option for user to click on {player_id} and it would insert that mergecode into the text area is their an option for defining this.

   array(
            'id'       => 'player-redeem',
            'type'     => 'textarea',
            'title'    => __( 'Redeem POints Message', 'redux-framework-demo' ),
            'subtitle' => __( 'Redeem POints Message', 'redux-framework-demo' ),
            'desc'     => __( 'This message will be sent when the user wants to redem points.', 'redux-framework-demo' ),
            'default'  => 'Place An Order',
        ),

Edit in respononse to below

Thanks for quick reply i have the following code which i parse before sending mail

 $replacements = array(
'({playerId})' => $playerId,    
'({message_body})' => nl2br( stripslashes(  $ggs['player-redeem'] ) )
);
$message = preg_replace( array_keys( $replacements ), array_values( $replacements ),   $ggs['player-redeem']);

Which works fine but I have seen some plugins give a we menu options beside text areas to insert their tags into the text areas eg it would list {playerid} {message_body} for the end user to select them

3
  • I'm unfamiliar with the term merge code, and what they do, can you add more details?
    – Tom J Nowell
    Commented Oct 26, 2015 at 14:18
  • @TomJNowell please see above notes Commented Oct 26, 2015 at 15:52
  • Ah, like shortcodes, to be fair what you're asking for sounds like it's primarily a UI javascript task, you'll need to write the javascript and enqueue it on the relevant page, at this point it's not WordPress expertise you need, it's javascript and redux framework expertise you need, and this site isn't suitable for those. We deal in general WordPress development and having a thorough knowledge of a plugins internals is not so common a thing
    – Tom J Nowell
    Commented Oct 26, 2015 at 17:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.