| 1 |
<?php |
| 2 |
// Exit if accessed directly |
| 3 |
if( ! defined( 'ABSPATH' ) ) exit; |
| 4 |
|
| 5 |
/** |
| 6 |
* wpForo Classic Theme Functions |
| 7 |
* @hook: action - 'init' |
| 8 |
* @description: only for wpForo theme functions. For WordPress theme functions use functions-wp.php file. |
| 9 |
* @theme: Classic |
| 10 |
*/ |
| 11 |
|
| 12 |
include_once( wpftpl( 'layouts/4/forum-thread.php' ) ); |
| 13 |
include_once( wpftpl( 'layouts/4/topic-thread.php' ) ); |
| 14 |
include_once( wpftpl( 'layouts/4/post-thread.php' ) ); |
| 15 |
|
| 16 |
function wpforo_thread_reply( $post, $topic = [], $forum = [], $level = 0, $parents = [] ) { |
| 17 |
if( wpfval( $post, 'postid' ) ) { |
| 18 |
$post = wpforo_post( $post['postid'] ); |
| 19 |
wpforo_thread_reply_template( $post, $topic, $forum, $level, $parents ); |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
function wpforo_classic_reply_form_head( $string, $args ) { |
| 24 |
if( $args['layout'] === 3 && WPF()->tpl->layout_exists( 3 ) ) { |
| 25 |
$string = wpforo_phrase( 'Your Answer', false, 'default' ); |
| 26 |
} |
| 27 |
|
| 28 |
return $string; |
| 29 |
} |
| 30 |
|
| 31 |
add_filter( 'wpforo_reply_form_head', 'wpforo_classic_reply_form_head', 1, 2 ); |
| 32 |
|
| 33 |
function wpforo_forum_layout_editors( $settings, $editor ) { |
| 34 |
if( $editor === 'post' && 4 === wpfval( WPF()->current_object, 'layout' ) ) { |
| 35 |
$settings['tinymce']['toolbar1'] = 'fontsizeselect,bold,italic,underline,forecolor,bullist,numlist,alignleft,aligncenter,alignright,link,unlink,blockquote,pre,wpf_spoil,pastetext,source_code,emoticons'; |
| 36 |
$settings['editor_height'] = 100; |
| 37 |
} |
| 38 |
|
| 39 |
return $settings; |
| 40 |
} |
| 41 |
|
| 42 |
add_filter( 'wpforo_editor_settings', 'wpforo_forum_layout_editors', 1, 2 ); |
| 43 |
|