Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action(
- 'init',
- function () {
- if ( class_exists( 'JNews_Review_Frontend' ) ) {
- remove_filter( 'the_content', array( JNews_Review_Frontend::getInstance(), 'review_content' ), 10 );
- add_filter( 'the_content', 'custom_review_content' );
- }
- }
- );
- function custom_review_content( $content ) {
- if ( jnews_get_metabox_value( 'jnews_review.enable_review', false ) ) {
- $split_post = jnews_get_metabox_value( 'jnews_post_split.enable_post_split', false );
- if ( $split_post ) {
- return $content;
- }
- global $page, $numpages, $multipage;
- if ( $multipage ) {
- if ( $page === $numpages ) {
- return render_review_content( $content );
- }
- } else {
- return render_review_content( $content );
- }
- }
- return $content;
- }
- function render_review_content( $content ) {
- if ( class_exists( 'JNews_Review_Frontend' ) ) {
- $post_review = JNews_Review_Frontend::getInstance()->post_review();
- $content = $post_review . $content;
- }
- return $content;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement