| @@ -9,9 +9,9 @@ | ||
| 9 | 9 | * @param int $post_id topic or reply ID to get attachments for |
| 10 | 10 | * |
| 11 | 11 | * @return array list of attachments objects |
| 12 | 12 | */ |
| 13 | -function bbpc_get_post_attachments( $post_id ) { | |
| 13 | +function forumax_get_post_attachments( $post_id ) { | |
| 14 | 14 | $args = [ |
| 15 | 15 | 'post_type' => 'attachment', |
| 16 | 16 | 'numberposts' => -1, |
| 17 | 17 | 'post_status' => null, |
| @@ -30,9 +30,9 @@ | ||
| 30 | 30 | * @param bool $include_replies true, to include reply attachments |
| 31 | 31 | * |
| 32 | 32 | * @return int number of attachments |
| 33 | 33 | */ |
| 34 | -function bbpc_topic_attachments_count( $topic_id, $include_replies = false ) { | |
| 34 | +function forumax_topic_attachments_count( $topic_id, $include_replies = false ) { | |
| 35 | 35 | global $wpdb; |
| 36 | 36 | |
| 37 | 37 | $sql = 'select ID from ' . $wpdb->posts . ' where post_parent = ' . $topic_id . " and post_type = 'attachment'"; |
| 38 | 38 | |
| @@ -51,9 +51,9 @@ | ||
| 51 | 51 | * @param string $message error message |
| 52 | 52 | * |
| 53 | 53 | * @return WP_Error error message |
| 54 | 54 | */ |
| 55 | -function bbpc_bbattachment_handle_upload_error( &$file, $message ) { | |
| 55 | +function forumax_bbattachment_handle_upload_error( &$file, $message ) { | |
| 56 | 56 | return new WP_Error( 'wp_upload_error', $message ); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
| @@ -60,9 +60,9 @@ | ||
| 60 | 60 | * Get current page forum ID. Handles the edge cases with the edit forms. |
| 61 | 61 | * |
| 62 | 62 | * @return int |
| 63 | 63 | */ |
| 64 | -function bbpc_get_forum_id() { | |
| 64 | +function forumax_get_forum_id() { | |
| 65 | 65 | $forum_id = bbp_get_forum_id(); |
| 66 | 66 | |
| 67 | 67 | if ( $forum_id == 0 ) { |
| 68 | 68 | if ( bbp_is_topic_edit() ) { |
| @@ -76,7 +76,10 @@ | ||
| 76 | 76 | |
| 77 | 77 | return $forum_id; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | -function bbpc_bba_o( $name ) { | |
| 81 | - return BBPCATTCore::instance()->o[ $name ]; | |
| 80 | +function forumax_bba_o( $name ) { | |
| 81 | + $opts = BBPCATTCore::instance()->o; | |
| 82 | + // Return the option value if present, otherwise null. | |
| 83 | + return isset( $opts[ $name ] ) ? $opts[ $name ] : null; | |
| 82 | 84 | } |
| 85 | + | |