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