• I am working on a Plugin. I am using Settings API like below.

    register_setting( 'sports_api_key', 'sports_api_key' );

    How can I sanitize settings API Text value here ?

Viewing 1 replies (of 1 total)
  • AddWeb Solution

    (@addweb-solution-pvt-ltd)

    Hi @mdabufoysal,

    function sanitize_sports_api_key( $input ) {
    return sanitize_text_field( $input );
    }
    
    register_setting( 'sports_api_key', 'sports_api_key', 'sanitize_sports_api_key' );

    Hope it helps! ??

    • This reply was modified 1 year, 3 months ago by Yui.
    • This reply was modified 1 year, 3 months ago by bcworkz. Reason: code format fixed
Viewing 1 replies (of 1 total)
  • The topic ‘How to sanitize settings API value’ is closed to new replies.