bbp_converter_setting_callback_platform()

Edit Platform setting field

Description

Source

File: bp-forums/admin/settings.php

1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
function bbp_converter_setting_callback_platform() {
 
    $platform_options = '';
    $curdir           = opendir( bbpress()->admin->admin_dir . 'converters/' );
 
    // Bail if no directory was found (how did this happen?)
    if ( empty( $curdir ) )
        return;
 
    // Loop through files in the converters folder and assemble some options
    while ( $file = readdir( $curdir ) ) {
        if ( ( stristr( $file, '.php' ) ) && ( stristr( $file, 'index' ) === false ) ) {
            $file              = preg_replace( '/.php/', '', $file );
            $platform_options .= '<option value="' . $file . '">' . esc_html( $file ) . '</option>';
        }
    }
 
    closedir( $curdir ); ?>
 
    <select name="_bbp_converter_platform" id="_bbp_converter_platform" /><?php echo $platform_options ?></select>
    <label for="_bbp_converter_platform"><?php esc_html_e( 'is the previous forum software', 'buddyboss' ); ?></label>
 
<?php
}

Changelog

Changelog
Version Description
bbPress (r3813) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.