PluginProbe
bbPress / 2.6.19
bbPress v2.6.19
2.6.19 2.6.18 2.6.17 trunk 2.0 2.0-beta-1 2.0-beta-2b 2.0-beta-3 2.0-beta-3b 2.0-rc-2 2.0-rc-3 2.0-rc-4 2.0-rc-5 2.0.1 2.0.2 2.0.3 2.1 2.1-beta-1 2.1-rc1 2.1-rc2 2.1-rc3 2.1-rc4 2.1.1 2.1.2 2.1.3 All 74 releases
← All changes | includes/admin/tools/converter.php +5 -21 trunk → 2.6.19 View file →
@@ -1,10 +1,10 @@
1 1 <?php
2 2
3 3 /**
4 - * bbPress Converter.
4 + * bbPress Converter
5 5 *
6 - * Based on the hard work of Adam Ellis.
6 + * Based on the hard work of Adam Ellis
7 7 *
8 8 * @package bbPress
9 9 * @subpackage Administration
10 10 */
@@ -12,9 +12,9 @@
12 12 // Exit if accessed directly
13 13 defined( 'ABSPATH' ) || exit;
14 14
15 15 /**
16 - * Return an array of available converters.
16 + * Return an array of available converters
17 17 *
18 18 * @since 2.6.0 bbPress (r6448)
19 19 *
20 20 * @return array
@@ -30,10 +30,8 @@
30 30 $curdir = opendir( $path );
31 31
32 32 // Look for the converter file in the converters directory
33 33 if ( false !== $curdir ) {
34 -
35 - // phpcs:ignore Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition
36 34 while ( $file = readdir( $curdir ) ) {
37 35 if ( stristr( $file, '.php' ) && stristr( $file, 'index' ) === false ) {
38 36 $name = preg_replace( '/.php/', '', $file );
39 37 if ( 'Example' !== $name ) {
@@ -51,15 +49,9 @@
51 49 natcasesort( $files );
52 50 }
53 51 }
54 52
55 - /**
56 - * Filters the array of available converters.
57 - *
58 - * @since 2.6.0 bbPress (r6448)
59 - *
60 - * @param array $files Array of available converters with names as keys and file paths as values.
61 - */
53 + // Filter & return
62 54 return (array) apply_filters( 'bbp_get_converters', $files );
63 55 }
64 56
65 57 /**
@@ -111,9 +103,8 @@
111 103 // Try to create a new converter object
112 104 if ( ! empty( $converter_file ) ) {
113 105
114 106 // Try to include the converter
115 - // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
116 107 @include_once $converter_file;
117 108
118 109 // Try to instantiate the converter object
119 110 if ( class_exists( $platform ) ) {
@@ -120,14 +111,7 @@
120 111 $converter = new $platform();
121 112 }
122 113 }
123 114
124 - /**
125 - * Filters the newly created converter object.
126 - *
127 - * @since 2.6.0 bbPress (r6788)
128 - *
129 - * @param mixed $converter The converter object if it exists, null otherwise.
130 - * @param string $platform Name of the platform class used for conversion.
131 - */
115 + // Filter & return
132 116 return apply_filters( 'bbp_new_converter', $converter, $platform );
133 117 }