• Resolved Marco Panichi

    (@marcopanichi)


    I’d like to check via php the value of these settings

    • API Access – XML-RPC
    • REST API Access

    Something like

    $itsec_tweaks = get_option( 'itsec_tweaks' );
    
    if ( isset( $itsec_tweaks['disable_xmlrpc'] ) )
    { /* …do something.. */ }
    
    if ( $itsec_tweaks['disable_xmlrpc'] === true )
    { /* …do something.. */ }

    How to do this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @marcopanichi,

    Below a snippet of example code for XMLRPC (untested):

    $settings = ITSEC_Modules::get_settings( 'wordpress-tweaks' );
    
    if ( 'disable' == $settings['disable_xmlrpc'] ) {
    //Do something when XMLRPC is disabled
    }
    
    if ( 'enable' == $settings['disable_xmlrpc'] ) {
    //Do something when XMLRPC is enabled
    }

    +++++ To prevent any confusion, I’m not iThemes +++++

    • This reply was modified 3 years, 4 months ago by nlpro.
    • This reply was modified 3 years, 4 months ago by nlpro. Reason: wordpress-tweaks is with a dash (not an underscore)
    Thread Starter Marco Panichi

    (@marcopanichi)

    Thank you very much!

    If it helps anyone, here is the list of tweaks options

    file_editor => boolean true
    disable_xmlrpc => string (6) "enable"
    allow_xmlrpc_multiauth => boolean false
    rest_api => string (14) "default-access"
    valid_user_login_type => string (4) "both"
    force_unique_nicename => boolean false
    disable_unused_author_pages => boolean false

    @marcopanichi

    ‘rest_api’

    Possible values: ‘default-access’ or ‘restrict-access’.

    Use the optional Debug page (Settings section) to lookup iTSec plugin settings 😉

    • This reply was modified 3 years, 4 months ago by nlpro.

    Hi @marcopanichi,

    If you require no further assistance please mark this topic as ‘Resolved’.

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

The topic ‘Check options via php’ is closed to new replies.